# cat /usr/local/rocketmq-all-4.5.2-bin-release/conf/2m-noslave/broker-a.properties # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. brokerClusterName=rocketmq-Cluster brokerName=broker-a brokerId=0 namesrvAddr=172.17.4.20:9876;172.17.4.21:9876;172.17.4.22:9876 defaultTopicQueueNums=6 autoCreateTopicEnable=true autoCreateSubscriptionGroup=true listenPort=10911 deleteWhen=04 fileReservedTime=24 storePathRootDir=/data/rocketmq/store storePathCommitLog=/data/rocketmq/store/commitlog storePathConsumeQueue=/data/rocketmq/store/consumequeue storePathIndex=/data/rocketmq/store/index storeCheckpoint=/data/rocketmq/store/checkpoint abortFile=/data/rocketmq/store/abort brokerRole=ASYNC_MASTER flushDiskType=ASYNC_FLUSH messageDelayLevel=1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h maxTransferCountOnMessageInMemory=400 #发送消息的最大线程数 sendMessageThreadPoolNums=32 #large thread numbers #发送消息是否使用可重入锁 useReentrantLockWhenPutMessage=true waitTimeMillsInSendQueue=1000 transientStorePoolEnable=true transientStorePoolSize=5
根据实例配置调整内存:
1 2
vim /usr/local/rocketmq-all-4.5.2-bin-release/bin/runbroker.sh JAVA_OPT="${JAVA_OPT} -server -Xms4g -Xmx4g -Xmn2g"
启动服务顺序: 先启动nameserver再启动broker,停止服务时顺序也一样
启动nameserver:
1 2
# cat /home/david/start_mqnamesrv.sh nohup sh /usr/local/rocketmq-all-4.5.2-bin-release/bin/mqnamesrv > /dev/null2>&1 &