java - Windows 上的动物园管理员

标签 java windows apache-zookeeper

我在 windows 环境下运行 zookeeper 有一些困难。

我下载了 zookeeper 3.4.6。提取它。在 conf 文件夹中创建了一个 zoo.cfg,详细信息如下:

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

然后我尝试从 bin 文件夹运行 zkServer.cmd。但我不确定这是否运行。

如何测试 Zookeeper 服务器是否在 Windows 上运行?

最佳答案

如果您想查看结果,请以管理员身份从 Windows 命令行工具运行 zkServer.cmd,而不是单击它,它会在最后关闭,您将无法看到结果。

此外,您应该将 dataDir 更新为 C:/tmp/... 形式的有效 Windows 目录。

在命令行上,调用 zkServer.cmd 后,您应该能够在命令行上看到不同的 [INFO] 消息,最后一条是绑定(bind)到端口 0.0.0.0/0.0.0.0:2181。

关于java - Windows 上的动物园管理员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24414082/

相关文章:

hadoop - Solr - 恢复 Zookeeper 后丢失配置

solr - 在 SolrCloud 设置中更改 Schema.xml

java - 在 StringWriter 中获取字符串长度?

java - Android 网络服务 asp .asmx

c# - 完整 Windows 桌面的实时视频处理

windows - 以管理员身份运行 VBScript 并等待完成

java - 从不同的类获取声明的变量

java - 使用我的 JFrame 同时播放音乐

windows - Windows Server 2003 中的最大线程数是多少?

apache-zookeeper - solr cloud中zookeeper的角色