apache-zookeeper-3.7.1 安裝部署
下載地址:https://mirrors.bfsu.edu.cn/apache/zookeeper/
apache-zookeeper-3.7.1
1.下載直接解壓,進入../conf/目錄下復制一份zoo_sample.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 ## Metrics Providers # # https://prometheus.io Metrics Exporter #metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider #metricsProvider.httpPort=7000 #metricsProvider.exportJvmInfo=true dataDir=D:\\soft_position\\Java\\zzz_test\\apache-zookeeper-3.7.1\\data dataLogDir=D:\\soft_position\\Java\\zzz_test\\apache-zookeeper-3.7.1\\log admin.serverPort=8887
配置參考二:
# dataDir里放的是內存數據結構的snapshot dataDir=../data # 客戶端連接zookeeper服務的端口 clientPort=2183 # 服務啟動默認8080,避免和其他服務沖突配置8888 admin.serverPort=8888 # 配置zookeeper 的默認賬號密碼, 用于登入dubbo admin.root.user.name=root admin.root.user.password=root
2.啟動zookeeper,進入../bin/目錄,Windows環境啟動文件為zkServer.cmd,Linux環境啟動文件為zkServer.sh
zookeeper 啟動
#在這個目錄下面
D:\soft_position\Java\zzz_test\apache-zookeeper-3.7.1\bin
#雙擊 zkServer.cmd **** 啟動**********
其他參考地址: 安裝注冊中心 zookeeper