
下载链接:https://archive.apache.org/dist/rocketmq/4.9.3/rocketmq-all-4.9.3-bin-release.zip
1. 解压; 2. 修改启动参数:vim rocketmq-4.9.3/bin/runserver.sh
修改 Broker 堆内存大小(比如 -Xms512m -Xmx512m)
vim rocketmq-4.9.3/bin/runbroker.sh
修改 tools.sh 指定 Name Server 地址 export NAMESRV_ADDR=localhost:9876,设置堆内存大小 (比如 -Xms512m -Xmx512m)
vim rocketmq-4.9.3/bin/tools.sh
启动
# 后台方式启动 Name Server nohup sh bin/mqnamesrv & # 后台启动 Broker nohup sh bin/mqbroker -n localhost:9876 -c conf/broker.conf autoCreateTopicEnable=true & -n:指定要连接的NameServer地址 -c:指定配置文件 autoCreateTopicEnable=true 自动创建Topic,生产建议关闭
停止
# 停止 Broker sh /opt/soft/rocketmq-4.9.1/bin/mqshutdown broker tip:将/root/store目录下所有文件删除(find / -name store) # 停止 Name Server sh /opt/soft/rocketmq-4.9.1/bin/mqshutdown namesrv
查看日志
tail -f -n 100 nohup.out
查看端口情况
ss -lnt
发送消息
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…
禁用服务器
sh bin/mqshutdown broker sh bin/mqshutdown namesrv
现在在github上面已经改名为rocketmq-dashboard.tar.gz
tar xf rocketmq-dashboard-1.0.0.tar.gz cd rocketmq-dashboard-rocketmq-dashboard-1.0.0 #修改配置为需要登录 sed -i s/rocketmq.config.loginRequired=fasle/rocketmq.config.loginRequired=true/g src/main/resources/application.properties2. 修改配置文件:
修改 application.properties 内容如下(每次修改完记得重新编译打包):
server.address=0.0.0.0
# =============修改端口为9876=============
server.port=9876
### SSL setting
#server.ssl.key-store=classpath:rmqcngkeystore.jks
#server.ssl.key-store-password=rocketmq
#server.ssl.keyStoreType=PKCS12
#server.ssl.keyAlias=rmqcngkey
#spring.application.index=true
spring.application.name=rocketmq-console
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
logging.level.root=INFO
logging.config=classpath:logback.xml
#if this value is empty,use env value rocketmq.config.namesrvAddr NAMESRV_ADDR | now, you can set it in ops page.default localhost:9876
# =============修改namesrv地址,如果是多个请以分号;分隔(此处修改成你自己安装的rocket namesrv地址ip即可)=============
rocketmq.config.namesrvAddr=xx.xx.xxx:9876
#if you use rocketmq version < 3.5.8, rocketmq.config.isVIPChannel should be false.default true
rocketmq.config.isVIPChannel=
#rocketmq-console's data path:dashboard/monitor
rocketmq.config.dataPath=/tmp/rocketmq-console/data
#set it false if you don't want use dashboard.default true
rocketmq.config.enableDashBoardCollect=true
#set the message track trace topic if you don't want use the default one
rocketmq.config.msgTrackTopicName=
rocketmq.config.ticketKey=ticket
#Must create userInfo file: ${rocketmq.config.dataPath}/users.properties if the login is required
# =============开启控制台账户密码登录(为true表示开启,为false表示关闭)=============
rocketmq.config.loginRequired=true
#set the accessKey and secretKey if you used acl
#rocketmq.config.accessKey=
#rocketmq.config.secretKey=
修改 users.properties 内容如下(每次修改完记得重新编译打包):
# This file supports hot change, any change will be auto-reloaded without Console restarting. # Format: a user per line, username=password[,N] #N is optional, 0 (Normal User); 1 (Admin) # Define Admin # =============用户名和密码规则「用户名=密码,权限」,这里的权限为1表示管理员,为0表示普通用户============= # 例如:admin=admin123,1 这是用户名=这是密码,1 # Define Users # =============屏蔽下边两个账户============= #user1=user1 #user2=user2
```linux nuhup java -jar rocketmq-dashboard-1.0.0.jar & ```