是否正在运行或启动

是否正在运行或启动

本文介绍了如何从命令提示符检查 ZooKeeper 是否正在运行或启动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我探索了一些设置 kafka 的选项,我知道 Zookeeper 必须启动并运行才能启动 kafka.

I exploring a few options to setup kafka and I knew that the Zookeeper has to be up and running to initiate a kafka.

我想知道如何找到以下内容.

I would like to know how can I find the below.

1)我的zookeeper实例的主机名和端口---我检查了zoo.cfg,我只能找到ClientPort而不是主机名,主机名会是我的机器的主机名吗??

1) hostname and port for my zookeeper instance---I checked the zoo.cfg and I could only find the ClientPort not the hostname, will hostname be the hostname of my box??

2) 要检查 ZooKeeper 是否已启动并正在运行---我尝试执行 ps -ef |grep "zoo" 我找不到任何东西.可能是我用错关键词搜索??

2) To check if ZooKeeper is up and running---I tried to do a ps -ef | grep "zoo" I could not find anything. May be I am using a wrong key word to search??

真的很感激任何帮助吗?

Any help would be really appreciated?

推荐答案

检查 Zookeeper 是否可访问.一种方法是简单地 telnet 到正确的端口并执行 stats 命令.

To check if Zookeeper is accessible. One method is to simply telnet to the proper port and execute the stats command.

root@host:~# telnet localhost 2181
Trying 127.0.0.1...
Connected to myhost.
Escape character is '^]'.
stats
Zookeeper version: 3.4.3-cdh4.0.1--1, built on 06/28/2012 23:59 GMT
Clients:

Latency min/avg/max: 0/0/677
Received: 4684478
Sent: 4687034
Outstanding: 0
Zxid: 0xb00187dd0
Mode: leader
Node count: 127182
Connection closed by foreign host.

这篇关于如何从命令提示符检查 ZooKeeper 是否正在运行或启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 17:00