ZooKeeper 安裝與部署


一、下載

下載地址:http://mirror.bit.edu.cn/apache/zookeeper/stable/apache-zookeeper-3.5.5-bin.tar.gz

 

二、安裝

直接解壓到期望文件夾。

 

三、配置

在解壓后的文件夾中添加兩個目錄,data和logs,用於存儲數據與日志。

文件夾conf中,存放配置文件,現有一個名為zoo_sample.cfg的文件,這是示例配置文件。

新建配置文件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=E:\\environment\\zookeeper\\apache-zookeeper-3.5.5\\data
dataLogDir=E:\\environment\\zookeeper\\apache-zookeeper-3.5.5\\logs
# the port at which the clients will connect
clientPort=2181

 

四、啟動

打開命令提示符,進入bin目錄,輸入zkServer啟動。

E:\environment\zookeeper\apache-zookeeper-3.5.5\bin>zkServer

E:\environment\zookeeper\apache-zookeeper-3.5.5\bin>call "C:\Program Files\Java\jdk1.8.0_181"\bin\java "-Dzookeeper.log.dir=E:\environment\zookeeper\apache-zookeeper-3.5.5\bin\..\logs" "-Dzookeeper.root.logger=INFO,CONSOLE" "-Dzookeeper.log.file=zookeeper-Kuningasic-server-DESKTOP-KJCEOIF.log" "-XX:+HeapDumpOnOutOfMemoryError" "-XX:OnOutOfMemoryError=cmd /c taskkill /pid %%p /t /f" -cp "E:\environment\zookeeper\apache-zookeeper-3.5.5\bin\..\build\classes;E:\environment\zookeeper\apache-zookeeper-3.5.5\bin\..\build\lib\*;E:\environment\zookeeper\apache-zookeeper-3.5.5\bin\..\*;E:\environment\zookeeper\apache-zookeeper-3.5.5\bin\..\lib\*;E:\environment\zookeeper\apache-zookeeper-3.5.5\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "E:\environment\zookeeper\apache-zookeeper-3.5.5\bin\..\conf\zoo.cfg"
2019-06-12 20:56:27,191 [myid:] - INFO  [main:QuorumPeerConfig@133] - Reading configuration from: E:\environment\zookeeper\apache-zookeeper-3.5.5\bin\..\conf\zoo.cfg
2019-06-12 20:56:27,201 [myid:] - INFO  [main:QuorumPeerConfig@385] - clientPortAddress is 0.0.0.0/0.0.0.0:2181
2019-06-12 20:56:27,201 [myid:] - INFO  [main:QuorumPeerConfig@389] - secureClientPort is not set
2019-06-12 20:56:27,204 [myid:] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2019-06-12 20:56:27,206 [myid:] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2019-06-12 20:56:27,206 [myid:] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2019-06-12 20:56:27,206 [myid:] - WARN  [main:QuorumPeerMain@125] - Either no config or no quorum defined in config, running  in standalone mode
2019-06-12 20:56:27,208 [myid:] - INFO  [main:ManagedUtil@46] - Log4j found with jmx enabled.
2019-06-12 20:56:27,286 [myid:] - INFO  [main:QuorumPeerConfig@133] - Reading configuration from: E:\environment\zookeeper\apache-zookeeper-3.5.5\bin\..\conf\zoo.cfg
2019-06-12 20:56:27,286 [myid:] - INFO  [main:QuorumPeerConfig@385] - clientPortAddress is 0.0.0.0/0.0.0.0:2181
2019-06-12 20:56:27,287 [myid:] - INFO  [main:QuorumPeerConfig@389] - secureClientPort is not set
2019-06-12 20:56:27,287 [myid:] - INFO  [main:ZooKeeperServerMain@117] - Starting server


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM