当前位置:   article > 正文

Zookeeper的启动验证 JMX enabled by default Using config: /opt/modules/zookeeper-3.4.5/bin/../conf/zoo.cf_zookeeper开启jmx如何验证

zookeeper开启jmx如何验证
1 )四字命令
Zookeeper 服务器成功启动的前提下,在 Linux 侧的 shell 命令端口执行下面的 ruok 四字命令, 如果能够显示
imok ,表示 zk 服务器端成功启动。
使用四字命令:
echo ruok | nc 127.0.0.1 2181
 

启动报错误:

 

  1. [root@Hadoop ~]# zook
  2. JMX enabled by default
  3. Using config: /opt/modules/zookeeper-3.4.5/bin/../conf/zoo.cfg
  4. Starting zookeeper ... STARTED
  5. [root@Hadoop ~]# cd /opt/modules/zookeeper-3.4.5/bin
  6. [root@Hadoop bin]# ./zkServer.sh status
  7. JMX enabled by default
  8. Using config: /opt/modules/zookeeper-3.4.5/bin/../conf/zoo.cfg
  9. Error contacting service. It is probably not running.
  10. [root@Hadoop bin]#

解决办法 :

[root@Hadoop bin]# cd  ../zkData/
[root@Hadoop zkData]# ls
my.id  zookeeper_server.pid
[root@Hadoop zkData]# cat  my.id 

1
[root@Hadoop zkData]# vi  my.id 
[root@Hadoop zkData]# cd  ./bin
-bash: cd: ./bin: No such file or directory
[root@Hadoop zkData]# cd  ..
[root@Hadoop zookeeper-3.4.5]# cd  bin
[root@Hadoop bin]# ./zkServer.sh  stop
JMX enabled by default
Using config: /opt/modules/zookeeper-3.4.5/bin/../conf/zoo.cfg
Stopping zookeeper ... ./zkServer.sh: line 143: kill: (2605) - No such process
STOPPED
[root@Hadoop zkData]# ls
my.id  zookeeper_server.pid
[root@Hadoop zkData]# rm  -rf zookeeper_server.pid 
[root@Hadoop zkData]# cat  my.id 
1
[root@Hadoop zkData]# cd ../bin
[root@Hadoop bin]# ./zkServer.sh start
JMX enabled by default
Using config: /opt/modules/zookeeper-3.4.5/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@Hadoop bin]# ./zkServer.sh status
主要需要查询日志然后才可以进行启动哦:

操作步骤在bin的下面查询。out日志

  1. [root@Hadoop zkData]# cd ../bin
  2. [root@Hadoop bin]# ./zkServer.sh start
  3. JMX enabled by default
  4. Using config: /opt/modules/zookeeper-3.4.5/bin/../conf/zoo.cfg
  5. Starting zookeeper ... STARTED
  6. [root@Hadoop bin]# ./zkServer.sh status
  7. JMX enabled by default
  8. Using config: /opt/modules/zookeeper-3.4.5/bin/../conf/zoo.cfg
  9. Error contacting service. It is probably not running.
  10. [root@Hadoop bin]# ls
  11. README.txt zkCleanup.sh zkCli.cmd zkCli.sh zkEnv.cmd zkEnv.sh zkServer.cmd zkServer.sh zookeeper.out
  12. [root@Hadoop bin]# tail -f zookeeper.out
  13. 2020-02-28 23:04:41,337 [myid:] - ERROR [main:QuorumPeerMain@85] - Invalid config, exiting abnormally
  14. org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /opt/modules/zookeeper-3.4.5/bin/../conf/zoo.cfg
  15. at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:121)
  16. at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:101)
  17. at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
  18. Caused by: java.lang.IllegalArgumentException: /opt/modules/zookeeper-3.4.5/zkData/myid file is missing
  19. at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:344)
  20. at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:117)
  21. ... 2 more
  22. Invalid config, exiting abnormally
  23. ^C
  24. [root@Hadoop bin]# cd ../zkData/
  25. [root@Hadoop zkData]# ls
  26. my.id zookeeper_server.pid
  27. [root@Hadoop zkData]# mv my.id myid
  28. [root@Hadoop zkData]# ls
  29. myid zookeeper_server.pid
  30. [root@Hadoop zkData]# zook
  31. JMX enabled by default
  32. Using config: /opt/modules/zookeeper-3.4.5/bin/../conf/zoo.cfg
  33. Starting zookeeper ... STARTED
  34. [root@Hadoop zkData]#

 

然后查询状态,就是启动正常:

  1. [root@Hadoop ~]# cd /opt/modules/zookeeper-3.4.5/bin
  2. [root@Hadoop bin]# ./zkServer.sh status
  3. JMX enabled by default
  4. Using config: /opt/modules/zookeeper-3.4.5/bin/../conf/zoo.cfg
  5. Mode: follower
  6. [root@Hadoop bin]#

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/554948
推荐阅读
相关标签
  

闽ICP备14008679号