kafka集群脚本启动失败,在kafkaServer.out中提示nohup: failed to run command `java’: No such file or directory

kafka集群脚本启动失败,在kafkaServer.out中提示nohup: failed to run command `java’: No such file or directory,第1张

kafka集群脚本启动失败,在kafkaServer.out中提示nohup: failed to run command `java’: No such file or directory
  1. 问题描述:

今天在使用shell脚本启动集群时,发现无法启动集群,在logs目录下只有一个kafkaServer.out文件,其中内容为:nohup: failed to run command `java’: No such file or directory

  1. 原本的shell脚本内容如下
#!/bin/bash
  
case  in
"start"){
        for i in hadoop002 hadoop003 hadoop004
        do
                echo "========== $i ==========" 
                ssh $i "/opt/module/kafka/bin/kafka-server-start.sh -daemon /opt/module/kafka/config/server.properties"
        done
        };;

"stop"){
        for i in hadoop002 hadoop003 hadoop004
        do
                echo "========== $i ==========" 
                ssh $i "/opt/module/kafka/bin/kafka-server-stop.sh"
        done
        };;
esac
  1. 解决方法:

修改脚本

#!/bin/bash
  
case  in
"start"){
        for i in hadoop002 hadoop003 hadoop004
        do
                echo "========== $i ==========" 
                ssh $i "source /etc/profile;nohup /opt/module/kafka/bin/kafka-server-start.sh -daemon /opt/module/kafka/config/server.properties"
        done
        };;

"stop"){
        for i in hadoop002 hadoop003 hadoop004
        do
                echo "========== $i ==========" 
                ssh $i "/opt/module/kafka/bin/kafka-server-stop.sh"
        done
        };;
esac
  1. 问题解决

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5612699.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-15
下一篇2022-12-15

发表评论

登录后才能评论

评论列表(0条)

    保存