Skip to content

Instantly share code, notes, and snippets.

@nixawk
Created May 29, 2019 16:12
Show Gist options
  • Save nixawk/d95950d85cf43ed00c2a123334c2d97b to your computer and use it in GitHub Desktop.
Save nixawk/d95950d85cf43ed00c2a123334c2d97b to your computer and use it in GitHub Desktop.

zookeeper

server

debug@rabbitmq-1:~/kafka/apache-zookeeper-3.5.5$ java -version 
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
debug@rabbitmq-1:~/kafka$ wget -c http://ftp.jaist.ac.jp/pub/apache/zookeeper/current/apache-zookeeper-3.5.5-bin.tar.gz
debug@rabbitmq-1:~/kafka$ cp conf/zoo_sample.cfg conf/zoo.cfg
debug@rabbitmq-1:~/kafka/apache-zookeeper-3.5.5-bin$ ./bin/zkServer.sh start 
ZooKeeper JMX enabled by default
Using config: /home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
debug@rabbitmq-1:~/kafka/apache-zookeeper-3.5.5-bin$ ./bin/zkServer.sh stop 
ZooKeeper JMX enabled by default
Using config: /home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
debug@rabbitmq-1:~/kafka/apache-zookeeper-3.5.5-bin$ ./bin/zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost.
Mode: standalone

client

debug@rabbitmq-1:~/kafka/apache-zookeeper-3.5.5-bin$ ./bin/zkCli.sh 
Connecting to localhost:2181
2019-05-29 22:35:05,797 [myid:] - INFO  [main:Environment@109] - Client environment:zookeeper.version=3.5.5-390fe37ea45dee01bf87dc1c042b5e3dcce88653, built on 05/03/2019 12:07 GMT
2019-05-29 22:35:05,800 [myid:] - INFO  [main:Environment@109] - Client environment:host.name=rabbitmq-1
2019-05-29 22:35:05,800 [myid:] - INFO  [main:Environment@109] - Client environment:java.version=1.8.0_191
2019-05-29 22:35:05,801 [myid:] - INFO  [main:Environment@109] - Client environment:java.vendor=Oracle Corporation
2019-05-29 22:35:05,801 [myid:] - INFO  [main:Environment@109] - Client environment:java.home=/usr/lib/jvm/java-8-openjdk-amd64/jre
2019-05-29 22:35:05,801 [myid:] - INFO  [main:Environment@109] - Client environment:java.class.path=/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../zookeeper-server/target/classes:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../build/classes:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../zookeeper-server/target/lib/*.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../build/lib/*.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/zookeeper-jute-3.5.5.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/zookeeper-3.5.5.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/slf4j-log4j12-1.7.25.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/slf4j-api-1.7.25.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/netty-all-4.1.29.Final.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/log4j-1.2.17.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/json-simple-1.1.1.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/jline-2.11.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/jetty-util-9.4.17.v20190418.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/jetty-servlet-9.4.17.v20190418.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/jetty-server-9.4.17.v20190418.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/jetty-security-9.4.17.v20190418.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/jetty-io-9.4.17.v20190418.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/jetty-http-9.4.17.v20190418.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/javax.servlet-api-3.1.0.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/jackson-databind-2.9.8.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/jackson-core-2.9.8.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/jackson-annotations-2.9.0.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/commons-cli-1.2.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../lib/audience-annotations-0.5.0.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../zookeeper-*.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../zookeeper-server/src/main/resources/lib/*.jar:/home/debug/kafka/apache-zookeeper-3.5.5-bin/bin/../conf:
2019-05-29 22:35:05,802 [myid:] - INFO  [main:Environment@109] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
2019-05-29 22:35:05,802 [myid:] - INFO  [main:Environment@109] - Client environment:java.io.tmpdir=/tmp
2019-05-29 22:35:05,802 [myid:] - INFO  [main:Environment@109] - Client environment:java.compiler=<NA>
2019-05-29 22:35:05,802 [myid:] - INFO  [main:Environment@109] - Client environment:os.name=Linux
2019-05-29 22:35:05,802 [myid:] - INFO  [main:Environment@109] - Client environment:os.arch=amd64
2019-05-29 22:35:05,802 [myid:] - INFO  [main:Environment@109] - Client environment:os.version=4.19.0-lab
2019-05-29 22:35:05,802 [myid:] - INFO  [main:Environment@109] - Client environment:user.name=debug
2019-05-29 22:35:05,802 [myid:] - INFO  [main:Environment@109] - Client environment:user.home=/home/debug
2019-05-29 22:35:05,802 [myid:] - INFO  [main:Environment@109] - Client environment:user.dir=/home/debug/kafka/apache-zookeeper-3.5.5-bin
2019-05-29 22:35:05,803 [myid:] - INFO  [main:Environment@109] - Client environment:os.memory.free=54MB
2019-05-29 22:35:05,804 [myid:] - INFO  [main:Environment@109] - Client environment:os.memory.max=228MB
2019-05-29 22:35:05,804 [myid:] - INFO  [main:Environment@109] - Client environment:os.memory.total=59MB
2019-05-29 22:35:05,806 [myid:] - INFO  [main:ZooKeeper@868] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@4f8e5cde
2019-05-29 22:35:05,814 [myid:] - INFO  [main:X509Util@79] - Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation
2019-05-29 22:35:05,819 [myid:] - INFO  [main:ClientCnxnSocket@237] - jute.maxbuffer value is 4194304 Bytes
2019-05-29 22:35:05,826 [myid:] - INFO  [main:ClientCnxn@1653] - zookeeper.request.timeout value is 0. feature enabled=
Welcome to ZooKeeper!
2019-05-29 22:35:05,831 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2019-05-29 22:35:05,880 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@959] - Socket connection established, initiating session, client: /127.0.0.1:51118, server: localhost/127.0.0.1:2181
2019-05-29 22:35:05,906 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1394] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x100000a52aa0000, negotiated timeout = 30000

WATCHER::

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

kafka

server

debug@rabbitmq-1:~/kafka/kafka_2.11-2.1.1$ bin/kafka-server-start.sh config/server.properties 

producer

debug@rabbitmq-1:~/kafka/kafka_2.11-2.1.1$ ./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic HelloKafka
>Hello
>This is my first kafka message
>This is my second kafka msg
>

consumer

debug@rabbitmq-1:~/kafka/kafka_2.11-2.1.1$ bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic HelloKafka --from-beginning
Hello
This is my first kafka message
This is my second kafka msg

references

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment