windows安装zookeeper3.7.x

1. 简介

  ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件。它是一个为分布式应用提供一致性服务的软件,提供的功能包括:配置维护、域名服务、分布式同步、组服务等。
  ZooKeeper的目标就是封装好复杂易出错的关键服务,将简单易用的接口和性能高效、功能稳定的系统提供给用户。

2. 下载安装包

3. 修改配置

  • 在apache-zookeeper-3.7.0-bin根目录下创建两个文件夹:datalog
  • 打开apache-zookeeper-3.7.0-bin\conf目录,将zoo_sample.cfg复制一份,命名为zoo.cfg
  • 打开zoo.cfg,修改dataDir路径,新增日志dataLogDir路径
    • tickTime=2000
        客户端和服务器之间或者集群模式下服务器时间发送心跳的间隔时间,单位毫秒。
    • initLimit=10
        初始化时最大可以接受的心跳间隔数,即连续10个心跳间隔时间内(10 * 2000ms = 20s),服务器还未收到客户端信息,则认为客户端连接失败。
    • syncLimit=5
        发送请求和应答时间长度,5 * 2000ms =10s。
    • dataDir=../data
        保存数据目录。
    • dataLogDir=../log
        保存日志目录。
    • clientPort=2181
        连接端口号。
    • maxClientCnxns=12
        客户端最大连接数。
# 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=../data
dataLogDir=../log
# 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

4. 启动

  • 打开apache-zookeeper-3.7.0-bin\bin目录,双击zkServer.cmd
