win10下安装并启动zookeeper

  下载直接到zk的官网(zookeeper.apache.org)即可,点击右边的Releases,在Download下再点Download进入镜像下载页面,在给出的链接列表里选择一个镜像地址,进去后选择版本(这里最新的是3.4.10)下载压缩包。

  解压到本地(这里是D盘)后,需要修改下配置文件名,进入conf目录,将zoo_sample.cfg改为zoo.cfg。如果仅将zk作为单点来用,那么进入bin目录双击zkServer.cmd启动服务端,出现命令行窗口:

D:\Dev\zookeeper-3.4.10\bin>call "D:\Dev\Java\jdk1.8.0_102"\bin\java "-Dzookeeper.log.dir=D:\Dev\zookeeper-3.4.10\bin\.." "-Dzookeeper.root.logger=INFO,CONSOLE" -cp "D:\Dev\zookeeper-3.4.10\bin\..\build\classes;D:\Dev\zookeeper-3.4.10\bin\..\build\lib\*;D:\Dev\zookeeper-3.4.10\bin\..\*;D:\Dev\zookeeper-3.4.10\bin\..\lib\*;D:\Dev\zookeeper-3.4.10\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "D:\Dev\zookeeper-3.4.10\bin\..\conf\zoo.cfg"
2018-09-11 11:19:28,567 [myid:] - INFO  [main:[email protected]134] - Reading configuration from: D:\Dev\zookeeper-3.4.10\bin\..\conf\zoo.cfg
2018-09-11 11:19:28,600 [myid:] - INFO  [main:[email protected]78] - autopurge.snapRetainCount set to 3
2018-09-11 11:19:28,600 [myid:] - INFO  [main:[email protected]79] - autopurge.purgeInterval set to 0
2018-09-11 11:19:28,600 [myid:] - INFO  [main:[email protected]101] - Purge task is not scheduled.
2018-09-11 11:19:28,602 [myid:] - WARN  [main:[email protected]113] - Either no config or no quorum defined in config, running  in standalone mode
2018-09-11 11:19:28,767 [myid:] - INFO  [main:[email protected]134] - Reading configuration from: D:\Dev\zookeeper-3.4.10\bin\..\conf\zoo.cfg
2018-09-11 11:19:28,768 [myid:] - INFO  [main:[email protected]96] - Starting server
2018-09-11 11:19:28,800 [myid:] - INFO  [main:[email protected]100] - Server environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT
2018-09-11 11:19:28,800 [myid:] - INFO  [main:[email protected]100] - Server environment:host.name=windows10.microdone.cn
2018-09-11 11:19:28,801 [myid:] - INFO  [main:[email protected]100] - Server environment:java.version=1.8.0_102
2018-09-11 11:19:28,801 [myid:] - INFO  [main:[email protected]100] - Server environment:java.vendor=Oracle Corporation
2018-09-11 11:19:28,801 [myid:] - INFO  [main:[email protected]100] - Server environment:java.home=D:\Dev\Java\jdk1.8.0_102\jre
2018-09-11 11:19:28,802 [myid:] - INFO  [main:[email protected]100] - Server environment:java.class.path=D:\Dev\zookeeper-3.4.10\bin\..\build\classes;D:\Dev\zookeeper-3.4.10\bin\..\build\lib\*;D:\Dev\zookeeper-3.4.10\bin\..\zookeeper-3.4.10.jar;D:\Dev\zookeeper-3.4.10\bin\..\lib\jline-0.9.94.jar;D:\Dev\zookeeper-3.4.10\bin\..\lib\log4j-1.2.16.jar;D:\Dev\zookeeper-3.4.10\bin\..\lib\netty-3.10.5.Final.jar;D:\Dev\zookeeper-3.4.10\bin\..\lib\slf4j-api-1.6.1.jar;D:\Dev\zookeeper-3.4.10\bin\..\lib\slf4j-log4j12-1.6.1.jar;D:\Dev\zookeeper-3.4.10\bin\..\conf
2018-09-11 11:19:28,802 [myid:] - INFO  [main:[email protected]100] - Server environment:java.library.path=D:\Dev\Java\jdk1.8.0_102\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Windows\CCM;D:\Utility\TortoiseSVN\bin;D:\Utility\PuTTY\;D:\Dev\Java\jdk1.8.0_102\bin;D:\Dev\apache-maven-3.3.9\bin;D:\Dev\apache-tomcat-9.0.0.M26\bin;D:\Dev\oracle\product\11.2.0\dbhome_1\bin;C:\ProgramData\Oracle\Java\javapath;D:\Dev\oracle\instantclient_12_2;D:\Dev\nodejs\;C:\Program Files\MySQL\MySQL Utilities 1.6\;D:\Dev\Git\cmd;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Users\wulf\AppData\Local\Microsoft\WindowsApps;C:\Users\wulf\AppData\Roaming\npm;;D:\Utility\Fiddler;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;.
2018-09-11 11:19:28,802 [myid:] - INFO  [main:[email protected]100] - Server environment:java.io.tmpdir=C:\Users\wulf\AppData\Local\Temp2018-09-11 11:19:28,802 [myid:] - INFO  [main:[email protected]100] - Server environment:java.compiler=<NA>
2018-09-11 11:19:28,803 [myid:] - INFO  [main:[email protected]100] - Server environment:os.name=Windows 10
2018-09-11 11:19:28,803 [myid:] - INFO  [main:[email protected]100] - Server environment:os.arch=amd64
2018-09-11 11:19:28,804 [myid:] - INFO  [main:[email protected]100] - Server environment:os.version=10.0
2018-09-11 11:19:28,805 [myid:] - INFO  [main:[email protected]100] - Server environment:user.name=wulf
2018-09-11 11:19:28,805 [myid:] - INFO  [main:[email protected]100] - Server environment:user.home=C:\Users\wulf
2018-09-11 11:19:28,806 [myid:] - INFO  [main:[email protected]100] - Server environment:user.dir=D:\Dev\zookeeper-3.4.10\bin
2018-09-11 11:19:28,816 [myid:] - INFO  [main:[email protected]829] - tickTime set to 2000
2018-09-11 11:19:28,816 [myid:] - INFO  [main:[email protected]838] - minSessionTimeout set to -1
2018-09-11 11:19:28,817 [myid:] - INFO  [main:[email protected]847] - maxSessionTimeout set to -1
2018-09-11 11:19:29,070 [myid:] - INFO  [main:[email protected]89] - binding to port 0.0.0.0/0.0.0.0:2181

  再双击zkCli.cmd启动客户端:

