RocketMQ 是alibaba开源的消息队列。本文使用的是开源版本v3.18
系统: CentOS 6.x最小化安装
需要用到的软件包:
jdk-7u67-linux-x64.tar.gz
alibaba-rocketmq-3.1.8.tar.gz
开始安装
#tar xvf jdk-7u67-linux-x64.tar.gz -C /opt/
#tar xvf alibaba-rocketmq-3.1.8.tar.gz -C /opt/
#ln -s /opt/jdk1.7.0_67 /opt/jdk
配置环境变量
在/etc/profile最后添加
export Java_HOME=/opt/jdk
export PATH=$JAVA_HOME/bin:$PATH
使变量生效
source /etc/profile
验证java
# java -version
java version “1.7.0_67”
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
启动nameserver
#cd /opt/alibaba-rocketmq/bin/
#nohup sh mqnamesrv &
验证nameserver是否启动
# tail -f nohup.out
The Name Server boot success.
启动broker
在启动borker之前需要指点nameserver
#export NAMESRV_ADDR=Your_IP:9876
#cd /opt/alibaba-rocketmq/bin/
#nohup sh mqbroker &
验证mqbroker是否启动
# tail -f nohup.out
The broker[Your_hostname, Your_IP:10911] boot success. and name server is Your_IP:9876
最后配置防火墙
nameserver端口为9876
broker端口为10911
lokkit -p 9876:tcp -p 10911:tcp
关闭nameserver broker
#/opt/alibaba-rocketmq/bin/
#sh mqshutdown namesrv
#sh mqshutdown broker
至此 RockerMQ 安装完毕。
参考:https://github.com/alibaba/RocketMQ
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-09/106842.htm