zookeeper 部署
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz
tar zxf zookeeper-3.4.14.tar.gz
cp -r zookeeper-3.4.14 /usr/local/zookeeper
cd /usr/local/zookeeper/conf
cp zoo_sample.cfg zoo.cfg
vim zoo.cfg #添加如下内容
datadir=/usr/local/zookeeper/data/data
dataLogDir=/usr/local/zookeeper/data/datalog
mkdir -p /usr/local/zookeeper/data/data
mkdir -p /usr/local/zookeeper/data/datalog
cd ../bin/
./zkServer.sh start
#编辑启动文件
vim /usr/lib/systemd/system/zookeeper.service
[Unit]
Description=zookeeper
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
ExecStart=/usr/local/zookeeper/bin/zkServer.sh start
ExecReload=/usr/local/zookeeper/bin/zkServer.sh restart
ExecStop=/usr/local/zookeeper/bin/zkServer.sh stop
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
chmod a+x /usr/lib/systemd/system/zookeeper.service
systemctl enable /usr/lib/systemd/system/zookeeper.service
rocketmq 部署
wget http://mirrors.tuna.tsinghua.edu.cn/apache/rocketmq/4.6.0/rocketmq-all-4.6.0-bin-release.zip
unzip rocketmq-all-4.6.0-bin-release.zip
mv rocketmq-all-4.6.0-bin-release /usr/local/rocketmq
cd /usr/local/rocketmq/conf
vim broker.conf #添加如下内容
namesrvAddr=0.0.0.0:9876
brokerIP1=0.0.0.0
autoCreateTopicEnable=true
autoCreateSubscriptionGroup=true
#注意bin目录下启动文件jvm大小 runbroker.sh runserver.sh
vim /etc/profile
export ROCKETMQ_HOME=/usr/local/rocketmq
export PATH=$ROCKETMQ_HOME/bin:$PATH
nohup sh bin/mqnamesrv >> mqnamesrv.log &
nohup sh bin/mqbroker -c conf/broker.conf >> mqbroker.log &
#安装rocketmq-externals
unzip rocketmq-externals.zip
mv rocketmq-externals /usr/local/
nohup java -jar /usr/local/rocketmq-externals/rocketmq-console/target/rocketmq-console-ng-1.0.0.jar --server.port=8080 --rocketmq.config.namesrvAddr=192.168.10.51:9876\;192.168.10.52:9876 & #注意改IP
来源:CSDN
作者:chengrowe
链接:https://blog.csdn.net/chengrowe/article/details/103913711