1. 安装jdk和maven
yum install java-1.8.0-openjdk
yum install java-1.8.0-openjdk-devel.x86_64
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
yum -y install apache-maven
查找maven安装路径
1)查找包路径
rpm -qa|grep apache-maven
2)根据包路径查找安装目录
rpm -ql apache-maven-3.5.2-1.el7.noarch
在搜索结果中就有maven的安装目录。
配置文件路径
/etc/maven/settings.xml
2. 配置JAVA_HOME
由于与ES环境冲突,配置改为JAVA8_HOME
vi /etc/profile.d/java8.sh
增加如下内容
export JAVA8_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64
export JRE_HOME=$JAVA8_HOME/jre
export ROCKETMQ_HOME=/usr/local/rocketmq
export PATH=$ROCKETMQ_HOME/bin:$PATH
查找openjdk的安装位置
# rpm -qa | grep openjdk
java-1.8.0-openjdk-headless-1.8.0.272.b10-1.el7_9.x86_64
java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64
(root@oif-odb11 2021-09-24 15:25:12 ~)
# rpm -ql java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64/jre/bin/policytool
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64/jre/lib/amd64/libawt_xawt.so
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64/jre/lib/amd64/libjawt.so
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64/jre/lib/amd64/libjsoundalsa.so
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64/jre/lib/amd64/libsplashscreen.so
/usr/share/applications/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64-policytool.desktop
/usr/share/icons/hicolor/16x16/apps/java-1.8.0-openjdk.png
/usr/share/icons/hicolor/24x24/apps/java-1.8.0-openjdk.png
/usr/share/icons/hicolor/32x32/apps/java-1.8.0-openjdk.png
/usr/share/icons/hicolor/48x48/apps/java-1.8.0-openjdk.png
3. 部署rocketmq
修改内核参数:根据 /usr/local/rocketmq/bin/os.sh 文件中的参数修改
vim /etc/sysctl.conf
vm.drop_caches = 1
vm.zone_reclaim_mode = 0
vm.max_map_count = 655360
vm.dirty_background_ratio = 50
vm.dirty_ratio = 50
vm.dirty_writeback_centisecs = 360000
vm.page-cluster = 3
echo 'ulimit -n 655350' >> /etc/profile
echo '* hard nofile 655350' >> /etc/security/limits.conf
echo '* hard memlock unlimited' >> /etc/security/limits.conf
echo '* soft memlock unlimited' >> /etc/security/limits.conf
cat /sys/block/sda/queue/scheduler
cat /sys/block/sdb/queue/scheduler
1.下载rocketmq
下载地址:http://rocketmq.apache.org/dowloading/releases/
快速开始:http://rocketmq.apache.org/docs/quick-start/
2.把压缩包放入到/usr/local目录
解压:tar zxvf rocketmq-rocketmq-all-4.5.2.tar.gz
mv rocketmq-rocketmq-all-4.5.2 /usr/local/rocketmq-4.5.2
3.进入到解压后的目录:cd /usr/local/rocketmq-4.5.2(文件夹名称可以修改)
4.使用Maven安装:mvn -Prelease-all -DskipTests clean install -U(需要几分钟时间,耐心等待)
5.安装完毕后,查看rocketmq安装后的目录:
/usr/local/rocketmq-4.5.2/distribution/target/rocketmq-4.5.2/rocketmq-4.5.2,表明安装成功
6.建立链接
ln -s /usr/local/rocketmq-4.5.2/distribution/target/rocketmq-4.5.2/rocketmq-4.5.2 /usr/local/rocketmq
4. 创建相关目录
4.1 创建四个关键数据文件的存储路径
mkdir /usr/local/rocketmq/store
mkdir /usr/local/rocketmq/store/commitlog
mkdir /usr/local/rocketmq/store/consumequeue
mkdir /usr/local/rocketmq/store/index
4.2 修改日志配置文件并作文件的替换
mkdir -p /usr/local/rocketmq/logs
cd /usr/local/rocketmq/conf && sed -i 's#${user.home}#/usr/local/rocketmq#g' *.xml
4.3 修改jvm启动参数
打开/usr/local/rocketmq/bin,找到runserver.sh和runbroker.sh文件,根据自己的内存环境配置
JAVA_OPT="${JAVA_OPT} -server -Xms4g -Xmx4g -Xmn2g"
5. 配置broker的配置文件
5.1 单机模式
在 /usr/local/rocketmq/conf
中新建文件夹1m-noslave
代表一主无从库。
可以从其他文件夹中找到配置文件,拷贝过来做一些修改,如 broker-a.properties
配置详解如下,按需配置;
#所属集群名字
brokerClusterName=rocketmq-cluster
#broker 名字,注意此处不同的配置文件填写的不一样
brokerName=broker-a
#0 表示 Master,>0 表示 Slave
brokerId=0
#nameServer 地址,分号分割
namesrvAddr=rocketmq-nameserver1:9876
#在发送消息时,自动创建服务器不存在的 topic,默认创建的队列数
defaultTopicQueueNums=4
#是否允许 Broker 自动创建 Topic,建议线下开启,线上关闭
autoCreateTopicEnable=true
#是否允许 Broker 自动创建订阅组,建议线下开启,线上关闭
autoCreateSubscriptionGroup=true
#Broker 对外服务的监听端口
listenPort=10911
#删除文件时间点,默认凌晨 4 点
deleteWhen=04
#文件保留时间,默认 48 小时
fileReservedTime=120
#commitLog 每个文件的大小默认 1G
mapedFileSizeCommitLog=1073741824
#ConsumeQueue 每个文件默认存 30W 条,根据业务情况调整
mapedFileSizeConsumeQueue=300000
#destroyMapedFileIntervalForcibly=120000
#redeleteHangedFileInterval=120000
#检测物理文件磁盘空间
diskMaxUsedSpaceRatio=88
#存储路径
storePathRootDir=/usr/local/rocketmq/store
#commitLog 存储路径
storePathCommitLog=/usr/local/rocketmq/store/commitlog
#消费队列存储路径存储路径
storePathConsumeQueue=/usr/local/rocketmq/store/consumequeue
#消息索引存储路径
storePathIndex=/usr/local/rocketmq/store/index
#checkpoint 文件存储路径
storeCheckpoint=/usr/local/rocketmq/store/checkpoint
#abort 文件存储路径
abortFile=/usr/local/rocketmq/store/abort
#限制的消息大小
maxMessageSize=65536
#flushCommitLogLeastPages=4
#flushConsumeQueueLeastPages=2
#flushCommitLogThoroughInterval=10000
#flushConsumeQueueThoroughInterval=60000
#Broker 的角色
#- ASYNC_MASTER 异步复制 Master
#- SYNC_MASTER 同步双写 Master
#- SLAVE
brokerRole=ASYNC_MASTER
#刷盘方式
#- ASYNC_FLUSH 异步刷盘
#- SYNC_FLUSH 同步刷盘
flushDiskType=ASYNC_FLUSH
#checkTransactionMessageEnable=false
#发消息线程池数量
#sendMessageThreadPoolNums=128
#拉消息线程池数量
#pullMessageThreadPoolNums=128
#commitLog每个文件的大小默认1G
mapedFileSizeCommitLog=1073741824
#ConsumeQueue每个文件默认存30W条,根据业务情况调整
mapedFileSizeConsumeQueue=300000
5.2 集群模式(待补充)
odb11 :namesrv1 broker-a broker-b-s
odb12: namesrv2 broker-b broker-a-s
主从关系的确立,需要四个参数即可确立主从关系
#所属集群名字
brokerClusterName=rocketmq-cluster
#broker名字,名字可重复,为了管理,每个master起一个名字,他的slave同他,eg:Amaster叫broker-a,他的slave也叫broker-a
brokerName=broker-b
#0 表示 Master,>0 表示 Slave
brokerId=1
#Broker 的角色
#- ASYNC_MASTER 异步复制Master
#- SYNC_MASTER 同步双写Master
#- SLAVE
brokerRole=SLAVE
# 注意修改
namesrvAddr=10.0.2.117:9876;10.0.2.118:9876
注意事项:
RocketMQ中broker配置brokcerIP1和brokerIP2的作用
brokerIP1 当前broker监听的IP
brokerIP2 存在broker主从时,在broker主节点上配置了brokerIP2的话,broker从节点会连接主节点配置的brokerIP2来同步。
默认不配置brokerIP1和brokerIP2时,都会根据当前网卡选择一个IP使用,当你的机器有多块网卡时,很有可能会有问题。比如,我遇到的问题是我机器上有两个IP,一个公网IP,一个私网IP,结果默认选择的走公网IP,这是不正确的,我期望的是所有业务内部通信都走内网。
————————————————
版权声明:本文为CSDN博主「贾己人」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/jiajiren11/article/details/80528406
启动集群
odb11:
nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/conf/2m-2s-async/broker-a.properties > /dev/null 2>&1 &
nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/conf/2m-2s-async/broker-b-s.properties > /dev/null 2>&1 &
或
nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/conf/2m-2s-async/broker-a.properties -n 10.0.2.117:9876;10.0.2.118:9876 > /dev/null 2>&1 &
nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/conf/2m-2s-async/broker-b-s.properties -n 10.0.2.117:9876;10.0.2.118:9876 > /dev/null 2>&1 &
odb12:
nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/conf/2m-2s-async/broker-b.properties > /dev/null 2>&1 &
nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/conf/2m-2s-async/broker-a-s.properties > /dev/null 2>&1 &
或
nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/conf/2m-2s-async/broker-b.properties -n 10.0.2.117:9876;10.0.2.118:9876 > /dev/null 2>&1 &
nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/conf/2m-2s-async/broker-a-s.properties -n 10.0.2.117:9876;10.0.2.118:9876 > /dev/null 2>&1 &
6. 启动namesrv和broker
# 启动mqnamesrv
nohup sh /usr/local/rocketmq/bin/mqnamesrv > /dev/null 2>&1 &
或者
nohup sh /usr/local/rocketmq/bin/mqnamesrv -c /usr/local/rocketmq/conf/namesrv.properties > /dev/null 2>&1 &
# 启动broker
nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/conf/1m-noslave/broker-a.properties -n 10.0.2.117:9876 > /dev/null 2>&1 &
启动后会在日志文件夹/usr/local/rocketmq/logs/rocketmqlogs中生成文件
7. 验证部署
开启消费者,然后再开启生产者模拟数据
export NAMESRV_ADDR=localhost:9876
sh /usr/local/rocketmq/bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer
sh /usr/local/rocketmq/bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
8. 停止服务命令
cd /usr/local/rocketmq/bin
# 先关闭broker再关闭namesrv
sh mqshutdown broker
sh mqshutdown namesrv
9. 安装rocketmq-console(可选)
rocketmq-console是RocketMQ项目的扩展插件,是一个图形化管理控制台,提供Broker集群状态查看,Topic管理,Producer、Consumer状态展示,消息查询等常用功能,这个功能在安装好RocketMQ后需要额外单独安装、运行。
在本地有git+maven的开发环境可以自行在https://github.com/apache/rocketmq-externals克隆下载项目后,再通过maven打包rocketmq-console,或者可以在服务器上参考如下步骤进行。
在https://github.com/apache/rocketmq-externals页面下载zip包上传至任意一个服务器上。
解压
unzip rocketmq-externals-master.zip
进入rocketmq-console目录
cd rocketmq-externals-master/rocketmq-console/
打包
mvn clean package -Dmaven.test.skip=true
启动
java -jar target/rocketmq-console-ng-1.0.1.jar --rocketmq.config.namesrvAddr='192.168.31.186:9876;192.168.31.231:9876'
10. mqadmin运维指令
https://blog.csdn.net/wulitaot/article/details/79551499
https://blog.51cto.com/u_14900374/2540242
clusterList
1)帮助
./mqadmin clusterList -h
2)查看集群基本信息
./mqadmin clusterList -n nameserver1:9876
3) 查看集群更多信息
./mqadmin clusterList -n nameserver1:9876 -m
4) 查询集群信息,间隔10秒刷新当前信息。
./mqadmin clusterList -n nameserver1:9876 -m -i 10
clusterRT
bug: -s参数必须制定,不指定命令无法执行
1)帮助
./mqadmin clusterRT -h
2)查看指定cluster的的响应时间(每次发一条消息,单条消息大小为10Bytes)
#RT为响应时间(单位为ms),successCount为发送成功的,failCount为发送失败的。
./mqadmin clusterRT -n nameserver1:9876 -c CLUSTERNAME -s 10 -a 1
3)查看指定cluster的的响应时间(每次发5条消息,单条消息大小为100Bytes)
#RT为响应时间(单位为ms),successCount为发送成功的,failCount为发送失败的。
./mqadmin clusterRT -n nameserver1:9876 -c CLUSTERNAME -s 100 -a 5
4)查看指定cluster的的响应时间(每次发5条消息,单条消息大小为100Bytes,间隔10s刷新)
#RT为响应时间(单位为ms),successCount为发送成功的,failCount为发送失败的。
./mqadmin clusterRT -n nameserver1:9876 -c CLUSTERNAME -s 100 -a 5 -i 10
5)以tlog的格式打印数据(-p参数)
./mqadmin clusterRT -n nameserver1:9876 -c QMQ -s 100 -a 5 -i 10 -p true
创建topic
删除topic
mqadmin deleteTopic -c Eeomq-Cluster -n 10.0.2.117:9876 -t BenchmarkTest
11. 压测
# 使用自带的benchmark测试
/usr/local/rocketmq/benchmark/producer.sh
-- 查看帮助
sh producer.sh -h
usage: benchmarkProducer [-h] [-k <arg>] [-n <arg>] [-s <arg>] [-t <arg>] [-w <arg>]
-h,--help Print help
-k,--keyEnable <arg> Message Key Enable, Default: false
-n,--namesrvAddr <arg> Name server address list, eg: 192.168.0.1:9876;192.168.0.2:9876
-s,--messageSize <arg> Message Size, Default: 128
-t,--topic <arg> Topic name, Default: BenchmarkTest
-w,--threadCount <arg> Thread count, Default: 64
12. 清空rocketmq消息方法
- 停止rocketmq
可以使用kill -9 命令强制停止rocketmq进程 - 删除rocketmq日志
rm -rf /root/logs/rocketmqlogs/* - 删除rocketmq中topic等信息
rm -rf /root/store/* - [可选] 手工清空MQ里剩余的topic,示例命令如下:
cd alibaba-rocketmq/bin
sh mqadmin topicList -n 192.168.1.167:9876
sh mqadmin deleteTopic -c HOSTNAME -n 192.168.1.167:9876 -t orderTopic - 重新启动rocketmq
PS:
- 顺序必须是先停止rocketmq,再清空数据;如果顺序错误,可能会导致消息无法正常清除、rocketmq无法启动等问题
- 删除Topic不是必须的,但是删除的时候需要指定 -c,可以用服务器的hostname试试
13. mqadmin命令使用
The most commonly used mqadmin commands are:
updateTopic Update or create topic
deleteTopic Delete topic from broker and NameServer.
updateSubGroup Update or create subscription group
deleteSubGroup Delete subscription group from broker.
updateBrokerConfig Update broker's config
topicRoute Examine topic route info
topicStatus Examine topic Status info
brokerStatus Fetch broker runtime status data
queryMsgById Query Message by Id
queryMsgByKey Query Message by Key
queryMsgByOffset Query Message by offset
printMsg Print Message Detail
producerConnection Query producer's socket connection and client version
consumerConnection Query consumer's socket connection, client version and subscription
consumerProgress Query consumers's progress, speed
consumerStatus Query consumer's internal data structure
cloneGroupOffset clone offset from other group.
clusterList List all of clusters
topicList Fetch all topic list from name server
updateKvConfig Create or update KV config.
deleteKvConfig Delete KV config.
wipeWritePerm Wipe write perm of broker in all name server
resetOffsetByTime Reset consumer offset by timestamp(without client restart).
updateOrderConf Create or update or delete order conf
cleanExpiredCQ Clean expired ConsumeQueue on broker.
startMonitoring Start Monitoring
checkMsg Check Message Store
statsAll Topic and Consumer tps stats
syncDocs Synchronize wiki and issue to github.com
遇到的错误和注意事项
1. 修改namesrv和broker的端口地址
# 1. 修改namesvr的端口
/usr/local/rocketmq/conf文件夹内增加namesrv.properties的配置文件,文件内容只加一行:
listenPort=5432
启动namesvr时指定配置文件
nohup sh /usr/local/rocketmq/bin/mqnamesrv -c /usr/local/rocketmq/conf/namesrv.properties > /dev/null 2>&1 &
# 2. 修改broker的端口号
修改 /usr/local/rocketmq/conf/1m-noslave/briker-a.properties中配置的参数
#Broker 对外服务的监听端口
listenPort=10911
2. org.apache.rocketmq.client.exception.MQClientException: No route info of this topic, TopicTest
参考文章 https://blog.csdn.net/jiangyu1013/article/details/81478754
原因是配置文件中指定了不自动创建topic。为了测试,先打开自动创建topic。
3. No name server address, please set it.
sh /usr/local/rocketmq/bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
11:46:23.581 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
RocketMQLog:WARN No appenders could be found for logger (io.netty.util.internal.PlatformDependent0).
RocketMQLog:WARN Please initialize the logger system properly.
org.apache.rocketmq.client.exception.MQClientException: No name server address, please set it.
See http://rocketmq.apache.org/docs/faq/ for further details.
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:659)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1310)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1256)
at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:339)
at org.apache.rocketmq.example.quickstart.Producer.main(Producer.java:67)
查看broker日志发现走了虚拟ip,需要在broker配置文件中指定brokerip
brokerIP1=10.0.2.117
brokerIP2=10.0.2.117
AsyncProducer No name server address, please set it.
报错log
No name server address, please set it.
原因
List<String> nsList = this.getmQClientFactory().getMQClientAPIImpl().getNameServerAddressList();
if (null == nsList || nsList.isEmpty()) {
throw new MQClientException(
"No name server address, please set it." + FAQUrl.suggestTodo(FAQUrl.NAME_SERVER_ADDR_NOT_EXIST_URL), null).setResponseCode(ClientErrorCode.NO_NAME_SERVER_EXCEPTION);
}
Producer没有配置注册中心地址时报错
解决方式
producer.setNamesrvAddr("localhost:9876");
————————————————
版权声明:本文为CSDN博主「游语」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_26400953/article/details/103035292
https://blog.csdn.net/u014362882/article/details/80422336
4. 根目录下rocketmq_client.log日志位置修改
https://www.cnblogs.com/ucfjepl/p/13903658.html
5. ClusterListSubCommand command failed
mqadmin clusterList -n 10.0.2.117:9876
RocketMQLog:WARN No appenders could be found for logger (io.netty.util.internal.PlatformDependent0).
RocketMQLog:WARN Please initialize the logger system properly.
org.apache.rocketmq.tools.command.SubCommandException: ClusterListSubCommand command failed
at org.apache.rocketmq.tools.command.cluster.ClusterListSubCommand.execute(ClusterListSubCommand.java:93)
at org.apache.rocketmq.tools.command.MQAdminStartup.main0(MQAdminStartup.java:138)
at org.apache.rocketmq.tools.command.MQAdminStartup.main(MQAdminStartup.java:89)
Caused by: org.apache.rocketmq.acl.common.AclException: [10015:signature-failed] unable to calculate a request signature. error=[10015:signature-failed] unable to calculate a request signature. error=Algorithm HmacSHA1 not available
at org.apache.rocketmq.acl.common.AclSigner.signAndBase64Encode(AclSigner.java:84)
at org.apache.rocketmq.acl.common.AclSigner.calSignature(AclSigner.java:73)
at org.apache.rocketmq.acl.common.AclSigner.calSignature(AclSigner.java:68)
at org.apache.rocketmq.acl.common.AclUtils.calSignature(AclUtils.java:68)
at org.apache.rocketmq.acl.common.AclClientRPCHook.doBeforeRequest(AclClientRPCHook.java:44)
at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.doBeforeRpcHooks(NettyRemotingAbstract.java:172)
at org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeSync(NettyRemotingClient.java:370)
at org.apache.rocketmq.client.impl.MQClientAPIImpl.getBrokerClusterInfo(MQClientAPIImpl.java:1299)
at org.apache.rocketmq.tools.admin.DefaultMQAdminExtImpl.examineBrokerClusterInfo(DefaultMQAdminExtImpl.java:299)
at org.apache.rocketmq.tools.admin.DefaultMQAdminExt.examineBrokerClusterInfo(DefaultMQAdminExt.java:245)
at org.apache.rocketmq.tools.command.cluster.ClusterListSubCommand.printClusterBaseInfo(ClusterListSubCommand.java:172)
at org.apache.rocketmq.tools.command.cluster.ClusterListSubCommand.execute(ClusterListSubCommand.java:88)
... 2 more
Caused by: org.apache.rocketmq.acl.common.AclException: [10015:signature-failed] unable to calculate a request signature. error=Algorithm HmacSHA1 not available
at org.apache.rocketmq.acl.common.AclSigner.sign(AclSigner.java:63)
at org.apache.rocketmq.acl.common.AclSigner.signAndBase64Encode(AclSigner.java:79)
... 13 more
Caused by: java.security.NoSuchAlgorithmException: Algorithm HmacSHA1 not available
at javax.crypto.Mac.getInstance(Mac.java:181)
at org.apache.rocketmq.acl.common.AclSigner.sign(AclSigner.java:57)
... 14 more
是因为JAVA_HOME引起的,因为与ES冲突配置了JAVA8_HOME,将tools.sh的JAVA_HOME修改为JAVA8_HOME即可
解决方法:
修改tools.sh内的JAVA配置,添加jre/lib/ext目录
修改:
将:
JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${BASE_DIR}/lib:${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext"
修改成:
JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${BASE_DIR}/lib:${JAVA_HOME}/jre/lib/ext:${JAVA8_HOME}/lib/ext"
sed -i "s/JAVA_HOME/JAVA8_HOME/g" tools.sh
或者:
echo $JAVA8_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64
# export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64
# echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64
6. 查看状态时显示SPACE为-1
[root@glb-odb1 ❗ 2022-06-15 15:03:04 /usr/local/rocketmq/conf/2m-2s-async]
# mqadmin clusterList -n 127.0.0.1:9876
RocketMQLog:WARN No appenders could be found for logger (io.netty.util.internal.PlatformDependent0).
RocketMQLog:WARN Please initialize the logger system properly.
#Cluster Name #Broker Name #BID #Addr #Version #InTPS(LOAD) #OutTPS(LOAD) #PCWait(ms) #Hour #SPACE
rocketmq-oa broker-a 0 172.16.250.225:10911 V4_5_2 0.00(0,0ms) 0.00(0,0ms) 0 843.46 0.4281
rocketmq-oa broker-a 1 172.16.250.226:10911 V4_5_2 0.00(0,0ms) 0.00(0,0ms) 0 843.46 0.3634
rocketmq-oa broker-b 0 172.16.250.226:10921 V4_5_2 0.00(0,0ms) 0.00(0,0ms) 0 459799.05 -1.0000
rocketmq-oa broker-b 1 172.16.250.225:10921 V4_5_2 0.00(0,0ms) 0.00(0,0ms) 0 459799.05 0.4281
经过对比发现broker-b没有自动创建目录
mkdir {commitlog,consumequeue,index}
创建好目录,重新启动即可
评论区