call "C:\Java\jdk1.8.0_102"\bin\java "-Dzookeeper.log.dir=C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\logs" "-Dzookeeper.root.logger=INFO,CONSOLE" "-Dzookeeper.log.file=zookeeper-CL-server-CL-PC.log" "-XX:+HeapDumpOnOutOfMemoryError" "-XX:OnOutOfMemoryError=cmd /c taskkill /pid %%p /t /f" -cp "C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\build\classes;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\build\lib\*;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\*;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\*;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\conf\zoo.cfg"
2021-07-28 19:45:41,590 [myid:] - INFO  [main:QuorumPeerConfig@174] - Reading configuration from: C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\conf\zoo.cfg
2021-07-28 19:45:41,600 [myid:] - WARN  [main:VerifyingFileFactory@65] - ..\data is relative. Prepend .\ to indicate that you're sure!
2021-07-28 19:45:41,601 [myid:] - WARN  [main:VerifyingFileFactory@65] - ..\log is relative. Prepend .\ to indicate that you're sure!
2021-07-28 19:45:41,610 [myid:] - INFO  [main:QuorumPeerConfig@444] - clientPortAddress is 0.0.0.0:2181
2021-07-28 19:45:41,610 [myid:] - INFO  [main:QuorumPeerConfig@448] - secureClientPort is not set
2021-07-28 19:45:41,610 [myid:] - INFO  [main:QuorumPeerConfig@464] - observerMasterPort is not set
2021-07-28 19:45:41,610 [myid:] - INFO  [main:QuorumPeerConfig@481] - metricsProvider.className is org.apache.zookeeper.metrics.impl.DefaultMetricsProvider
2021-07-28 19:45:41,612 [myid:] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2021-07-28 19:45:41,612 [myid:] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2021-07-28 19:45:41,613 [myid:] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2021-07-28 19:45:41,613 [myid:] - WARN  [main:QuorumPeerMain@139] - Either no config or no quorum defined in config, running in standalone mode
2021-07-28 19:45:41,616 [myid:] - INFO  [main:ManagedUtil@44] - Log4j 1.2 jmx support found and enabled.
2021-07-28 19:45:41,655 [myid:] - INFO  [main:QuorumPeerConfig@174] - Reading configuration from: C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\conf\zoo.cfg
2021-07-28 19:45:41,656 [myid:] - WARN  [main:VerifyingFileFactory@65] - ..\data is relative. Prepend .\ to indicate that you're sure!
2021-07-28 19:45:41,656 [myid:] - WARN  [main:VerifyingFileFactory@65] - ..\log is relative. Prepend .\ to indicate that you're sure!
2021-07-28 19:45:41,656 [myid:] - INFO  [main:QuorumPeerConfig@444] - clientPortAddress is 0.0.0.0:2181
2021-07-28 19:45:41,657 [myid:] - INFO  [main:QuorumPeerConfig@448] - secureClientPort is not set
2021-07-28 19:45:41,658 [myid:] - INFO  [main:QuorumPeerConfig@464] - observerMasterPort is not set
2021-07-28 19:45:41,658 [myid:] - INFO  [main:QuorumPeerConfig@481] - metricsProvider.className is org.apache.zookeeper.metrics.impl.DefaultMetricsProvider
2021-07-28 19:45:41,658 [myid:] - INFO  [main:ZooKeeperServerMain@123] - Starting server
2021-07-28 19:45:41,695 [myid:] - INFO  [main:ServerMetrics@62] - ServerMetrics initialized with provider org.apache.zookeeper.metrics.impl.DefaultMetricsProvider@21a06946
2021-07-28 19:45:41,706 [myid:] - INFO  [main:DigestAuthenticationProvider@47] - ACL digest algorithm is: SHA1
2021-07-28 19:45:41,706 [myid:] - INFO  [main:DigestAuthenticationProvider@61] - zookeeper.DigestAuthenticationProvider.enabled = true
2021-07-28 19:45:41,708 [myid:] - INFO  [main:FileTxnSnapLog@124] - zookeeper.snapshot.trust.empty : false
2021-07-28 19:45:41,718 [myid:] - INFO  [main:ZookeeperBanner@42] -
2021-07-28 19:45:41,718 [myid:] - INFO  [main:ZookeeperBanner@42] -   ______                  _
2021-07-28 19:45:41,718 [myid:] - INFO  [main:ZookeeperBanner@42] -  |___  /                 | |
2021-07-28 19:45:41,718 [myid:] - INFO  [main:ZookeeperBanner@42] -     / /    ___     ___   | | __   ___    ___   _ __     ___   _ __
2021-07-28 19:45:41,718 [myid:] - INFO  [main:ZookeeperBanner@42] -    / /    / _ \   / _ \  | |/ /  / _ \  / _ \ | '_ \   / _ \ | '__|
2021-07-28 19:45:41,719 [myid:] - INFO  [main:ZookeeperBanner@42] -   / /__  | (_) | | (_) | |   <  |  __/ |  __/ | |_) | |  __/ | |
2021-07-28 19:45:41,719 [myid:] - INFO  [main:ZookeeperBanner@42] -  /_____|  \___/   \___/  |_|\_\  \___|  \___| | .__/   \___| |_|
2021-07-28 19:45:41,719 [myid:] - INFO  [main:ZookeeperBanner@42] -                                               | |
2021-07-28 19:45:41,719 [myid:] - INFO  [main:ZookeeperBanner@42] -                                               |_|
2021-07-28 19:45:41,719 [myid:] - INFO  [main:ZookeeperBanner@42] -
2021-07-28 19:45:41,729 [myid:] - INFO  [main:Environment@98] - Server environment:zookeeper.version=3.7.0-e3704b390a6697bfdf4b0bef79e3da7a4f6bac4b, built on 2021-03-17 09:46 UTC
2021-07-28 19:45:41,729 [myid:] - INFO  [main:Environment@98] - Server environment:host.name=CL-PC
2021-07-28 19:45:41,729 [myid:] - INFO  [main:Environment@98] - Server environment:java.version=1.8.0_102
2021-07-28 19:45:41,730 [myid:] - INFO  [main:Environment@98] - Server environment:java.vendor=Oracle Corporation
2021-07-28 19:45:41,730 [myid:] - INFO  [main:Environment@98] - Server environment:java.home=C:\Java\jdk1.8.0_102\jre
2021-07-28 19:45:41,730 [myid:] - INFO  [main:Environment@98] - Server environment:java.class.path=C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\build\classes;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\build\lib\*;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\*;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\audience-annotations-0.12.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\commons-cli-1.4.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jackson-annotations-2.10.5.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jackson-core-2.10.5.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jackson-databind-2.10.5.1.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\javax.servlet-api-3.1.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-http-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-io-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-security-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-server-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-servlet-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-util-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-util-ajax-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jline-2.14.6.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\log4j-1.2.17.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\metrics-core-4.1.12.1.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-buffer-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-codec-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-common-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-handler-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-resolver-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-transport-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-transport-native-epoll-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-transport-native-unix-common-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\simpleclient-0.9.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\simpleclient_common-0.9.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\simpleclient_hotspot-0.9.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\simpleclient_servlet-0.9.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\slf4j-api-1.7.30.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\slf4j-log4j12-1.7.30.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\snappy-java-1.1.7.7.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\zookeeper-3.7.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\zookeeper-jute-3.7.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\zookeeper-prometheus-metrics-3.7.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\conf
2021-07-28 19:45:41,733 [myid:] - INFO  [main:Environment@98] - Server environment:java.library.path=C:\Java\jdk1.8.0_102\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\work\software\cmder\bin;D:\work\software\cmder\vendor\conemu-maximus5\ConEmu\Scripts;D:\work\software\cmder\vendor\conemu-maximus5;D:\work\software\cmder\vendor\conemu-maximus5\ConEmu;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Java\jdk1.8.0_102\bin;C:\Java\jdk1.8.0_102\jre\bin;D:\work\software\maven\apache-maven-3.6.3\bin;D:\work\software\cmder;D:\work\software\consul;D:\work\software\TortoiseSVN\bin;D:\work\software\nodejs;D:\work\software\cmder\vendor\git-for-windows\bin;D:\work\software\cmder\vendor\git-for-windows\mingw32\bin;D:\work\software\cmder\vendor\git-for-windows\mingw32\libexec\git-core;C:\Users\CL\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Bandizip\;;D:\work\software\cmder\vendor\git-for-windows\usr\bin;D:\work\software\cmder\vendor\git-for-windows\usr\share\vim\vim74;D:\work\software\cmder\;.
2021-07-28 19:45:41,734 [myid:] - INFO  [main:Environment@98] - Server environment:java.io.tmpdir=C:\Users\CL\AppData\Local\Temp\
2021-07-28 19:45:41,734 [myid:] - INFO  [main:Environment@98] - Server environment:java.compiler=<NA>
2021-07-28 19:45:41,734 [myid:] - INFO  [main:Environment@98] - Server environment:os.name=Windows 10
2021-07-28 19:45:41,734 [myid:] - INFO  [main:Environment@98] - Server environment:os.arch=amd64
2021-07-28 19:45:41,734 [myid:] - INFO  [main:Environment@98] - Server environment:os.version=10.0
2021-07-28 19:45:41,734 [myid:] - INFO  [main:Environment@98] - Server environment:user.name=CL
2021-07-28 19:45:41,735 [myid:] - INFO  [main:Environment@98] - Server environment:user.home=C:\Users\CL
2021-07-28 19:45:41,735 [myid:] - INFO  [main:Environment@98] - Server environment:user.dir=C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin
2021-07-28 19:45:41,735 [myid:] - INFO  [main:Environment@98] - Server environment:os.memory.free=225MB
2021-07-28 19:45:41,735 [myid:] - INFO  [main:Environment@98] - Server environment:os.memory.max=3612MB
2021-07-28 19:45:41,735 [myid:] - INFO  [main:Environment@98] - Server environment:os.memory.total=243MB
2021-07-28 19:45:41,736 [myid:] - INFO  [main:ZooKeeperServer@138] - zookeeper.enableEagerACLCheck = false
2021-07-28 19:45:41,736 [myid:] - INFO  [main:ZooKeeperServer@151] - zookeeper.digest.enabled = true
2021-07-28 19:45:41,737 [myid:] - INFO  [main:ZooKeeperServer@155] - zookeeper.closeSessionTxn.enabled = true
2021-07-28 19:45:41,737 [myid:] - INFO  [main:ZooKeeperServer@1499] - zookeeper.flushDelay=0
2021-07-28 19:45:41,737 [myid:] - INFO  [main:ZooKeeperServer@1508] - zookeeper.maxWriteQueuePollTime=0
2021-07-28 19:45:41,737 [myid:] - INFO  [main:ZooKeeperServer@1517] - zookeeper.maxBatchSize=1000
2021-07-28 19:45:41,738 [myid:] - INFO  [main:ZooKeeperServer@260] - zookeeper.intBufferStartingSizeBytes = 1024
2021-07-28 19:45:41,739 [myid:] - INFO  [main:BlueThrottle@141] - Weighed connection throttling is disabled
2021-07-28 19:45:41,740 [myid:] - INFO  [main:ZooKeeperServer@1300] - minSessionTimeout set to 4000
2021-07-28 19:45:41,740 [myid:] - INFO  [main:ZooKeeperServer@1309] - maxSessionTimeout set to 40000
2021-07-28 19:45:41,742 [myid:] - INFO  [main:ResponseCache@45] - getData response cache size is initialized with value 400.
2021-07-28 19:45:41,742 [myid:] - INFO  [main:ResponseCache@45] - getChildren response cache size is initialized with value 400.
2021-07-28 19:45:41,743 [myid:] - INFO  [main:RequestPathMetricsCollector@109] - zookeeper.pathStats.slotCapacity = 60
2021-07-28 19:45:41,743 [myid:] - INFO  [main:RequestPathMetricsCollector@110] - zookeeper.pathStats.slotDuration = 15
2021-07-28 19:45:41,743 [myid:] - INFO  [main:RequestPathMetricsCollector@111] - zookeeper.pathStats.maxDepth = 6
2021-07-28 19:45:41,743 [myid:] - INFO  [main:RequestPathMetricsCollector@112] - zookeeper.pathStats.initialDelay = 5
2021-07-28 19:45:41,744 [myid:] - INFO  [main:RequestPathMetricsCollector@113] - zookeeper.pathStats.delay = 5
2021-07-28 19:45:41,744 [myid:] - INFO  [main:RequestPathMetricsCollector@114] - zookeeper.pathStats.enabled = false
2021-07-28 19:45:41,746 [myid:] - INFO  [main:ZooKeeperServer@1536] - The max bytes for all large requests are set to 104857600
2021-07-28 19:45:41,747 [myid:] - INFO  [main:ZooKeeperServer@1550] - The large request threshold is set to -1
2021-07-28 19:45:41,748 [myid:] - INFO  [main:AuthenticationHelper@66] - zookeeper.enforce.auth.enabled = false
2021-07-28 19:45:41,748 [myid:] - INFO  [main:AuthenticationHelper@67] - zookeeper.enforce.auth.schemes = []
2021-07-28 19:45:41,749 [myid:] - INFO  [main:ZooKeeperServer@361] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 clientPortListenBacklog -1 datadir ..\log\version-2 snapdir ..\data\version-2
2021-07-28 19:45:41,770 [myid:] - INFO  [main:Log@169] - Logging initialized @350ms to org.eclipse.jetty.util.log.Slf4jLog
2021-07-28 19:45:41,828 [myid:] - WARN  [main:ContextHandler@1660] - o.e.j.s.ServletContextHandler@72b6cbcc{/,null,STOPPED} contextPath ends with /*
2021-07-28 19:45:41,829 [myid:] - WARN  [main:ContextHandler@1671] - Empty contextPath
2021-07-28 19:45:41,841 [myid:] - INFO  [main:Server@375] - jetty-9.4.38.v20210224; built: 2021-02-24T20:25:07.675Z; git: 288f3cc74549e8a913bf363250b0744f2695b8e6; jvm 1.8.0_102-b14
2021-07-28 19:45:41,866 [myid:] - INFO  [main:DefaultSessionIdManager@334] - DefaultSessionIdManager workerName=node0
2021-07-28 19:45:41,866 [myid:] - INFO  [main:DefaultSessionIdManager@339] - No SessionScavenger set, using defaults
2021-07-28 19:45:41,868 [myid:] - INFO  [main:HouseKeeper@132] - node0 Scavenging every 660000ms
2021-07-28 19:45:41,871 [myid:] - WARN  [main:ConstraintSecurityHandler@759] - ServletContext@o.e.j.s.ServletContextHandler@72b6cbcc{/,null,STARTING} has uncovered http methods for path: /*
2021-07-28 19:45:41,878 [myid:] - INFO  [main:ContextHandler@916] - Started o.e.j.s.ServletContextHandler@72b6cbcc{/,null,AVAILABLE}
2021-07-28 19:45:42,110 [myid:] - INFO  [main:AbstractConnector@331] - Started ServerConnector@490ab905{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2021-07-28 19:45:42,111 [myid:] - INFO  [main:Server@415] - Started @691ms
2021-07-28 19:45:42,111 [myid:] - INFO  [main:JettyAdminServer@181] - Started AdminServer on address 0.0.0.0, port 8080 and command URL /commands
2021-07-28 19:45:42,114 [myid:] - INFO  [main:ServerCnxnFactory@169] - Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
2021-07-28 19:45:42,115 [myid:] - WARN  [main:ServerCnxnFactory@309] - maxCnxns is not configured, using default value 0.
2021-07-28 19:45:42,117 [myid:] - INFO  [main:NIOServerCnxnFactory@652] - Configuring NIO connection handler with 10s sessionless connection timeout, 2 selector thread(s), 32 worker threads, and 64 kB direct buffers.
2021-07-28 19:45:42,119 [myid:] - INFO  [main:NIOServerCnxnFactory@660] - binding to port 0.0.0.0/0.0.0.0:2181
2021-07-28 19:45:42,130 [myid:] - INFO  [main:WatchManagerFactory@42] - Using org.apache.zookeeper.server.watch.WatchManager as watch manager
2021-07-28 19:45:42,130 [myid:] - INFO  [main:WatchManagerFactory@42] - Using org.apache.zookeeper.server.watch.WatchManager as watch manager
2021-07-28 19:45:42,130 [myid:] - INFO  [main:ZKDatabase@133] - zookeeper.snapshotSizeFactor = 0.33
2021-07-28 19:45:42,131 [myid:] - INFO  [main:ZKDatabase@153] - zookeeper.commitLogCount=500
2021-07-28 19:45:42,134 [myid:] - INFO  [main:SnapStream@61] - zookeeper.snapshot.compression.method = CHECKED
2021-07-28 19:45:42,136 [myid:] - INFO  [main:FileSnap@85] - Reading snapshot ..\data\version-2\snapshot.0
2021-07-28 19:45:42,138 [myid:] - INFO  [main:DataTree@1716] - The digest value is empty in snapshot
2021-07-28 19:45:42,152 [myid:] - INFO  [main:ZKAuditProvider@42] - ZooKeeper audit is disabled.
2021-07-28 19:45:42,152 [myid:] - INFO  [main:FileTxnSnapLog@372] - 18 txns loaded in 10 ms
2021-07-28 19:45:42,152 [myid:] - INFO  [main:ZKDatabase@290] - Snapshot loaded in 22 ms, highest zxid is 0x12, digest is 21030324126
2021-07-28 19:45:42,154 [myid:] - INFO  [main:FileTxnSnapLog@479] - Snapshotting: 0x12 to ..\data\version-2\snapshot.12
2021-07-28 19:45:42,155 [myid:] - INFO  [main:ZooKeeperServer@543] - Snapshot taken in 2 ms
2021-07-28 19:45:42,163 [myid:] - INFO  [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@137] - PrepRequestProcessor (sid:0) started, reconfigEnabled=false
2021-07-28 19:45:42,163 [myid:] - INFO  [main:RequestThrottler@75] - zookeeper.request_throttler.shutdownTimeout = 10000
2021-07-28 19:45:42,174 [myid:] - INFO  [main:ContainerManager@84] - Using checkIntervalMs=60000 maxPerMinute=10000 maxNeverUsedIntervalMs=0
  • 通过客户端连接,打开cmd,输入命令zkCli.cmd -server 127.0.0.1:2181
# zkCli.cmd -server 127.0.0.1:2181
Connecting to 127.0.0.1:2181
2021-07-28 19:47:20,011 [myid:] - INFO  [main:Environment@98] - Client environment:zookeeper.version=3.7.0-e3704b390a6697bfdf4b0bef79e3da7a4f6bac4b, built on 2021-03-17 09:46 UTC
2021-07-28 19:47:20,013 [myid:] - INFO  [main:Environment@98] - Client environment:host.name=CL-PC
2021-07-28 19:47:20,013 [myid:] - INFO  [main:Environment@98] - Client environment:java.version=1.8.0_102
2021-07-28 19:47:20,015 [myid:] - INFO  [main:Environment@98] - Client environment:java.vendor=Oracle Corporation
2021-07-28 19:47:20,015 [myid:] - INFO  [main:Environment@98] - Client environment:java.home=C:\Java\jdk1.8.0_102\jre
2021-07-28 19:47:20,015 [myid:] - INFO  [main:Environment@98] - Client environment:java.class.path=C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\build\classes;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\build\lib\*;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\*;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\audience-annotations-0.12.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\commons-cli-1.4.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jackson-annotations-2.10.5.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jackson-core-2.10.5.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jackson-databind-2.10.5.1.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\javax.servlet-api-3.1.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-http-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-io-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-security-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-server-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-servlet-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-util-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jetty-util-ajax-9.4.38.v20210224.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\jline-2.14.6.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\log4j-1.2.17.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\metrics-core-4.1.12.1.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-buffer-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-codec-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-common-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-handler-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-resolver-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-transport-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-transport-native-epoll-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\netty-transport-native-unix-common-4.1.59.Final.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\simpleclient-0.9.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\simpleclient_common-0.9.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\simpleclient_hotspot-0.9.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\simpleclient_servlet-0.9.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\slf4j-api-1.7.30.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\slf4j-log4j12-1.7.30.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\snappy-java-1.1.7.7.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\zookeeper-3.7.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\zookeeper-jute-3.7.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\lib\zookeeper-prometheus-metrics-3.7.0.jar;C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin\..\conf
2021-07-28 19:47:20,016 [myid:] - INFO  [main:Environment@98] - Client environment:java.library.path=C:\Java\jdk1.8.0_102\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\work\software\cmder\bin;D:\work\software\cmder\vendor\conemu-maximus5\ConEmu\Scripts;D:\work\software\cmder\vendor\conemu-maximus5;D:\work\software\cmder\vendor\conemu-maximus5\ConEmu;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Java\jdk1.8.0_102\bin;C:\Java\jdk1.8.0_102\jre\bin;D:\work\software\maven\apache-maven-3.6.3\bin;D:\work\software\cmder;D:\work\software\consul;D:\work\software\TortoiseSVN\bin;D:\work\software\nodejs;D:\work\software\cmder\vendor\git-for-windows\bin;D:\work\software\cmder\vendor\git-for-windows\mingw32\bin;D:\work\software\cmder\vendor\git-for-windows\mingw32\libexec\git-core;C:\Users\CL\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Bandizip\;;D:\work\software\cmder\vendor\git-for-windows\usr\bin;D:\work\software\cmder\vendor\git-for-windows\usr\share\vim\vim74;D:\work\software\cmder\;.
2021-07-28 19:47:20,016 [myid:] - INFO  [main:Environment@98] - Client environment:java.io.tmpdir=C:\Users\CL\AppData\Local\Temp\
2021-07-28 19:47:20,017 [myid:] - INFO  [main:Environment@98] - Client environment:java.compiler=<NA>
2021-07-28 19:47:20,017 [myid:] - INFO  [main:Environment@98] - Client environment:os.name=Windows 10
2021-07-28 19:47:20,017 [myid:] - INFO  [main:Environment@98] - Client environment:os.arch=amd64
2021-07-28 19:47:20,017 [myid:] - INFO  [main:Environment@98] - Client environment:os.version=10.0
2021-07-28 19:47:20,018 [myid:] - INFO  [main:Environment@98] - Client environment:user.name=CL
2021-07-28 19:47:20,018 [myid:] - INFO  [main:Environment@98] - Client environment:user.home=C:\Users\CL
2021-07-28 19:47:20,018 [myid:] - INFO  [main:Environment@98] - Client environment:user.dir=C:\Users\CL\Desktop\apache-zookeeper-3.7.0-bin\bin
2021-07-28 19:47:20,018 [myid:] - INFO  [main:Environment@98] - Client environment:os.memory.free=229MB
2021-07-28 19:47:20,020 [myid:] - INFO  [main:Environment@98] - Client environment:os.memory.max=3612MB
2021-07-28 19:47:20,020 [myid:] - INFO  [main:Environment@98] - Client environment:os.memory.total=243MB
2021-07-28 19:47:20,023 [myid:] - INFO  [main:ZooKeeper@637] - Initiating client connection, connectString=127.0.0.1:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@24273305
2021-07-28 19:47:20,026 [myid:] - INFO  [main:X509Util@77] - Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation
2021-07-28 19:47:20,254 [myid:] - INFO  [main:ClientCnxnSocket@239] - jute.maxbuffer value is 1048575 Bytes
2021-07-28 19:47:20,260 [myid:] - INFO  [main:ClientCnxn@1726] - zookeeper.request.timeout value is 0. feature enabled=false
Welcome to ZooKeeper!
2021-07-28 19:47:20,266 [myid:127.0.0.1:2181] - INFO  [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@1171] - Opening socket connection to server pig-gateway/127.0.0.1:2181.
2021-07-28 19:47:20,267 [myid:127.0.0.1:2181] - INFO  [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@1173] - SASL config status: Will not attempt to authenticate using SASL (unknown error)
2021-07-28 19:47:20,269 [myid:127.0.0.1:2181] - INFO  [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@1005] - Socket connection established, initiating session, client: /127.0.0.1:57867, server: pig-gateway/127.0.0.1:2181
JLine support is enabled
2021-07-28 19:47:20,288 [myid:127.0.0.1:2181] - INFO  [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@1438] - Session establishment complete on server pig-gateway/127.0.0.1:2181, session id = 0x1003287a5a60000, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
[zk: 127.0.0.1:2181(CONNECTED) 0]

  当看到Welcome to ZooKeeper!则表明连接成功!

posted @ 2021-07-28 20:58  C3Stones  阅读(634)  评论(0编辑  收藏  举报