linux環境安裝——kafka安裝複習

小白龙白龙马發表於2024-04-09

需要安裝jdk、zk;然後才是kafka

kafka版本:kafka_2.13-3.2.3.tgz

[root@iZf8zi6zcbssmm6c2nrhapZ /]# ls -alt
total 84
drwxrwxrwt.   9 root root  4096 Apr  9 14:42 tmp
drwxr-xr-x    7 root root  4096 Apr  9 14:38 soft
drwxr-xr-x    7 root root  4096 Apr  9 14:38 evir
drwxr-xr-x.  79 root root  4096 Apr  9 13:31 etc
dr-xr-x---.   6 root root  4096 Apr  9 13:31 root
-rw-r--r--    1 root root  5068 Apr  9 13:27 zookeeper.out
dr-xr-xr-x.  20 root root  4096 Apr  9 13:27 .
dr-xr-xr-x.  20 root root  4096 Apr  9 13:27 ..
dr-xr-xr-x   13 root root     0 Apr  9 13:26 sys
drwxr-xr-x   26 root root   780 Apr  9 11:12 run
drwxr-xr-x   19 root root  2980 Apr  9 08:07 dev
drwxr-xr-x.   3 root root  4096 Apr  8 19:25 home
dr-xr-xr-x  101 root root     0 Apr  8 19:17 proc
dr-xr-xr-x.   5 root root  4096 Feb 20 16:54 boot
drwxr-xr-x.  13 root root  4096 Feb 20 16:36 usr
lrwxrwxrwx.   1 root root     8 Feb 20 16:36 sbin -> usr/sbin
lrwxrwxrwx.   1 root root     9 Feb 20 16:36 lib64 -> usr/lib64
lrwxrwxrwx.   1 root root     7 Feb 20 16:36 lib -> usr/lib
lrwxrwxrwx.   1 root root     7 Feb 20 16:36 bin -> usr/bin
drwx------.   2 root root 16384 Feb 20 16:36 lost+found
drwxr-xr-x.  19 root root  4096 Feb 20 08:41 var
-rw-r--r--    1 root root     0 Feb 20 08:41 .autorelabel
drwxr-xr-x.   2 root root  4096 Apr 11  2018 media
drwxr-xr-x.   2 root root  4096 Apr 11  2018 mnt
drwxr-xr-x.   2 root root  4096 Apr 11  2018 opt
drwxr-xr-x.   2 root root  4096 Apr 11  2018 srv
[root@iZf8zi6zcbssmm6c2nrhapZ /]# cd /evir/kafka213/
[root@iZf8zi6zcbssmm6c2nrhapZ kafka213]# ls -alt
total 12
drwxr-xr-x 3 root root 4096 Apr  9 14:42 .
drwxr-xr-x 7 root root 4096 Apr  9 14:38 ..
drwxr-xr-x 7 root root 4096 Sep 13  2022 kafka_2.13-3.2.3
[root@iZf8zi6zcbssmm6c2nrhapZ kafka213]# cd kafka_2.13-3.2.3/
[root@iZf8zi6zcbssmm6c2nrhapZ kafka_2.13-3.2.3]# ls -alt
total 72
drwxr-xr-x 2 root root  4096 Apr  9 14:42 libs
drwxr-xr-x 3 root root  4096 Apr  9 14:42 ..
drwxr-xr-x 2 root root  4096 Sep 13  2022 site-docs
drwxr-xr-x 7 root root  4096 Sep 13  2022 .
drwxr-xr-x 3 root root  4096 Sep 13  2022 bin
drwxr-xr-x 3 root root  4096 Sep 13  2022 config
drwxr-xr-x 2 root root  4096 Sep 13  2022 licenses
-rw-r--r-- 1 root root 14640 Sep 13  2022 LICENSE
-rw-r--r-- 1 root root 28184 Sep 13  2022 NOTICE
[root@iZf8zi6zcbssmm6c2nrhapZ kafka_2.13-3.2.3]# cd config
[root@iZf8zi6zcbssmm6c2nrhapZ config]# ls -alt
total 84
drwxr-xr-x 3 root root 4096 Sep 13  2022 .
drwxr-xr-x 7 root root 4096 Sep 13  2022 ..
-rw-r--r-- 1 root root  906 Sep 13  2022 connect-console-sink.properties
-rw-r--r-- 1 root root  909 Sep 13  2022 connect-console-source.properties
-rw-r--r-- 1 root root 5475 Sep 13  2022 connect-distributed.properties
-rw-r--r-- 1 root root  883 Sep 13  2022 connect-file-sink.properties
-rw-r--r-- 1 root root  881 Sep 13  2022 connect-file-source.properties
-rw-r--r-- 1 root root 2103 Sep 13  2022 connect-log4j.properties
-rw-r--r-- 1 root root 2540 Sep 13  2022 connect-mirror-maker.properties
-rw-r--r-- 1 root root 2262 Sep 13  2022 connect-standalone.properties
-rw-r--r-- 1 root root 1221 Sep 13  2022 consumer.properties
drwxr-xr-x 2 root root 4096 Sep 13  2022 kraft
-rw-r--r-- 1 root root 4674 Sep 13  2022 log4j.properties
-rw-r--r-- 1 root root 2065 Sep 13  2022 producer.properties
-rw-r--r-- 1 root root 6895 Sep 13  2022 server.properties
-rw-r--r-- 1 root root 1032 Sep 13  2022 tools-log4j.properties
-rw-r--r-- 1 root root 1169 Sep 13  2022 trogdor.conf
-rw-r--r-- 1 root root 1205 Sep 13  2022 zookeeper.properties
[root@iZf8zi6zcbssmm6c2nrhapZ config]# cdcd ccd
-bash: cdcd: command not found
[root@iZf8zi6zcbssmm6c2nrhapZ config]# ^C
[root@iZf8zi6zcbssmm6c2nrhapZ config]# ^C
[root@iZf8zi6zcbssmm6c2nrhapZ config]# ^C
[root@iZf8zi6zcbssmm6c2nrhapZ config]# ^C
[root@iZf8zi6zcbssmm6c2nrhapZ config]# cd /evir/zk3414/zookeeper-3.4.14/
[root@iZf8zi6zcbssmm6c2nrhapZ zookeeper-3.4.14]# ls -alt
total 1720
drwxr-xr-x  3 root root    4096 Apr  9 13:27 data
drwxr-xr-x 15 2002 2002    4096 Apr  9 13:22 .
drwxr-xr-x  2 2002 2002    4096 Apr  9 13:18 conf
drwxr-xr-x  3 root root    4096 Apr  9 13:15 ..
drwxr-xr-x  2 2002 2002    4096 Mar  7  2019 dist-maven
-rw-rw-r--  1 2002 2002     836 Mar  7  2019 zookeeper-3.4.14.jar.asc
drwxr-xr-x  2 2002 2002    4096 Mar  7  2019 bin
drwxr-xr-x  7 2002 2002    4096 Mar  7  2019 zookeeper-docs
drwxr-xr-x  3 2002 2002    4096 Mar  7  2019 zookeeper-it
drwxr-xr-x  4 2002 2002    4096 Mar  7  2019 zookeeper-jute
drwxr-xr-x  5 2002 2002    4096 Mar  7  2019 zookeeper-recipes
drwxr-xr-x  3 2002 2002    4096 Mar  7  2019 zookeeper-server
drwxr-xr-x  4 2002 2002    4096 Mar  7  2019 lib
drwxr-xr-x  3 2002 2002    4096 Mar  7  2019 zookeeper-client
drwxr-xr-x 12 2002 2002    4096 Mar  7  2019 zookeeper-contrib
drwxr-xr-x  3 2002 2002    4096 Mar  7  2019 src
-rw-rw-r--  1 2002 2002   97426 Mar  7  2019 build.xml
-rw-rw-r--  1 2002 2002    1709 Mar  7  2019 ivysettings.xml
-rw-rw-r--  1 2002 2002   10742 Mar  7  2019 ivy.xml
-rw-rw-r--  1 2002 2002   11970 Mar  7  2019 LICENSE.txt
-rw-rw-r--  1 2002 2002    3132 Mar  7  2019 NOTICE.txt
-rw-rw-r--  1 2002 2002   31622 Mar  7  2019 pom.xml
-rw-rw-r--  1 2002 2002    1765 Mar  7  2019 README.md
-rw-rw-r--  1 2002 2002    1770 Mar  7  2019 README_packaging.txt
-rw-rw-r--  1 2002 2002 1515359 Mar  7  2019 zookeeper-3.4.14.jar
-rw-rw-r--  1 2002 2002      33 Mar  7  2019 zookeeper-3.4.14.jar.md5
-rw-rw-r--  1 2002 2002      41 Mar  7  2019 zookeeper-3.4.14.jar.sha1
[root@iZf8zi6zcbssmm6c2nrhapZ zookeeper-3.4.14]# cd bin
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ls -alt
total 52
drwxr-xr-x 15 2002 2002 4096 Apr  9 13:22 ..
drwxr-xr-x  2 2002 2002 4096 Mar  7  2019 .
-rwxr-xr-x  1 2002 2002  232 Mar  7  2019 README.txt
-rwxr-xr-x  1 2002 2002 1937 Mar  7  2019 zkCleanup.sh
-rwxr-xr-x  1 2002 2002 1056 Mar  7  2019 zkCli.cmd
-rwxr-xr-x  1 2002 2002 1534 Mar  7  2019 zkCli.sh
-rwxr-xr-x  1 2002 2002 1759 Mar  7  2019 zkEnv.cmd
-rwxr-xr-x  1 2002 2002 2919 Mar  7  2019 zkEnv.sh
-rwxr-xr-x  1 2002 2002 1089 Mar  7  2019 zkServer.cmd
-rwxr-xr-x  1 2002 2002 6773 Mar  7  2019 zkServer.sh
-rwxr-xr-x  1 2002 2002  996 Mar  7  2019 zkTxnLogToolkit.cmd
-rwxr-xr-x  1 2002 2002 1385 Mar  7  2019 zkTxnLogToolkit.sh
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /evir/zk3414/zookeeper-3.4.14/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ./zkServer.sh stop
ZooKeeper JMX enabled by default
Using config: /evir/zk3414/zookeeper-3.4.14/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ./zkServer.sh start ../conf/zoo.cfg
ZooKeeper JMX enabled by default
Using config: ../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /evir/zk3414/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: standalone
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# pwd
/evir/zk3414/zookeeper-3.4.14/bin
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# cd /evir/kafka213/kafka_2.13-3.2.3/
[root@iZf8zi6zcbssmm6c2nrhapZ kafka_2.13-3.2.3]# ls -alt
total 72
drwxr-xr-x 2 root root  4096 Apr  9 14:42 libs
drwxr-xr-x 3 root root  4096 Apr  9 14:42 ..
drwxr-xr-x 2 root root  4096 Sep 13  2022 site-docs
drwxr-xr-x 7 root root  4096 Sep 13  2022 .
drwxr-xr-x 3 root root  4096 Sep 13  2022 bin
drwxr-xr-x 3 root root  4096 Sep 13  2022 config
drwxr-xr-x 2 root root  4096 Sep 13  2022 licenses
-rw-r--r-- 1 root root 14640 Sep 13  2022 LICENSE
-rw-r--r-- 1 root root 28184 Sep 13  2022 NOTICE
[root@iZf8zi6zcbssmm6c2nrhapZ kafka_2.13-3.2.3]# cd bin
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ls -alt
total 168
drwxr-xr-x 3 root root  4096 Sep 13  2022 .
drwxr-xr-x 7 root root  4096 Sep 13  2022 ..
-rwxr-xr-x 1 root root  1423 Sep 13  2022 connect-distributed.sh
-rwxr-xr-x 1 root root  1396 Sep 13  2022 connect-mirror-maker.sh
-rwxr-xr-x 1 root root  1420 Sep 13  2022 connect-standalone.sh
-rwxr-xr-x 1 root root   861 Sep 13  2022 kafka-acls.sh
-rwxr-xr-x 1 root root   873 Sep 13  2022 kafka-broker-api-versions.sh
-rwxr-xr-x 1 root root   860 Sep 13  2022 kafka-cluster.sh
-rwxr-xr-x 1 root root   864 Sep 13  2022 kafka-configs.sh
-rwxr-xr-x 1 root root   945 Sep 13  2022 kafka-console-consumer.sh
-rwxr-xr-x 1 root root   944 Sep 13  2022 kafka-console-producer.sh
-rwxr-xr-x 1 root root   871 Sep 13  2022 kafka-consumer-groups.sh
-rwxr-xr-x 1 root root   948 Sep 13  2022 kafka-consumer-perf-test.sh
-rwxr-xr-x 1 root root   871 Sep 13  2022 kafka-delegation-tokens.sh
-rwxr-xr-x 1 root root   869 Sep 13  2022 kafka-delete-records.sh
-rwxr-xr-x 1 root root   866 Sep 13  2022 kafka-dump-log.sh
-rwxr-xr-x 1 root root   863 Sep 13  2022 kafka-features.sh
-rwxr-xr-x 1 root root   865 Sep 13  2022 kafka-get-offsets.sh
-rwxr-xr-x 1 root root   870 Sep 13  2022 kafka-leader-election.sh
-rwxr-xr-x 1 root root   863 Sep 13  2022 kafka-log-dirs.sh
-rwxr-xr-x 1 root root   873 Sep 13  2022 kafka-metadata-shell.sh
-rwxr-xr-x 1 root root   862 Sep 13  2022 kafka-mirror-maker.sh
-rwxr-xr-x 1 root root   959 Sep 13  2022 kafka-producer-perf-test.sh
-rwxr-xr-x 1 root root   874 Sep 13  2022 kafka-reassign-partitions.sh
-rwxr-xr-x 1 root root   874 Sep 13  2022 kafka-replica-verification.sh
-rwxr-xr-x 1 root root 10600 Sep 13  2022 kafka-run-class.sh
-rwxr-xr-x 1 root root  1376 Sep 13  2022 kafka-server-start.sh
-rwxr-xr-x 1 root root  1361 Sep 13  2022 kafka-server-stop.sh
-rwxr-xr-x 1 root root   860 Sep 13  2022 kafka-storage.sh
-rwxr-xr-x 1 root root   945 Sep 13  2022 kafka-streams-application-reset.sh
-rwxr-xr-x 1 root root   863 Sep 13  2022 kafka-topics.sh
-rwxr-xr-x 1 root root   879 Sep 13  2022 kafka-transactions.sh
-rwxr-xr-x 1 root root   958 Sep 13  2022 kafka-verifiable-consumer.sh
-rwxr-xr-x 1 root root   958 Sep 13  2022 kafka-verifiable-producer.sh
-rwxr-xr-x 1 root root  1714 Sep 13  2022 trogdor.sh
drwxr-xr-x 2 root root  4096 Sep 13  2022 windows
-rwxr-xr-x 1 root root   867 Sep 13  2022 zookeeper-security-migration.sh
-rwxr-xr-x 1 root root  1393 Sep 13  2022 zookeeper-server-start.sh
-rwxr-xr-x 1 root root  1366 Sep 13  2022 zookeeper-server-stop.sh
-rwxr-xr-x 1 root root  1019 Sep 13  2022 zookeeper-shell.sh
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ./kafka-server-start.sh -daemon ../config/server.properties
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ps -aux |grep server.proterties
root      4130  0.0  0.0 112812   996 pts/1    S+   14:55   0:00 grep --color=auto server.proterties
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# cd /evir/zk3414/zookeeper-3.4.14/bin
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ls -alt
total 60
-rw-r--r--  1 root root 7182 Apr  9 14:55 zookeeper.out
drwxr-xr-x  2 2002 2002 4096 Apr  9 14:52 .
drwxr-xr-x 15 2002 2002 4096 Apr  9 13:22 ..
-rwxr-xr-x  1 2002 2002  232 Mar  7  2019 README.txt
-rwxr-xr-x  1 2002 2002 1937 Mar  7  2019 zkCleanup.sh
-rwxr-xr-x  1 2002 2002 1056 Mar  7  2019 zkCli.cmd
-rwxr-xr-x  1 2002 2002 1534 Mar  7  2019 zkCli.sh
-rwxr-xr-x  1 2002 2002 1759 Mar  7  2019 zkEnv.cmd
-rwxr-xr-x  1 2002 2002 2919 Mar  7  2019 zkEnv.sh
-rwxr-xr-x  1 2002 2002 1089 Mar  7  2019 zkServer.cmd
-rwxr-xr-x  1 2002 2002 6773 Mar  7  2019 zkServer.sh
-rwxr-xr-x  1 2002 2002  996 Mar  7  2019 zkTxnLogToolkit.cmd
-rwxr-xr-x  1 2002 2002 1385 Mar  7  2019 zkTxnLogToolkit.sh
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ./zkCli.sh start
Connecting to localhost:2181
2024-04-09 14:56:29,022 [myid:] - INFO  [main:Environment@100] - Client environment:zookeeper.version=3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf            , built on 03/06/2019 16:18 GMT
2024-04-09 14:56:29,028 [myid:] - INFO  [main:Environment@100] - Client environment:host.name=iZf8zi6zcbssmm6c2nrhapZ
2024-04-09 14:56:29,028 [myid:] - INFO  [main:Environment@100] - Client environment:java.version=1.8.0_144
2024-04-09 14:56:29,031 [myid:] - INFO  [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2024-04-09 14:56:29,032 [myid:] - INFO  [main:Environment@100] - Client environment:java.home=/evir/jdk8/jdk1.8.0_144/jre
2024-04-09 14:56:29,032 [myid:] - INFO  [main:Environment@100] - Client environment:java.class.path=/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-se            rver/target/classes:/evir/zk3414/zookeeper-3.4.14/bin/../build/classes:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/target/lib/*.jar:/evir/z            k3414/zookeeper-3.4.14/bin/../build/lib/*.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/slf4j-log4j12-1.7.25.jar:/evir/zk3414/zookeeper-3.4.14/bin/../            lib/slf4j-api-1.7.25.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/netty-3.10.6.Final.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/log4j-1.2.17.jar:/e            vir/zk3414/zookeeper-3.4.14/bin/../lib/jline-0.9.94.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/audience-annotations-0.5.0.jar:/evir/zk3414/zookeepe            r-3.4.14/bin/../zookeeper-3.4.14.jar:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/src/main/resources/lib/*.jar:/evir/zk3414/zookeeper-3.4.14            /bin/../conf:
2024-04-09 14:56:29,032 [myid:] - INFO  [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:            /lib:/usr/lib
2024-04-09 14:56:29,032 [myid:] - INFO  [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2024-04-09 14:56:29,032 [myid:] - INFO  [main:Environment@100] - Client environment:java.compiler=<NA>
2024-04-09 14:56:29,032 [myid:] - INFO  [main:Environment@100] - Client environment:os.name=Linux
2024-04-09 14:56:29,032 [myid:] - INFO  [main:Environment@100] - Client environment:os.arch=amd64
2024-04-09 14:56:29,032 [myid:] - INFO  [main:Environment@100] - Client environment:os.version=3.10.0-1160.108.1.el7.x86_64
2024-04-09 14:56:29,032 [myid:] - INFO  [main:Environment@100] - Client environment:user.name=root
2024-04-09 14:56:29,032 [myid:] - INFO  [main:Environment@100] - Client environment:user.home=/root
2024-04-09 14:56:29,033 [myid:] - INFO  [main:Environment@100] - Client environment:user.dir=/evir/zk3414/zookeeper-3.4.14/bin
2024-04-09 14:56:29,035 [myid:] - INFO  [main:ZooKeeper@442] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watche            r=org.apache.zookeeper.ZooKeeperMain$MyWatcher@277050dc
2024-04-09 14:56:29,075 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1025] - Opening socket connection to server localhost/            0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
ZooKeeper -server host:port cmd args
        stat path [watch]
        set path data [version]
        ls path [watch]
        delquota [-n|-b] path
        ls2 path [watch]
        setAcl path acl
        setquota -n|-b val path
        history
        redo cmdno
        printwatches on|off
        delete path [version]
        sync path
        listquota path
        rmr path
        get path [watch]
        create [-s] [-e] path data acl
        addauth scheme auth
        quit
        getAcl path
        close
        connect host:port
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ./zkCli.sh start
Connecting to localhost:2181
2024-04-09 14:58:42,602 [myid:] - INFO  [main:Environment@100] - Client environment:zookeeper.version=3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on 03/06/2019 16:18 GMT
2024-04-09 14:58:42,609 [myid:] - INFO  [main:Environment@100] - Client environment:host.name=iZf8zi6zcbssmm6c2nrhapZ
2024-04-09 14:58:42,609 [myid:] - INFO  [main:Environment@100] - Client environment:java.version=1.8.0_144
2024-04-09 14:58:42,612 [myid:] - INFO  [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2024-04-09 14:58:42,612 [myid:] - INFO  [main:Environment@100] - Client environment:java.home=/evir/jdk8/jdk1.8.0_144/jre
2024-04-09 14:58:42,612 [myid:] - INFO  [main:Environment@100] - Client environment:java.class.path=/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/target/classes:/evir/zk3414/zookeeper-3.4.14/bin/../build/classes:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/target/lib/*.jar:/evir/zk3414/zookeeper-3.4.14/bin/../build/lib/*.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/slf4j-log4j12-1.7.25.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/slf4j-api-1.7.25.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/netty-3.10.6.Final.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/log4j-1.2.17.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/jline-0.9.94.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/audience-annotations-0.5.0.jar:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-3.4.14.jar:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/src/main/resources/lib/*.jar:/evir/zk3414/zookeeper-3.4.14/bin/../conf:
2024-04-09 14:58:42,613 [myid:] - INFO  [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2024-04-09 14:58:42,613 [myid:] - INFO  [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2024-04-09 14:58:42,613 [myid:] - INFO  [main:Environment@100] - Client environment:java.compiler=<NA>
2024-04-09 14:58:42,613 [myid:] - INFO  [main:Environment@100] - Client environment:os.name=Linux
2024-04-09 14:58:42,613 [myid:] - INFO  [main:Environment@100] - Client environment:os.arch=amd64
2024-04-09 14:58:42,613 [myid:] - INFO  [main:Environment@100] - Client environment:os.version=3.10.0-1160.108.1.el7.x86_64
2024-04-09 14:58:42,613 [myid:] - INFO  [main:Environment@100] - Client environment:user.name=root
2024-04-09 14:58:42,613 [myid:] - INFO  [main:Environment@100] - Client environment:user.home=/root
2024-04-09 14:58:42,613 [myid:] - INFO  [main:Environment@100] - Client environment:user.dir=/evir/zk3414/zookeeper-3.4.14/bin
2024-04-09 14:58:42,615 [myid:] - INFO  [main:ZooKeeper@442] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@277050dc
ZooKeeper -server host:port cmd args
        stat path [watch]
        set path data [version]
        ls path [watch]
        delquota [-n|-b] path
        ls2 path [watch]
        setAcl path acl
        setquota -n|-b val path
        history
        redo cmdno
        printwatches on|off
        delete path [version]
        sync path
        listquota path
        rmr path
        get path [watch]
        create [-s] [-e] path data acl
        addauth scheme auth
        quit
        getAcl path
        close
        connect host:port
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# pwd
/evir/zk3414/zookeeper-3.4.14/bin
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ls -alt
total 60
-rw-r--r--  1 root root 7182 Apr  9 14:55 zookeeper.out
drwxr-xr-x  2 2002 2002 4096 Apr  9 14:52 .
drwxr-xr-x 15 2002 2002 4096 Apr  9 13:22 ..
-rwxr-xr-x  1 2002 2002  232 Mar  7  2019 README.txt
-rwxr-xr-x  1 2002 2002 1937 Mar  7  2019 zkCleanup.sh
-rwxr-xr-x  1 2002 2002 1056 Mar  7  2019 zkCli.cmd
-rwxr-xr-x  1 2002 2002 1534 Mar  7  2019 zkCli.sh
-rwxr-xr-x  1 2002 2002 1759 Mar  7  2019 zkEnv.cmd
-rwxr-xr-x  1 2002 2002 2919 Mar  7  2019 zkEnv.sh
-rwxr-xr-x  1 2002 2002 1089 Mar  7  2019 zkServer.cmd
-rwxr-xr-x  1 2002 2002 6773 Mar  7  2019 zkServer.sh
-rwxr-xr-x  1 2002 2002  996 Mar  7  2019 zkTxnLogToolkit.cmd
-rwxr-xr-x  1 2002 2002 1385 Mar  7  2019 zkTxnLogToolkit.sh
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ./zkCli.sh status
Connecting to localhost:2181
2024-04-09 14:59:32,992 [myid:] - INFO  [main:Environment@100] - Client environment:zookeeper.version=3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on 03/06/2019 16:18 GMT
2024-04-09 14:59:32,998 [myid:] - INFO  [main:Environment@100] - Client environment:host.name=iZf8zi6zcbssmm6c2nrhapZ
2024-04-09 14:59:32,999 [myid:] - INFO  [main:Environment@100] - Client environment:java.version=1.8.0_144
2024-04-09 14:59:33,002 [myid:] - INFO  [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2024-04-09 14:59:33,002 [myid:] - INFO  [main:Environment@100] - Client environment:java.home=/evir/jdk8/jdk1.8.0_144/jre
2024-04-09 14:59:33,002 [myid:] - INFO  [main:Environment@100] - Client environment:java.class.path=/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/target/classes:/evir/zk3414/zookeeper-3.4.14/bin/../build/classes:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/target/lib/*.jar:/evir/zk3414/zookeeper-3.4.14/bin/../build/lib/*.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/slf4j-log4j12-1.7.25.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/slf4j-api-1.7.25.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/netty-3.10.6.Final.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/log4j-1.2.17.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/jline-0.9.94.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/audience-annotations-0.5.0.jar:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-3.4.14.jar:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/src/main/resources/lib/*.jar:/evir/zk3414/zookeeper-3.4.14/bin/../conf:
2024-04-09 14:59:33,002 [myid:] - INFO  [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2024-04-09 14:59:33,002 [myid:] - INFO  [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2024-04-09 14:59:33,002 [myid:] - INFO  [main:Environment@100] - Client environment:java.compiler=<NA>
2024-04-09 14:59:33,003 [myid:] - INFO  [main:Environment@100] - Client environment:os.name=Linux
2024-04-09 14:59:33,003 [myid:] - INFO  [main:Environment@100] - Client environment:os.arch=amd64
2024-04-09 14:59:33,003 [myid:] - INFO  [main:Environment@100] - Client environment:os.version=3.10.0-1160.108.1.el7.x86_64
2024-04-09 14:59:33,003 [myid:] - INFO  [main:Environment@100] - Client environment:user.name=root
2024-04-09 14:59:33,003 [myid:] - INFO  [main:Environment@100] - Client environment:user.home=/root
2024-04-09 14:59:33,003 [myid:] - INFO  [main:Environment@100] - Client environment:user.dir=/evir/zk3414/zookeeper-3.4.14/bin
2024-04-09 14:59:33,005 [myid:] - INFO  [main:ZooKeeper@442] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@277050dc
ZooKeeper -server host:port cmd args
        stat path [watch]
        set path data [version]
        ls path [watch]
        delquota [-n|-b] path
        ls2 path [watch]
        setAcl path acl
        setquota -n|-b val path
        history
        redo cmdno
        printwatches on|off
        delete path [version]
        sync path
        listquota path
        rmr path
        get path [watch]
        create [-s] [-e] path data acl
        addauth scheme auth
        quit
        getAcl path
        close
        connect host:port
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ls -alt
total 60
-rw-r--r--  1 root root 7182 Apr  9 14:55 zookeeper.out
drwxr-xr-x  2 2002 2002 4096 Apr  9 14:52 .
drwxr-xr-x 15 2002 2002 4096 Apr  9 13:22 ..
-rwxr-xr-x  1 2002 2002  232 Mar  7  2019 README.txt
-rwxr-xr-x  1 2002 2002 1937 Mar  7  2019 zkCleanup.sh
-rwxr-xr-x  1 2002 2002 1056 Mar  7  2019 zkCli.cmd
-rwxr-xr-x  1 2002 2002 1534 Mar  7  2019 zkCli.sh
-rwxr-xr-x  1 2002 2002 1759 Mar  7  2019 zkEnv.cmd
-rwxr-xr-x  1 2002 2002 2919 Mar  7  2019 zkEnv.sh
-rwxr-xr-x  1 2002 2002 1089 Mar  7  2019 zkServer.cmd
-rwxr-xr-x  1 2002 2002 6773 Mar  7  2019 zkServer.sh
-rwxr-xr-x  1 2002 2002  996 Mar  7  2019 zkTxnLogToolkit.cmd
-rwxr-xr-x  1 2002 2002 1385 Mar  7  2019 zkTxnLogToolkit.sh
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /evir/zk3414/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: standalone
[root@iZf8zi6zcbssmm6c2nrhapZ bin]# ./zkCli.sh
Connecting to localhost:2181
2024-04-09 15:03:45,546 [myid:] - INFO  [main:Environment@100] - Client environment:zookeeper.version=3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on 03/06/2019 16:18 GMT
2024-04-09 15:03:45,552 [myid:] - INFO  [main:Environment@100] - Client environment:host.name=iZf8zi6zcbssmm6c2nrhapZ
2024-04-09 15:03:45,553 [myid:] - INFO  [main:Environment@100] - Client environment:java.version=1.8.0_144
2024-04-09 15:03:45,556 [myid:] - INFO  [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2024-04-09 15:03:45,556 [myid:] - INFO  [main:Environment@100] - Client environment:java.home=/evir/jdk8/jdk1.8.0_144/jre
2024-04-09 15:03:45,556 [myid:] - INFO  [main:Environment@100] - Client environment:java.class.path=/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/target/classes:/evir/zk3414/zookeeper-3.4.14/bin/../build/classes:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/target/lib/*.jar:/evir/zk3414/zookeeper-3.4.14/bin/../build/lib/*.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/slf4j-log4j12-1.7.25.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/slf4j-api-1.7.25.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/netty-3.10.6.Final.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/log4j-1.2.17.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/jline-0.9.94.jar:/evir/zk3414/zookeeper-3.4.14/bin/../lib/audience-annotations-0.5.0.jar:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-3.4.14.jar:/evir/zk3414/zookeeper-3.4.14/bin/../zookeeper-server/src/main/resources/lib/*.jar:/evir/zk3414/zookeeper-3.4.14/bin/../conf:
2024-04-09 15:03:45,556 [myid:] - INFO  [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2024-04-09 15:03:45,556 [myid:] - INFO  [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2024-04-09 15:03:45,556 [myid:] - INFO  [main:Environment@100] - Client environment:java.compiler=<NA>
2024-04-09 15:03:45,557 [myid:] - INFO  [main:Environment@100] - Client environment:os.name=Linux
2024-04-09 15:03:45,557 [myid:] - INFO  [main:Environment@100] - Client environment:os.arch=amd64
2024-04-09 15:03:45,557 [myid:] - INFO  [main:Environment@100] - Client environment:os.version=3.10.0-1160.108.1.el7.x86_64
2024-04-09 15:03:45,557 [myid:] - INFO  [main:Environment@100] - Client environment:user.name=root
2024-04-09 15:03:45,557 [myid:] - INFO  [main:Environment@100] - Client environment:user.home=/root
2024-04-09 15:03:45,557 [myid:] - INFO  [main:Environment@100] - Client environment:user.dir=/evir/zk3414/zookeeper-3.4.14/bin
2024-04-09 15:03:45,559 [myid:] - INFO  [main:ZooKeeper@442] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@277050dc
Welcome to ZooKeeper!
2024-04-09 15:03:45,605 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1025] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2024-04-09 15:03:45,750 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@879] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2024-04-09 15:03:45,783 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1299] - Session establishment complete on server localhost/0:0:0:0:0:0:0:1:2181, sessionid = 0x100043393930001, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] cd /brokers
ZooKeeper -server host:port cmd args
        stat path [watch]
        set path data [version]
        ls path [watch]
        delquota [-n|-b] path
        ls2 path [watch]
        setAcl path acl
        setquota -n|-b val path
        history
        redo cmdno
        printwatches on|off
        delete path [version]
        sync path
        listquota path
        rmr path
        get path [watch]
        create [-s] [-e] path data acl
        addauth scheme auth
        quit
        getAcl path
        close
        connect host:port
[zk: localhost:2181(CONNECTED) 1] get /brokers/ids/0
{"features":{},"listener_security_protocol_map":{"PLAINTEXT":"PLAINTEXT"},"endpoints":["PLAINTEXT://127.0.0.1:9092"],"jmx_port":-1,"port":9092,"host":"127.0.0.1","version":5,"timestamp":"1712645703009"}
cZxid = 0x19
ctime = Tue Apr 09 14:55:03 CST 2024
mZxid = 0x19
mtime = Tue Apr 09 14:55:03 CST 2024
pZxid = 0x19
cversion = 0
dataVersion = 1
aclVersion = 0
ephemeralOwner = 0x100043393930000
dataLength = 202
numChildren = 0
[zk: localhost:2181(CONNECTED) 2] ls /brokers
[ids, topics, seqid]
[zk: localhost:2181(CONNECTED) 3]

# 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=/evir/zk3414/zookeeper-3.4.14/data/
#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

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# This configuration file is intended for use in ZK-based mode, where Apache ZooKeeper is required.
# See kafka.server.KafkaConfig for additional details and defaults
#

############################# Server Basics #############################

# The id of the broker. This must be set to a unique integer for each broker.
broker.id=0

############################# Socket Server Settings #############################

# The address the socket server listens on. If not configured, the host name will be equal to the value of
# java.net.InetAddress.getCanonicalHostName(), with PLAINTEXT listener name, and port 9092.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE:
#     listeners = PLAINTEXT://your.host.name:9092
#listeners=PLAINTEXT://:9092
listeners=PLAINTEXT://127.0.0.1:9092
# Listener name, hostname and port the broker will advertise to clients.
# If not set, it uses the value for "listeners".
#advertised.listeners=PLAINTEXT://your.host.name:9092

# Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details
#listener.security.protocol.map=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL

# The number of threads that the server uses for receiving requests from the network and sending responses to the network
num.network.threads=3

# The number of threads that the server uses for processing requests, which may include disk I/O
num.io.threads=8

# The send buffer (SO_SNDBUF) used by the socket server
socket.send.buffer.bytes=102400

# The receive buffer (SO_RCVBUF) used by the socket server
socket.receive.buffer.bytes=102400

# The maximum size of a request that the socket server will accept (protection against OOM)
socket.request.max.bytes=104857600


############################# Log Basics #############################

# A comma separated list of directories under which to store log files
log.dirs=/tmp/kafka-logs

# The default number of log partitions per topic. More partitions allow greater
# parallelism for consumption, but this will also result in more files across
# the brokers.
num.partitions=1

# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
# This value is recommended to be increased for installations with data dirs located in RAID array.
num.recovery.threads.per.data.dir=1

############################# Internal Topic Settings  #############################
# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state"
# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3.
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1

############################# Log Flush Policy #############################

# Messages are immediately written to the filesystem but by default we only fsync() to sync
# the OS cache lazily. The following configurations control the flush of data to disk.
# There are a few important trade-offs here:
#    1. Durability: Unflushed data may be lost if you are not using replication.
#    2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush.
#    3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to excessive seeks.
# The settings below allow one to configure the flush policy to flush data after a period of time or
# every N messages (or both). This can be done globally and overridden on a per-topic basis.

# The number of messages to accept before forcing a flush of data to disk
#log.flush.interval.messages=10000

# The maximum amount of time a message can sit in a log before we force a flush
#log.flush.interval.ms=1000

############################# Log Retention Policy #############################

# The following configurations control the disposal of log segments. The policy can
# be set to delete segments after a period of time, or after a given size has accumulated.
# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens
# from the end of the log.

# The minimum age of a log file to be eligible for deletion due to age
log.retention.hours=168

# A size-based retention policy for logs. Segments are pruned from the log unless the remaining
# segments drop below log.retention.bytes. Functions independently of log.retention.hours.
#log.retention.bytes=1073741824

# The maximum size of a log segment file. When this size is reached a new log segment will be created.
log.segment.bytes=1073741824

# The interval at which log segments are checked to see if they can be deleted according
# to the retention policies
log.retention.check.interval.ms=300000

############################# Zookeeper #############################

# Zookeeper connection string (see zookeeper docs for details).
# This is a comma separated host:port pairs, each corresponding to a zk
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
# You can also append an optional chroot string to the urls to specify the
# root directory for all kafka znodes.
zookeeper.connect=localhost:2181

# Timeout in ms for connecting to zookeeper
zookeeper.connection.timeout.ms=18000


############################# Group Coordinator Settings #############################

# The following configuration specifies the time, in milliseconds, that the GroupCoordinator will delay the initial consumer rebalance.
# The rebalance will be further delayed by the value of group.initial.rebalance.delay.ms as new members join the group, up to a maximum of max.poll.interval.ms.
# The default value for this is 3 seconds.
# We override this to 0 here as it makes for a better out-of-the-box experience for development and testing.
# However, in production environments the default value of 3 seconds is more suitable as this will help to avoid unnecessary, and potentially expensive, rebalances during application startup.
group.initial.rebalance.delay.ms=0

相關文章