Connecting to localhost:2181
2018-09-11 11:19:47,802 [myid:] - INFO  [main:[email protected]100] - Client environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT
2018-09-11 11:19:47,805 [myid:] - INFO  [main:[email protected]100] - Client environment:host.name=windows10.microdone.cn
2018-09-11 11:19:47,805 [myid:] - INFO  [main:[email protected]100] - Client environment:java.version=1.8.0_102
2018-09-11 11:19:47,808 [myid:] - INFO  [main:[email protected]100] - Client environment:java.vendor=Oracle Corporation
2018-09-11 11:19:47,809 [myid:] - INFO  [main:[email protected]100] - Client environment:java.home=D:\Dev\Java\jdk1.8.0_102\jre
2018-09-11 11:19:47,809 [myid:] - INFO  [main:[email protected]100] - Client environment:java.class.path=D:\Dev\zookeeper-3.4.10\bin\..\build\classes;D:\Dev\zookeeper-3.4.10\bin\..\build\lib\*;D:\Dev\zookeeper-3.4.10\bin\..\zookeeper-3.4.10.jar;D:\Dev\zookeeper-3.4.10\bin\..\lib\jline-0.9.94.jar;D:\Dev\zookeeper-3.4.10\bin\..\lib\log4j-1.2.16.jar;D:\Dev\zookeeper-3.4.10\bin\..\lib\netty-3.10.5.Final.jar;D:\Dev\zookeeper-3.4.10\bin\..\lib\slf4j-api-1.6.1.jar;D:\Dev\zookeeper-3.4.10\bin\..\lib\slf4j-log4j12-1.6.1.jar;D:\Dev\zookeeper-3.4.10\bin\..\conf
2018-09-11 11:19:47,809 [myid:] - INFO  [main:[email protected]100] - Client environment:java.library.path=D:\Dev\Java\jdk1.8.0_102\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Windows\CCM;D:\Utility\TortoiseSVN\bin;D:\Utility\PuTTY\;D:\Dev\Java\jdk1.8.0_102\bin;D:\Dev\apache-maven-3.3.9\bin;D:\Dev\apache-tomcat-9.0.0.M26\bin;D:\Dev\oracle\product\11.2.0\dbhome_1\bin;C:\ProgramData\Oracle\Java\javapath;D:\Dev\oracle\instantclient_12_2;D:\Dev\nodejs\;C:\Program Files\MySQL\MySQL Utilities 1.6\;D:\Dev\Git\cmd;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Users\wulf\AppData\Local\Microsoft\WindowsApps;C:\Users\wulf\AppData\Roaming\npm;;D:\Utility\Fiddler;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;.
2018-09-11 11:19:47,809 [myid:] - INFO  [main:[email protected]100] - Client environment:java.io.tmpdir=C:\Users\wulf\AppData\Local\Temp2018-09-11 11:19:47,809 [myid:] - INFO  [main:[email protected]100] - Client environment:java.compiler=<NA>
2018-09-11 11:19:47,809 [myid:] - INFO  [main:[email protected]100] - Client environment:os.name=Windows 10
2018-09-11 11:19:47,809 [myid:] - INFO  [main:[email protected]100] - Client environment:os.arch=amd64
2018-09-11 11:19:47,809 [myid:] - INFO  [main:[email protected]100] - Client environment:os.version=10.0
2018-09-11 11:19:47,809 [myid:] - INFO  [main:[email protected]100] - Client environment:user.name=wulf
2018-09-11 11:19:47,810 [myid:] - INFO  [main:[email protected]100] - Client environment:user.home=C:\Users\wulf
2018-09-11 11:19:47,810 [myid:] - INFO  [main:[email protected]100] - Client environment:user.dir=D:\Dev\zookeeper-3.4.10\bin
2018-09-11 11:19:47,811 [myid:] - INFO  [main:[email protected]438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=[email protected]
Welcome to ZooKeeper!
2018-09-11 11:19:48,062 [myid:] - INFO  [main-SendThread(0:0:0:0:0:0:0:1:2181):[email protected]1032] - Opening socket connection to server 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
2018-09-11 11:19:48,065 [myid:] - INFO  [main-SendThread(0:0:0:0:0:0:0:1:2181):[email protected]876] - Socket connection established to 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, initiating session
JLine support is enabled
[zk: localhost:2181(CONNECTING) 0] 2018-09-11 11:19:48,090 [myid:] - INFO  [main-SendThread(0:0:0:0:0:0:0:1:2181):[email protected]1299] - Session establishment complete on server 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, sessionid = 0x165c6a41e3a0000, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null

  这时就可以开始在客户端敲命令了:

[zk: localhost:2181(CONNECTED) 2] ls /
[zookeeper]
[zk: localhost:2181(CONNECTED) 3] create /zk hello,world!
Created /zk
[zk: localhost:2181(CONNECTED) 4] ls /
[zk, zookeeper]
[zk: localhost:2181(CONNECTED) 5] get /zk
hello,world!
cZxid = 0x2
ctime = Tue Sep 11 11:22:48 CST 2018
mZxid = 0x2
mtime = Tue Sep 11 11:22:48 CST 2018
pZxid = 0x2
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 12
numChildren = 0

  服务端也会打印客户端过来的请求:

2018-09-11 11:19:48,064 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:[email protected]192] - Accepted socket connection from /0:0:0:0:0:0:0:1:57459
2018-09-11 11:19:48,073 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:[email protected]942] - Client attempting to establish new session at /0:0:0:0:0:0:0:1:57459
2018-09-11 11:19:48,076 [myid:] - INFO  [SyncThread:0:[email protected]203] - Creating new log file: log.1
2018-09-11 11:19:48,088 [myid:] - INFO  [SyncThread:0:[email protected]687] - Established session 0x165c6a41e3a0000 with negotiated timeout 30000 for client /0:0:0:0:0:0:0:1:57459

  

