大佬教程收集整理的这篇文章主要介绍了shell 远程启动flume,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
今天,在公司服务器上使用脚本远程启动flume:
#!/bin/sh for ip in 10.153.140.253; #for ip in 10.153.140.250 10.153.140.251 10.153.140.252 10.153.140.253 10.153.140.254 10.153.140.255; do ssh root@$ip "ps -ef | grep java | grep -v grep |cut -c 9-15 | xargs kill -9" ssh root@$ip "rm -rf /usr/local/apache-flume-1.7.0-bin/lib/ttbrain-log-flume-sink-jar-with-dependencies.jar" scp ./ttbrain-log-flume-sink-jar-with-dependencies.jar root@$ip":/usr/local/apache-flume-1.7.0-bin/lib/" ssh root@$ip "nohup flume-ng agent -c /usr/local/apache-flume-1.7.0-bin/conf -f /usr/local/apache-flume-1.7.0-bin/conf/ENGIne-api-log.conf -n agent1 >/dev/null 2>&1 &" done
scp_lib.sh: line 10: nohup flume-ng agent -c /usr/local/apache-flume-1.7.0-bin/conf -f /usr/local/apache-flume-1.7.0-bin/conf/ENGIne-api-log.conf -n agent1 >/dev/null 2>&1 &: No such file or directory
后来,经过检查,使用下面的方式,成功:
#!/bin/sh for ip in 10.153.140.253; #for ip in 10.153.140.250 10.153.140.251 10.153.140.252 10.153.140.253 10.153.140.254 10.153.140.255; do ssh root@$ip "ps -ef | grep java | grep -v grep |cut -c 9-15 | xargs kill -9" ssh root@$ip "rm -rf /usr/local/apache-flume-1.7.0-bin/lib/ttbrain-log-flume-sink-jar-with-dependencies.jar" scp ./ttbrain-log-flume-sink-jar-with-dependencies.jar root@$ip":/usr/local/apache-flume-1.7.0-bin/lib/" echo "nohup flume-ng agent -c /usr/local/apache-flume-1.7.0-bin/conf -f /usr/local/apache-flume-1.7.0-bin/conf/ENGIne-api-log.conf -n agent1 >/dev/null 2>&1 &" | ssh -T $ip done
以上是大佬教程为你收集整理的shell 远程启动flume全部内容,希望文章能够帮你解决shell 远程启动flume所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。