Rocketmq 4.2.0 安装

Rocketmq 4.2.0 安装

标签(空格分隔): RocketMQ


[toc]

1. 编译

  > unzip rocketmq-all-4.2.0-source-release.zip
  > cd rocketmq-all-4.2.0/
  > mvn -Prelease-all -DskipTests clean install -U
  > cd distribution/target/apache-rocketmq

2. 启动 Name Server

  > nohup sh bin/mqnamesrv &
  > tail -f ~/logs/rocketmqlogs/namesrv.log
  The Name Server boot success...

3. 启动Broker

  > nohup sh bin/mqbroker -n localhost:9876 &
  > tail -f ~/logs/rocketmqlogs/broker.log 
  The broker[%s, 172.30.30.233:10911] boot success...
  # 启动加入配置文件参数
 nohup sh bin/mqbroker -c  /paxos/software/apache-rocketmq-all/conf/2m-2s-sync/broker-a.properties -n 127.0.0.1:9876 &
 [rocketmq@localhost rocketmq]$ more /paxos/software/apache-rocketmq-all/conf/2m-2s-sync/broker-a.properties
#Broker对外服务的监听端口 
#listenPort = 10911 
## Name Server地址 
#namesrvAddr=192.168.0.26:9876  
#本机IP地址,默认系统自动识别,但是某些多网卡机器会存在识别错误的情况,这种情况下可以人工配置
brokerIP1=192.168.0.26
#Broker所属哪个集群,其中缺省值为DefaultCluster
brokerClusterName=DefaultCluster
#本机主机名
brokerName=broker-a
#BrokerId,必须是大等于0的整数,0表示Master,>0表示Slave,一个Master可以挂多个Slave,Master与Slave通过BrokerName来配对
brokerId=0
deleteWhen=04
fileReservedTime=48
brokerRole=SYNC_MASTER
flushDiskType=ASYNC_FLUSH

4. Send & Receive Messages

 > export NAMESRV_ADDR=localhost:9876
 > sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
 SendResult [sendStatus=SEND_OK, msgId= ...

 > sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer
 ConsumeMessageThread_%d Receive New Messages: [MessageExt...

5. 停止服务

> sh bin/mqshutdown broker
The mqbroker(36695) is running...
Send shutdown request to mqbroker(36695) OK

> sh bin/mqshutdown namesrv
The mqnamesrv(36664) is running...
Send shutdown request to mqnamesrv(36664) OK

转载于:https://my.oschina.net/u/1179666/blog/1605965

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值