原文地址:https://www.cnblogs.com/wuxun1997/p/9626683.html

时间: 2024-10-27 17:14:16

win10下安装并启动zookeeper的相关文章

win10下安装win7双系统

win10下安装win7双系统 相信很多人和博主一样,心血来潮就升级了win10(要不就被强制升级了),但是当我们做开发的,渐渐就发现问题了,各种开发软件各种不兼容(ietexter.myeclipse等)不要问博主是怎么知道的说起来都是泪啊!还有,身为一个骨灰级游戏玩家,看着那FPS简直就是惨不忍睹!咳咳,好像扯远了,接下来就进入咱们的正题-- 准备材料: 启动盘一个(U盘,移动硬盘什么的都可以,只要是启动盘就行,网上好多启动盘制作教材,在这里博主就不仔细阐述了) win7镜像文件一份 操作过

Win10 下安装 SQL server 2008

Win10 下安装 SQL server 2008安装时出现一下问题: 1.有时执行某些操作后,没有反应.多试几次吧 2.验证时,报重启失败. 运行注册表,找到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager目录,在右侧找到PendingFileRenameOperations,将其删除. 3.安装程序集“Microsoft.VC90.ATL,version="9.0.21022.8",...错误 解

WIN10下安装Linux子系统并安装xface4界面

