shell脚本运行没反应
当我们自己编写linux脚本shell文件时间,代码写的没有问题,但是怎么运行都没,那么我们只需要在shell代码的运行代码最前面更新一下主机的环境变量 source /etc
·
当我们自己编写linux脚本shell文件时,代码写的没有问题,但是怎么运行都没反应,那么我们只需要在shell代码的运行代码最前面更新一下当前主机的环境变量 source /etc/profile;
例:
for host in hadoop101 hadoop102 hadoop103
do
echo **************$host starting kafka...************
ssh $host "source /etc/profile; /opt/module/kafka-0.11/bin/kafka-server-start.sh -daemon /opt/module/kafka-0.11/config/server.properties"
done
更多推荐
已为社区贡献3条内容
所有评论(0)