Zookeeper群起脚本启动失败及查看状态出现:Error contacting service. It is probably not running

Posted mwcloud

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Zookeeper群起脚本启动失败及查看状态出现:Error contacting service. It is probably not running相关的知识,希望对你有一定的参考价值。

1.问题:

群起脚本启动后查看jps没有出现:QuorumPeerMain

Zookeeper正常启动但是群起脚本查状态出现:Error contacting service. It is probably not running错误

ZooKeeper JMX enabled by default
Using config: /opt/module/zookeeper-3.4.10/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.

2.原因:

脚本没有加上source /etc/profile;

3.正确脚本:(仅供参考,请指正)

#! /bin/bash

case $1 in
"start")
        for i in hadoop201 hadoop202 hadoop203
        do
                ssh $i "source /etc/profile;/opt/module/zookeeper-3.4.10/bin/zkServer.sh start"
        done
;;
"stop")
        for i in hadoop201 hadoop202 hadoop203
        do
                ssh $i "/opt/module/zookeeper-3.4.10/bin/zkServer.sh stop"
        done
;;
"status")
        for i in hadoop201 hadoop202 hadoop203
        do
                ssh $i "source /etc/profile;/opt/module/zookeeper-3.4.10/bin/zkServer.sh status"
        done
;;
esac

 

以上是关于Zookeeper群起脚本启动失败及查看状态出现:Error contacting service. It is probably not running的主要内容,如果未能解决你的问题,请参考以下文章

zookeeper群集部署及概述

zookeeper群集部署及概述

zookeeper群集部署及概述

zookeeper集群启停及状态查看脚本(linux)

搭建Zookeeper集群服务启动失败

zookeeper集群创建失败