# The number of milliseconds of each tick tickTime=2000 # 服务之间的心跳间隔时间2s # The number of ticks that the initial # synchronization phase can take initLimit=10 # 在follower和Leader建立连接的时候,leader允许等待2s*10=20s的初始延迟 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 # leader下发同步协作的时候,需要在2*5=10s做出回馈 # the directory where the snapshot is stored. #do not use /tmp for storage, /tmp here is just # example sakes. dataDir=/tmp/zookeeper # 持久化目录,最好不要用tem 比如改成/var/zookeeper # the port at which the clients will connect clientPort=2181 # 客户端连接zk服务的端口号 # 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
[root@node01 /]# scp -r /usr/local/zookeeper/ root@172.16.197.2:`pwd` The authenticity of host '172.16.197.2 (172.16.197.2)' can't be established. ECDSA key fingerprint is SHA256:BfVLr3MJ33/z7l4LzGpWQaRGc9HTy583df1aRRhNAYg. ECDSA key fingerprint is MD5:77:03:35:3e:21:a7:04:e3:b5:a0:14:5f:ce:a4:eb:30. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '172.16.197.2' (ECDSA) to the list of known hosts. root@172.16.197.2's password:
[root@node01 ~]# zkServer.sh start-foreground ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper/apache-zookeeper-3.7.0-bin/bin/../conf/zoo.cfg 2021-04-30 09:58:37,822 [myid:] - INFO [main:QuorumPeerConfig@174] - Reading configuration from: /usr/local/zookeeper/apache-zookeeper-3.7.0-bin/bin/../conf/zoo.cfg 2021-04-30 09:58:37,917 [myid:] - INFO [main:QuorumPeerConfig@444] - clientPortAddress is 0.0.0.0:2181 2021-04-30 09:58:37,917 [myid:] - INFO [main:QuorumPeerConfig@448] - secureClientPort is not set 2021-04-30 09:58:37,917 [myid:] - INFO [main:QuorumPeerConfig@464] - observerMasterPort is not set 2021-04-30 09:58:37,918 [myid:] - INFO [main:QuorumPeerConfig@481] - metricsProvider.className is org.apache.zookeeper.metrics.impl.DefaultMetricsProvider 2021-04-30 09:58:37,961 [myid:] - ERROR [main:QuorumPeerMain@99] - Invalid config, exiting abnormally org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Address unresolved: node01:3888 at org.apache.zookeeper.server.quorum.QuorumPeer$QuorumServer.initializeWithAddressString(QuorumPeer.java:357) at org.apache.zookeeper.server.quorum.QuorumPeer$QuorumServer.<init>(QuorumPeer.java:278) at org.apache.zookeeper.server.quorum.QuorumPeer$QuorumServer.<init>(QuorumPeer.java:273) at org.apache.zookeeper.server.quorum.flexible.QuorumMaj.<init>(QuorumMaj.java:92) at org.apache.zookeeper.server.quorum.QuorumPeerConfig.createQuorumVerifier(QuorumPeerConfig.java:658) at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseDynamicConfig(QuorumPeerConfig.java:689) at org.apache.zookeeper.server.quorum.QuorumPeerConfig.setupQuorumPeerConfig(QuorumPeerConfig.java:663) at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:491) at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:194) at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:125) at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:91) Invalid config, exiting abnormally 2021-04-30 09:58:37,983 [myid:] - INFO [main:ZKAuditProvider@42] - ZooKeeper audit is disabled. 2021-04-30 09:58:37,987 [myid:] - ERROR [main:ServiceUtils@42] - Exiting JVM with code 2 [root@node01 ~]#