- 解压
- 到根目录
- 启动zookeeper
- 初始化元数据(只执行一次)
bin/pulsar initialize-cluster-metadata \ --cluster pulsar-cluster \ --metadata-store zk:zk1:2181,zk2:2181,zk3:2181 \ --configuration-metadata-store zk:zk1:2181,zk2:2181,zk3:2181 \ --web-service-url http://zk1:8081,zk2:8081,zk3:8081 \ --broker-service-url pulsar://zk1:6650,zk2:6650,zk3:6650
- 配置bookKeeper
vim conf/bookkeeper.conf
metadataServiceUri=zk://zk1:2181;zk2:2181;zk3:2181/ledgers
- 配置broker
vim conf/broker.conf
metadataStoreUrl=zk:zk1:2181,zk2:2181,zk3:2181 configurationMetadataStoreUrl=zk:zk1:2181,zk2:2181,zk3:2181 clusterName=pulsar-cluster brokerServicePort=6650 webServicePort=8081
- 配置客户端
vim conf/client.conf
webServiceUrl=http://zk1:8081,zk2:8081,zk3:8081 brokerServiceurl=pulsar://zk1:6650,zk2:6650,zk3:6650
NOTE: 首次启动可能需要前台启动,原因不明
启动bookie
bin/pulsar-daemon start bookie
启动broker
bin/pulsar-daemon start broker
关闭
bin/pulsar-daemon stop bookie
bin/pulsar-daemon stop broker
创建主题
bin/pulsar-admin topics create persistent://public/default/topic