安装JmxTrans

  1. cd /share
  2. wget https://repo1.maven.org/maven2/org/jmxtrans/jmxtrans/270/jmxtrans-270-dist.tar.gz
  3. tar -zxvf jmxtrans-270-dist.tar.gz -C ~/modules/

启动JMX代理

  1. cd /home/vagrant/modules/jmxtrans-270/
  2. # 脚本赋权
  3. sudo chmod +x ./bin/jmxtrans.sh
  4. # 加载所有*.json
  5. JAR_FILE=./lib/jmxtrans-all.jar ./bin/jmxtrans.sh start
  6. # 指定加载某类型的json
  7. JAR_FILE=./lib/jmxtrans-all.jar ./bin/jmxtrans.sh start ./bin/zk*-jmxtrans.json
  8. # 指定文件方式启动
  9. bin/jmxtrans.sh start ./bin/kafka_jvm.json
  10. bin/jmxtrans.sh stop
  11. bin/jmxtrans.sh status