3 zookeeper
3.1 下载
Apache ZooKeeper
3.2 安装
[root@kafka ~]
总用量 958312
-rw-r--r--. 1 root root 14853274 11月 23 02:20 apache-zookeeper-3.8.3-bin.tar.gz
-rw-r--r--. 1 root root 113400977 11月 22 22:05 kafka_2.12-3.6.0.tgz
-rw-r--r--. 1 root root 89962364 11月 22 23:37 kafka-eagle-bin-3.0.1.tar.gz
-rw-r--r--. 1 root root 660017902 11月 26 15:48 mysql-5.7.30-linux-glibc2.12-x86_64.tar.gz
-rw-r--r--. 1 root root 103063877 11月 22 17:19 OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.tar.gz
[root@kafka ~]
[root@kafka ~]
apache-zookeeper-3.8.3-bin/lib/netty-codec-4.1.94.Final.jar
apache-zookeeper-3.8.3-bin/lib/netty-transport-native-epoll-4.1.94.Final.jar
apache-zookeeper-3.8.3-bin/lib/netty-transport-classes-epoll-4.1.94.Final.jar
apache-zookeeper-3.8.3-bin/lib/slf4j-api-1.7.30.jar
apache-zookeeper-3.8.3-bin/lib/logback-core-1.2.10.jar
apache-zookeeper-3.8.3-bin/lib/logback-classic-1.2.10.jar
apache-zookeeper-3.8.3-bin/lib/commons-io-2.11.0.jar
apache-zookeeper-3.8.3-bin/lib/zookeeper-prometheus-metrics-3.8.3.jar
apache-zookeeper-3.8.3-bin/lib/simpleclient-0.9.0.jar
apache-zookeeper-3.8.3-bin/lib/simpleclient_hotspot-0.9.0.jar
apache-zookeeper-3.8.3-bin/lib/simpleclient_servlet-0.9.0.jar
apache-zookeeper-3.8.3-bin/lib/simpleclient_common-0.9.0.jar
apache-zookeeper-3.8.3-bin/lib/commons-cli-1.5.0.jar
apache-zookeeper-3.8.3-bin/lib/jetty-server-9.4.52.v20230823.jar
apache-zookeeper-3.8.3-bin/lib/javax.servlet-api-3.1.0.jar
apache-zookeeper-3.8.3-bin/lib/jetty-http-9.4.52.v20230823.jar
apache-zookeeper-3.8.3-bin/lib/jetty-util-9.4.52.v20230823.jar
apache-zookeeper-3.8.3-bin/lib/jetty-io-9.4.52.v20230823.jar
apache-zookeeper-3.8.3-bin/lib/jetty-servlet-9.4.52.v20230823.jar
apache-zookeeper-3.8.3-bin/lib/jetty-security-9.4.52.v20230823.jar
apache-zookeeper-3.8.3-bin/lib/jetty-util-ajax-9.4.52.v20230823.jar
apache-zookeeper-3.8.3-bin/lib/jackson-databind-2.15.2.jar
apache-zookeeper-3.8.3-bin/lib/jackson-annotations-2.15.2.jar
apache-zookeeper-3.8.3-bin/lib/jackson-core-2.15.2.jar
apache-zookeeper-3.8.3-bin/lib/jline-2.14.6.jar
apache-zookeeper-3.8.3-bin/lib/metrics-core-4.1.12.1.jar
apache-zookeeper-3.8.3-bin/lib/snappy-java-1.1.10.5.jar
[root@kafka ~]
[root@kafka ~]
3.3 启动zookeeper服务
[root@kafka ~]
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper/apache-zookeeper-3.8.3-bin/conf/zoo.cfg
Starting zookeeper ... STARTED
[root@kafka ~]
3.4 客户端连接zookeeper
[root@kafka ~]# /opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/zkCli.sh -server 192.168.17.10:2181
Connecting to 192.168.17.10:2181
2023-11-26 18:06:34,692 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:zookeeper.version=3.8.3-6ad6d364c7c0bcf0de452d54ebefa3058098ab56, built on 2023-10-05 10:34 UTC
2023-11-26 18:06:34,702 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:host.name=kafka
2023-11-26 18:06:34,704 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:java.version=1.8.0_322
2023-11-26 18:06:34,705 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:java.vendor=Temurin
2023-11-26 18:06:34,705 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:java.home=/usr/lib/jvm/jdk8u322-b06/jre
2023-11-26 18:06:34,707 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:java.class.path=/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../zookeeper-server/target/classes:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../build/classes:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../zookeeper-server/target/lib/*.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../build/lib/*.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/zookeeper-prometheus-metrics-3.8.3.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/zookeeper-jute-3.8.3.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/zookeeper-3.8.3.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/snappy-java-1.1.10.5.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/slf4j-api-1.7.30.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/simpleclient_servlet-0.9.0.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/simpleclient_hotspot-0.9.0.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/simpleclient_common-0.9.0.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/simpleclient-0.9.0.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/netty-transport-native-unix-common-4.1.94.Final.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/netty-transport-native-epoll-4.1.94.Final.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/netty-transport-classes-epoll-4.1.94.Final.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/netty-transport-4.1.94.Final.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/netty-resolver-4.1.94.Final.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/netty-handler-4.1.94.Final.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/netty-common-4.1.94.Final.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/netty-codec-4.1.94.Final.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/netty-buffer-4.1.94.Final.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/metrics-core-4.1.12.1.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/logback-core-1.2.10.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/logback-classic-1.2.10.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jline-2.14.6.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jetty-util-ajax-9.4.52.v20230823.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jetty-util-9.4.52.v20230823.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jetty-servlet-9.4.52.v20230823.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jetty-server-9.4.52.v20230823.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jetty-security-9.4.52.v20230823.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jetty-io-9.4.52.v20230823.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jetty-http-9.4.52.v20230823.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/javax.servlet-api-3.1.0.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jackson-databind-2.15.2.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jackson-core-2.15.2.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/jackson-annotations-2.15.2.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/commons-io-2.11.0.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/commons-cli-1.5.0.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../lib/audience-annotations-0.12.0.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../zookeeper-*.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../zookeeper-server/src/main/resources/lib/*.jar:/opt/zookeeper/apache-zookeeper-3.8.3-bin/bin/../conf:.://usr/lib/jvm/jdk/lib:/usr/lib/jvm/jdk/jre/lib
2023-11-26 18:06:34,709 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2023-11-26 18:06:34,715 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:java.io.tmpdir=/tmp
2023-11-26 18:06:34,716 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:java.compiler=<NA>
2023-11-26 18:06:34,717 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:os.name=Linux
2023-11-26 18:06:34,717 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:os.arch=amd64
2023-11-26 18:06:34,718 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:os.version=3.10.0-1160.el7.x86_64
2023-11-26 18:06:34,719 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:user.name=root
2023-11-26 18:06:34,719 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:user.home=/root
2023-11-26 18:06:34,720 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:user.dir=/root
2023-11-26 18:06:34,720 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:os.memory.free=10MB
2023-11-26 18:06:34,720 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:os.memory.max=247MB
2023-11-26 18:06:34,721 [myid:] - INFO [main:o.a.z.Environment@98] - Client environment:os.memory.total=15MB
2023-11-26 18:06:34,732 [myid:] - INFO [main:o.a.z.ZooKeeper@637] - Initiating client connection, connectString=192.168.17.10:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@482f8f11
2023-11-26 18:06:34,749 [myid:] - INFO [main:o.a.z.c.X509Util@78] - Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation
2023-11-26 18:06:34,762 [myid:] - INFO [main:o.a.z.ClientCnxnSocket@239] - jute.maxbuffer value is 1048575 Bytes
2023-11-26 18:06:34,787 [myid:] - INFO [main:o.a.z.ClientCnxn@1741] - zookeeper.request.timeout value is 0. feature enabled=false
Welcome to ZooKeeper!
JLine support is enabled
2023-11-26 18:06:34,902 [myid:192.168.17.10:2181] - INFO [main-SendThread(192.168.17.10:2181):o.a.z.ClientCnxn$SendThread@1177] - Opening socket connection to server kafka/192.168.17.10:2181.
2023-11-26 18:06:34,903 [myid:192.168.17.10:2181] - INFO [main-SendThread(192.168.17.10:2181):o.a.z.ClientCnxn$SendThread@1179] - SASL config status: Will not attempt to authenticate using SASL (unknown error)
2023-11-26 18:06:34,908 [myid:192.168.17.10:2181] - INFO [main-SendThread(192.168.17.10:2181):o.a.z.ClientCnxn$SendThread@1011] - Socket connection established, initiating session, client: /192.168.17.10:60442, server: kafka/192.168.17.10:2181
[zk: 192.168.17.10:2181(CONNECTING) 0] 2023-11-26 18:06:34,968 [myid:192.168.17.10:2181] - INFO [main-SendThread(192.168.17.10:2181):o.a.z.ClientCnxn$SendThread@1452] - Session establishment complete on server kafka/192.168.17.10:2181, session id = 0x10001a2c9b20000, negotiated timeout = 30000
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
[zk: 192.168.17.10:2181(CONNECTED) 0] ls /
[zookeeper]
[zk: 192.168.17.10:2181(CONNECTED) 1] ls /zookeeper
[config, quota]
[zk: 192.168.17.10:2181(CONNECTED) 2] quit
WATCHER::
WatchedEvent state:Closed type:None path:null
2023-11-26 18:07:16,344 [myid:] - INFO [main:o.a.z.ZooKeeper@1232] - Session: 0x10001a2c9b20000 closed
2023-11-26 18:07:16,347 [myid:] - INFO [main-EventThread:o.a.z.ClientCnxn$EventThread@568] - EventThread shut down for session: 0x10001a2c9b20000
2023-11-26 18:07:16,350 [myid:] - INFO [main:o.a.z.u.ServiceUtils@45] - Exiting JVM with code 0
[root@kafka ~]#