centos7.5安装rocketmq

rocketmq的安装方式是通过下载源码编译的方式进行安装。

  1. 下载源码:git clone -b develop https://github.com/apache/rocketmq.git
  2. 编译:
- cd rocketmq
- mvn -Prelease-all -DskipTests clean install -U
- cd distribution/target/apache-rocketmq

  1. 启动:
- 启动namesrv:nohup sh mqnamesrv &
- 查看namesrv日志: tail -f ~/logs/rocketmqlogs/namesrv.log
- 启动borker:nohup sh mqbroker -n 127.0.0.1:9876 &
- 重启borker:nohup sh mqbroker -n 127.0.0.1:9876 -c broker.p autoCreateTopicEnable=true 
- 查看broker日志: tail -f ~/logs/rocketmqlogs/broker.log 2>&1 &
- 一般服务器配置下,默认的broker会无法启动,这是因为jvm配置的原因,注意修改jvm内存配置,找到runserver.sh和runbroker.sh,编辑: JAVA_OPT=”${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn125m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m”
- 创建topic:sh mqadmin updateTopic -n 127.0.0.1:9876 -c DefaultCluster -t Log
- 查看topic列表:./mqadmin topicList -n127.0.0.1:9876
- 删除topic:sh mqadmin deleteTopic –n 127.0.0.1:9876 –c DefaultCluster –t Log
  1. 关闭:
- 关闭broker: sh mqshutdown broker
- 关闭namesrv: sh mqshutdown namesrv
- jps 查看进程
  1. 控制台安装:
  • 下载地址:https://github.com/apache/rocketmq-externals.git
  • 修改配置:rocketmq.config.isVIPChannel=false
  • 编译:mvn clean package -Dmaven.test.skip=true

你可能感兴趣的:(centos7.5安装rocketmq)