扩容

apache-storm-1.1.0/bin/storm  rebalance mytest -w 1 -n 2 -e get_activity=12 -e main_bolt=12

监控kafka lag命令

java -cp toollib/storm-kafka-monitor-1.1.0.jar org.apache.storm.kafka.monitor.KafkaOffsetLagUtil -o -z 192.168.6.55    -t nirvana_java  -n /nirvana_java/nirvana_java_id -r /brokers|  tr 'lag' '\n' |grep '^": '|awk  -F '}' '{print $1}'|awk '{print $2}'

查看tps

lastvalue=0
for i in `seq 1 60000`
do
    v=`curl -s http://192.168.6.52:8080/api/v1/topology/$1?window=600| awk -F 'spouts' '{print $2}'|awk  -F ']' '{print $1}'|tr ',' '\n'|grep acked|awk -F ':' '{print $2}' `

    if [ $v != $lastvalue ] ; then
        t=`date "+%H:%M:%S"`
        echo "$t      $v   " `expr $v - $lastvalue`
    fi
    lastvalue=$v
    sleep 1
done

查看每个事件的平均延迟

for i in `seq 1 60000`
do
    v=`curl -s http://192.168.6.52:8080/api/v1/topology/$1?window=600| awk -F 'spouts' '{print $2}'|awk  -F ']' '{print $1}'|tr ',' '\n'|grep completeLatency|awk -F ':' '{print $2}' `

    t=`date "+%H:%M:%S"`
    echo "$t      $v"
    sleep 10
done

查看bolt负载

for i in `seq 1 60000`
do
    v=`curl -s http://192.168.6.52:8080/api/v1/topology/$1?window=600| awk -F '"bolts"' '{print $2}'|awk  -F ']' '{print $1}'|tr ',' '\n'|grep capacity|awk -F ':' '{print $2}'`

    t=`date "+%H:%M:%S"`
    echo "$t      $v"
    sleep 10
done