zookeeper 部署+rocketmq 部署

落花浮王杯 提交于 2020-01-11 02:07:17

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!