Common commands for zookeeper and kafka

Zookeeper operating directory:

View zookeeper
status./zkServer.sh status
Connect to zookeeper, execute in the bin directory./zkCli.sh
(default connection localhost:2181)
./zkCli.sh -server localhost:2191 (specify ip port number connection) to
create a node, must Add data to create a successful creation
/msgprocess/icpush test to
see which sub-nodes are under the node
ls /msgprocess
ls / to view the directory
get /brokers/topics/userRegistDqTopic to view the topic information stored in zookeeper to
view the kafka offset information
get /consumers/10/ offsets/userRegistDqTopic/0 
delete /node_1/node_1_10000000001 delete a node that does not contain child nodes
rmr /node_1 delete a node (can contain child nodes)
getAcl /smpin_namespace view node authority information

Kafka operation directory

View the topic list. /kafka-list-topic.sh --zookeeper localhost:2191
Create topic
./kafka-create-topic.sh --replica 1 --partition 1 --topic test123 --zookeeper 192.168.128.85:2191
kafka The consumer client configures the zk address, and the producer configures the kafka address to
send messages./kafka-console-producer.sh
--broker-list 192.168.128.85:7878 --topic userRegistDqTopic to
view the messages in the
topic./kafka-console-consumer .sh --zookeeper 192.168.128.85:2191 --from-beginning --topic syncDqTopic-reply-600301

Guess you like

Origin blog.csdn.net/noob9527/article/details/100665259