0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
$ wget http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.tar.gz $ wget http://mirrors.cnnic.cn/apache/tomcat/tomcat-8/v8.0.35/bin/apache-tomcat-8.0.35.tar.gz $ tar zxf jdk-8u92-linux-x64.tar.gz $ mv jdk1.8.0_92/ /byrd/service/ $ ln -s /byrd/service/jdk1.8.0_92/ /usr/local/jdk $ export JAVA_HOME=/usr/local/jdk $ export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH $ export CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar $ wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz $ tar zxf apache-maven-3.6.0-bin.tar.gz $ mv apache-maven-3.6.0 /opt/ $ ln -s /opt/apache-maven-3.6.0 /usr/local/maven $ echo "export PATH=/usr/local/maven/bin:$PATH" >> /etc/profile $ source /etc/profile $ wget http://mirrors.tuna.tsinghua.edu.cn/apache/rocketmq/4.3.1/rocketmq-all-4.3.1-source-release.zip $ unzip rocketmq-all-4.3.1-source-release.zip $ cd rocketmq-all-4.3.1 $ mvn -Prelease-all -DskipTests clean install -U $ cp -ap distribution/target/apache-rocketmq /opt/ $ ln -s /opt/apache-rocketmq/ /usr/local/rocketmq $ vi runbroker.sh JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn256m" JAVA_OPT="${JAVA_OPT} -XX:MaxDirectMemorySize=256m" $ vi runserver.sh JAVA_OPT="${JAVA_OPT} -server -Xms128m -Xmx128m -Xmn128m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m" $ nohup sh /usr/local/rocketmq/bin/mqnamesrv >/tmp/mqnamesrv.log 2>&1 & $ nohup sh /usr/local/rocketmq/bin/mqbroker -n localhost:9876 >/tmp/broker.log 2>&1 & $ wget https://github.com/apache/rocketmq-externals/archive/master.zip $ cd rocketmq-externals-master/rocketmq-console/ $ mvn clean package -Dmaven.test.skip=true #mvn clean -DskipTests package $ java -jar /byrd/tools/rocketmq-externals-master/rocketmq-console/target/rocketmq-console-ng-1.0.0.jar --server.port=8889 --rocketmq.config.namesrvAddr=192.168.190.102 $ nohup java -jar target/rocketmq-console-ng-1.0.0.jar >>/tmp/l.log |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
$ sh /usr/local/rocketmq/bin/mqbroker -m > broker_A.properties $ mv broker_A.properties /usr/local/rocketmq/etc/broker-a-m.properties $ nohup sh /usr/local/rocketmq/bin/mqnamesrv >/tmp/mqnamesrv.log 2>&1 & $ netstat -tunlp | grep 9876 tcp6 0 0 :::9876 :::* LISTEN 1211/java $ nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/etc/broker-a-m.properties >/tmp/broker-a-m.log 2>&1 & $ netstat -tunlp | grep 10911 tcp6 0 0 :::10911 :::* LISTEN 1241/java $ nohup sh /usr/local/rocketmq/bin/mqbroker -c /usr/local/rocketmq/etc/broker-c-s.properties >/tmp/broker-c-s.log 2>&1 & $ netstat -tunlp | grep 10921 tcp6 0 0 :::10921 :::* LISTEN 1313/java $ mqadmin clusterList -n 192.168.190.102:9876 #Cluster Name #Broker Name #BID #Addr #Version #InTPS(LOAD) #OutTPS(LOAD) #PCWait(ms) #Hour #SPACE DefaultCluster broker-A 0 192.168.190.102:10911 V4_3_1 0.00(0,0ms) 0.00(0,0ms) 0 428272.71 -1.0000 DefaultCluster broker-A 10 192.168.190.102:10921 V4_3_1 0.00(0,0ms) 0.00(0,0ms) 0 428272.71 0.0050 # cat /usr/local/rocketmq/etc/broker-a-m.properties listenPort=10911 namesrvAddr=192.168.190.102:9876 brokerIP1=192.168.190.102 brokerName=broker-A brokerClusterName=DefaultCluster brokerId=0 autoCreateTopicEnable=true autoCreateSubscriptionGroup=true rejectTransactionMessage=false fetchNamesrvAddrByAddressServer=false transactionTimeOut=6000 transactionCheckMax=15 transactionCheckInterval=60000 storePathRootDir=/data/rocketmq/store-a-m/ storePathCommitLog=/data/rocketmq/store-a-m/commitlog flushIntervalCommitLog=500 commitIntervalCommitLog=200 flushCommitLogTimed=false deleteWhen=04 fileReservedTime=72 maxTransferBytesOnMessageInMemory=262144 maxTransferCountOnMessageInMemory=32 maxTransferBytesOnMessageInDisk=65536 maxTransferCountOnMessageInDisk=8 accessMessageInMemoryMaxRatio=40 messageIndexEnable=true messageIndexSafe=false haMasterAddress= brokerRole=ASYNC_MASTER flushDiskType=ASYNC_FLUSH cleanFileForciblyEnable=true transientStorePoolEnable=false $ diff * 1c1 < listenPort=10911 --- > listenPort=10921 6c6 < brokerId=0 --- > brokerId=10 14,15c14,15 < storePathRootDir=/data/rocketmq/store-a-m/ < storePathCommitLog=/data/rocketmq/store-a-m/commitlog --- > storePathRootDir=/data/rocketmq/store-c-s/ > storePathCommitLog=/data/rocketmq/store-c-s/commitlog 29c29 < brokerRole=ASYNC_MASTER --- > brokerRole=SLAVE |
参考文档:
0:https://github.com/apache/rocketmq
1:https://www.cnblogs.com/freeweb/p/7817968.html
2:https://blog.csdn.net/qq_39291929/article/details/78896666
3:https://blog.csdn.net/tzs_1041218129/article/details/79296633
4:https://blog.csdn.net/walle167/article/details/70242931
5:https://blog.csdn.net/qq_30756815/article/details/80533088
6: https://blog.csdn.net/qq_34021712/article/details/78162625
7: https://blog.csdn.net/baidu_27622303/article/details/80558918
8: https://blog.csdn.net/kevin3101/article/details/52947840
9: https://www.cnblogs.com/quchunhui/p/7126868.htmlSourceByrd's Weblog-https://note.t4x.org/basic/rocketmq-config-install/
SourceByrd's Weblog-https://note.t4x.org/basic/rocketmq-config-install/