部署 Pulsar 集群
部署 JDK 及初始化 Zookeeper 中的元数据
cat >> ~/.bash_profile <<'EOF'
# JDK
export JAVA_HOME=/root/jdk
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
EOF
souece ~/.bash_profile
tar -zxf apache-pulsar-2.8.0-bin.tar.gz -C ~
ln -sv apache-pulsar-2.8.0 pulsar
[root@node1 conf]
mkdir -p /data/zookeeper/{data,log}
cat > ~/pulsar/conf/zookeeper.conf <<'EOF'
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/data/zookeeper/data
dataLogDir=/data/zookeeper/log
server.1=node1:2888:3888
server.2=node2:2888:3888
server.3=node3:2888:3888
clientPort=2181
admin.enableServer=true
admin.serverPort=9990
autopurge.snapRetainCount=3
autopurge.purgeInterval=1
forceSync=yes
sslQuorum=false
portUnification=false
metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
metricsProvider.httpPort=8000
metricsProvider.exportJvmInfo=true
EOF
echo 1 > /data/zookeeper/data/myid
cd ~/pulsar/bin
./pulsar-daemon start zookeeper
./pulsar zookeeper-shell
./pulsar initialize-cluster-metadata \
--cluster pulsar-cluster \
--zookeeper node1:2181 \
--configuration-store node1:2181 \
--web-service-url http://node1:8080,node2:8080,node3:8080 \
--web-service-url-tls https://node1:8443,node2:8443,node3:8443 \
--broker-service-url pulsar://node1:6650,node2:6650,node3:6650 \
--broker-service-url-tls pulsar+ssl://node1:6651,node2:6651,node3:6651
部署 Pulsar BooKKeeper
vim ~/pulsar/conf/bookkeeper.conf
bookiePort=3181
httpServerPort=8000
prometheusStatsHttpPort=8100
advertisedAddress=192.168.6.1
zkServers=192.168.6.1:2181,192.168.6.2:2181,192.168.6.3:2181
journalDirectories=/data/pulsar/bookkeeper/journal
ledgerDirectories=/data/pulsar/bookkeeper/ledgers
mkdir -p /data/pulsar/bookkeeper/{journal,ledgers}
./bookkeeper shell metaformat
./pulsar-daemon start bookie
./bookkeeper shell bookiesanity
部署 Pulsar Broker
vim ~/pulsar/conf/broker.conf
clusterName=pulsar-cluster
zookeeperServers=node1:2181,node2:2181,node3:2181
configurationStoreServers=node1:2181,node2:2181,node3:2181
advertisedAddress=node1
./pulsar-daemon start broker
./pulsar-admin brokers list pulsar-cluster
bookkeeper.conf
broker.conf
client.conf
discovery.conf
zookeeper.conf
global_zookeeper.conf
proxy.conf
standalone.conf
websocket.conf
schema_example.conf
|