Record the Pulsar commands commonly used in work and study.
Continuously updating...
1. Daily use
- Delete Topic
bin/pulsar-admin topics delete persistent://public/xxx命名空间/xxxTopic名称
- Create Topics
bin/pulsar-admin topics create persistent://public/xxx命名空间/xxxTopic名称
- View Topics
bin/pulsar-admin topics stats persistent://public/xxx命名空间/xxxTopic名称
- View the internal status of Topic
bin/pulsar-admin topics stats-internal persistent://public/xxx命名空间/xxxTopic名称
- Delete the subscription under the topic
bin/pulsar-admin topics unsubscribe -s "订阅名称" persistent://public/xxx命名空间/xxxTopic名称
- Clear Topic
bin/pulsar-admin topics truncate persistent://public/xxx命名空间/xxxTopic名称
Truncate a topic. The truncate operation will move all cursors to
the end of the topic and delete all inactive ledgers. Usage: truncate
persistent://tenant/namespace/topic
This command has not been tested yet... …
2. Commonly used items
- View pulsar broker zookeeper bookkeeper process
ps -eaf | grep pulsar
If the processes of broker, zookeeper and bookkeeper are normal, the cluster is normal
- View the surviving bookkeepers in the cluster
bin/bookkeeper shell listbookies -readwrite
- Start the bookkeeper process
bin/pulsar-daemon start bookie
- Test production 10 messages
bin/pulsar-client produce persistent://public/default/test -n 10 -m "hello pulsar"
- Test consumption of 10 messages
bin/pulsar-client consume persistent://public/default/test -n 10 -s "consumer-test"