当我们自己编写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
8297

被折叠的 条评论
为什么被折叠?



