1. 安装mq>rocketmq
下载二进制包:
wget https://dist.apache.org/repos/dist/release/mq>rocketmq/5.3.0/mq>rocketmq-all-5.3.0-bin-release.zip
unzip mq>rocketmq-all-5.3.0-bin-release.zip
mv mq>rocketmq-all-5.3.0-bin-release mq>rocketmq-5.3.0
修改JVM配置内存大小:
vi bin/runbroker.sh找到 JAVA_OPT="${JAVA_OPT} -server -Xms8g -Xmx8g"
改为 JAVA_OPT="${JAVA_OPT} -server -Xms1g -Xmx1g"找到 JAVA_OPT="${JAVA_OPT} -Xmn4g -XX:+UseConcMarkSwee ...
改为 JAVA_OPT="${JAVA_OPT} -Xmn1g -XX:+UseConcMarkSwee ...找到 JAVA_OPT="${JAVA_OPT} -XX:-UseLargePages -XX:-UseBiasedLocking"
改为 JAVA_OPT="${JAVA_OPT} -XX:-UseLargePages" 将UseBiasedLocking去掉
添加环境变量:
vi ~/.bashrc添加:
export ROCKETMQ_HOME=/opt/mq>rocketmq-5.3.0
export PATH=$PATH:$ROCKETMQ_HOME/binsource ~/.bashrc
启动nameserver:
nohup sh bin/mqnamesrv &
然后crtl+c中断即可查看/root/logs/mq>rocketmqlogs/namesrv.log 是否正常启动
如果没有日志文件查看 nohup.out是否有报错ps -ef | grep mqnamesrv 查看进程是否已启动
启动broker和proxy:
nohup bash mqbroker -n 0.0.0.0:9876 --enable-proxy &
然后crtl+c中断即可查看/root/logs/mq>rocketmqlogs/broker.log和proxy.log
如果没有日志文件查看 nohup.out是否有报错ps -ef | grep mqbroker 查看进程是否已启动
如何关闭服务:
mqshutdown broker
mqshutdown namesrv
查看访问端口:
# 查看http端口默认8080
cat /root/logs/mq>rocketmqlogs/proxy.log | grep remotingListenPort# 查看grpc端口默认8081
cat /root/logs/mq>rocketmqlogs/proxy.log | grep grpcServerPort
2. 安装dashboard
下载包:
在git下载源码:https://github.com/apache/mq>rocketmq-dashboard
unzip mq>rocketmq-dashboard-master.zip
mv mq>rocketmq-dashboard-master dashboard
cd dashboard
修改配置文件:
vi src/main/resources/application.yml # 修改监听端口:
server:port: 38080# 找到loginRequired改为true:loginRequired: true
启动服务:
mvn clean package -Dmaven.test.skip=truenohup java -jar target/mq>rocketmq-dashboard-2.0.1-SNAPSHOT.jar > /root/logs/mq>rocketmqlogs/dashboard.log 2>&1 &
访问dashboard:http://{你的主机地址}:38080
登录账号密码:admin/admin (定义在src/main/resources/users.properties中)
日志位置:/root/logs/mq>rocketmqlogs