软件环境:
centos7.6
jdk1.8
maven3
rocketmq4.2.0
安装unzip zip命令
yum install -y unzip zip
查看下载地址
http://rocketmq.apache.org/dowloading/releases/
下载到/usr/local/software目录
cd /usr/local/software
wget http://mirrors.hust.edu.cn/apache/rocketmq/4.2.0/rocketmq-all-4.2.0-bin-release.zip
unzip -d /usr/local/software/rocketmq rocketmq-all-4.2.0-bin-release.zip
进入rocketmq的bin目录
cd /usr/local/software/rocketmq/bin
由于rocketmq默认配置的jvm内存参数比较高,需根据实际调整进行编辑调整
修改runserver.sh调整如下
JAVA_OPT="${JAVA_OPT} -server -xms256m -Xmx256m -Xmn128m -XX:PermSize=128m -XX:MaxPermSize=320m"
修改runbroker.sh调整如下
JAVA_OPT="${JAVA_OPT} -server -xms256m -Xmx256m -Xmn128m
启动nameServer
nohup sh mqnamesrv &
查看启动日志能看到:The name Server boot success字样则成功
tail -f ~/logs/rocketmqlogs/namesrv.log
启动broker
注意ip地址要配置成为实际服务的ip地址,保证地址以及端口能够访问
nohup sh mqbroker -n "localhost:9876" -c ../conf/broker.conf > broker.out &
查看启动日志
tail -f ~/logs/rocketmqlogs/broker.log
停止broker
sh mqshutdown broker
停止nameServer
sh mqshutdown namesrv
开放指定端口
firewall-cmd --zone=public --add-port=9876/tcp --permanent
firewall-cmd --reload
安装配置rocketmq-console控制台
下载地址
https://github.com/apache/rocketmq-externals
cd /usr/local/software
直接去下载压缩包
wget https://github.com/apache/rocketmq-externals/archive/rocketmq-console-1.0.0.tar.gz
tar -zxvf rocketmq-console-1.0.0.tar.gz
进入rocketmq-console目录
修改配置
vim src/main/resources/application.propertIEs
修改web访问端口
server.port=8181
name Server地址,修改成你自己的服务地址,多个分号隔开
rocketmq.config.namesrvAddr=localhost:9876
server.contextpath=/server.port=8181#spring.application.index=truespring.application.name=rocketmq-consolespring.http.enCoding.charset=UTF-8spring.http.enCoding.enabled=truespring.http.enCoding.force=truelogging.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:9876rocketmq.config.namesrvAddr=localhost:9876#if you use rocketmq version < 3.5.8,rocketmq.config.isVIPChannel should be false.default truerocketmq.config.isVIPChannel=true#rocketmq-console‘s data path:dashboard/monitorrocketmq.config.dataPath=/tmp/rocketmq-console/data#set it false if you don‘t want use dashboard.default truerocketmq.config.enableDashBoardCollect=true
进入rocketmq-console目录
mvn clean package -Dmaven.test.skip=true
执行完成,会多出一个target目录。在target下生成了需要运行的jar包
开放指定端口
firewall-cmd --zone=public --add-port=8181/tcp --permanent
firewall-cmd --reload
nohup java -jar target/rocketmq-console-ng-1.0.0.jar >> rocketmq-console.log 2>&1 &
启动后访问http://ip:刚刚设置的端口
总结以上是内存溢出为你收集整理的Linux下安装RocketMQ(单Master)全部内容,希望文章能够帮你解决Linux下安装RocketMQ(单Master)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)