WIN10下安装Linux子系统并安装xface4界面,使用win10自带的远程桌面工具登陆成功. 成功截图: 安装步骤 1.安装[适用于Linux的Windows子系统]组件 2.win10应用商店搜索ubantu,我这里测试使用的18.04版本 3.开启菜单搜索ubantu启动,并配置用户账户密码 4.配置下载源,这里是因为国外站点下载太慢 配置源为阿里源,可以从以下网址找 https://developer.aliyun.com/mirror ubantu下路径为etc/apt/sourc

Win10下安装MySQL8

第一步:下载安装包 官网: https://dev.mysql.com/downloads/mysql/ 百度网盘:mysql-8.0.18-winx64.zip 第二步:解压 注意:解压到的目录不能出现中文或者空格等名称 第三步:配置 1.新建文件和文件夹 在解压目录下,新建 my.ini文件和 data 文件夹,如图: data文件夹保持为空就好,下面对 my.ini 进行配置: 解压目录就是安装目录,我的解压目录是D:\mysql-8.0.18-winx64,所以下面的目录都以这个路径为准

DELPHI7在WIN8和WIN10下安装和运行

DELPHI7在WIN8下安装后可以打开运行,但发现设置断点DEBUG运行DLL工程时会卡死(IDE长时间无反应,不报错). DELPHI7在WIN10下安装后打开的时候会报错,无法运行. 以上两种情况的解决办法: 设置DELPHI32.EXE以WINDOWS XP SP2的兼容模式下运行后一切正常. 也就是说WIN8和WIN10还是可以安装DELPHI7的.

ubuntu下安装、启动和卸载SSH

ubuntu下安装.启动和卸载SSH 1.先停掉SSH服务:sudo stop ssh    2.卸载openssh-server:apt-get remove openssh-server    3.卸载openssh-client: apt-get remove openssh-server    4.安装openssh-server:apt-get install openssh-server    5.安装openssh-client:apt-get install openssh-cl

【暂未解决】win10下安装VS2017 15.3版本 提示 未能安装包“Microsoft.NET.4.6.FullRedist.NonThreshold.Resources,version=4.6.81.9,language=zh-CN”。

win10下安装VS2017 15.3版本的时候,出现以上错误日志提示,请问如何解决的哇? 这个问题,开始我以为是我的安装包所在的路径问题引起的,但是我将安装包移动到了磁盘根目录进行安装,依然出现这个问题.目前该问题尚未解决,正在积极寻求解决办法. “ 安装出现问题. 可通过以下方式排查包故障问题: 1. 使用以下搜索 URL 来搜索针对每个包故障的解决方案 2. 针对受与影响的工作负荷或组件修改选项,然后重新尝试安装 3. 从计算机上删除产品,然后再次安装 如果 Developer Commu

win10下安装vs2013无法安装解决方案

win10下安装vs2013无法安装解决方案 win+r,输入cmd进入命令行 进入界面后选择修复 进入vs_ultimate文件所在目录,输入: vs_ultimate /Uninstall    正确vs2013/Uninstall 参考 http://blog.csdn.net/smallflyingpig/article/details/52419832 原文地址:https://www.cnblogs.com/yx007/p/9036546.html

Win10下安装Python3及Python2、数据类型、格式化输出、运算符

Win10下安装Python3及Python2 下载的官网地址: https://www.python.org/downloads/windows/ 安装Python3: 安装完成之后,在开始处输入 cmd ,测试Python是否安装成功. 输入: python -V ----> pip -v ----> pip 安装Python2: 安装完成之后,打开之前打开的命令提示符页面,测试Python是否安装成功. 输入: python -V ----> pip -v Python3.x与Py