Skip to content

Instantly share code, notes, and snippets.

@XiaochenCui
Last active June 20, 2019 05:45
Show Gist options
  • Save XiaochenCui/f4439b778c9486a84c2aaeacf6d4ac59 to your computer and use it in GitHub Desktop.
Save XiaochenCui/f4439b778c9486a84c2aaeacf6d4ac59 to your computer and use it in GitHub Desktop.
devops cheasheet

Hbase shell

  • count rows of a table
    hbase org.apache.hadoop.hbase.mapreduce.RowCounter <tablename>

Kafka

  • count message of a topic
    ./bin/kafka-run-class.sh kafka.tools.GetOffsetShell 
    --broker-list <broker>:  <port> 
    --topic <topic-name> --time -1 --offsets 1 
    | awk -F  ":" '{sum += $3} END {print sum}'
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment