Centos7 installation RocketMQ4.4

Online tutorials pit chicken thief and more children

First, install maven
RocketMQ rely maven package, so first maven installed in a virtual machine, I am using v3.3.9.
1: Go to the specified directory download maven package

1 cd /usr/local
2  
3 wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

2: Extract and rename the folder

1 tar -zxvf apache-maven-3.3.9-bin.tar.gz 
2 
3 mv apache-maven-3.3.9 /usr/local/maven3

3: Modify the warehouse address is Ali cloud, does not modify the download time rely reported total overtime

1 cd /usr/local/maven3/conf
2 
3 vim settings.xml

Add the center-position <mirror> tag (default annotation)

1 <mirror>
2       <id>alimaven</id>
3       <name>aliyun maven</name>
4       <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
5       <mirrorOf>central</mirrorOf>       
6 </mirror>

4: configuration environment variable

1 vim /etc/profile

Add maven_home

1 export M2_HOME=/usr/local/maven3
2 export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin

5: Saving Exit (shift + zz) refresh configuration file to take effect

1 source /etc/profile

6: Checking the installation results

mvn -v

Second, the installation RocketMQ
1: Download the source zip archive, the official website offers five mirror download link, a recommendation mirroring link, extract it to / usr / local / under after two PGP signature, and the two backups, download, then delete the zip file

1 cd /usr/local
2 
3 wget http://mirrors.tuna.tsinghua.edu.cn/apache/rocketmq/4.4.0/rocketmq-all-4.4.0-source-release.zip
4 
5 unzip -d /usr/local/ rocketmq-all-4.4.0-source-release.zip
6 
7 rm -rf rocketmq-all-4.4.0-source-release.zip

2: Use maven package, this fight for a long time

1 cd /usr/local/rocketmq-all-4.4.0/
2 
3 mvn -Prelease-all -DskipTests clean install -U

3: RocketMQserver default initial memory, maximum memory is 4g, the new generation of memory is 2g, broker is 8g, 8g, 4g, my notebook four virtual machines per cluster is 1g, so the need piecemeal point, the trigger fullGC threshold values ​​can be changed. Modify JAVA_OPT = "$ {JAVA_OPT} -server line parameters according to individual circumstances

1 vim distribution/target/apache-rocketmq/bin/runserver.sh
2 vim distribution/target/apache-rocketmq/bin/runbroker.sh

4: Add the nameserver address to the environment variable

. 1 Vim / etc / Profile
 2  
. 3 Export NAMESRV_ADDR = 127.0 . 0.1 : 9876 
. 4  
. 5  # refresh profile
 . 6 Source / etc / Profile

5: running in the background nameserver, the logs redirected to the specified file

1 nohup SH mqnamesrv> /usr/local/rocketdata/namesrv.log 2 > & 1 &
 2  
3  # view the boot log
 4  tail -f /usr/local/rocketdata/namesrv.log

Run broker

1 nohup SH mqbroker> /usr/local/rocketdata/broker.log 2 > & 1 &
 2  
3  # view the boot log
 4  tail -f /usr/local/rocketdata/broker.log

6: The newly opened window, a production and a consumer, the consumer test. Warnings ignored

1  # Window 1
 2  SH Tools. SH org.apache.rocketmq.example.quickstart.Producer
 . 3  # window 2
 . 4  SH Tools. SH org.apache.rocketmq.example.quickstart.Consumer

Third, the console is installed
1: Because the console source on github, git me here to install the virtual, the source code directly down, because console is springboot project, you can also modify the configuration file downloaded to the local package, will kick pass jar package to a virtual machine.

1  # installed with yum Git
 2  yum  the install Git

2: into the / usr / local

git clone https://github.com/apache/rocketmq-externals

3: rocketmq-externals there are all Apache RocketMq external projects, and some are still in the incubator, I mainly use rocketmq-console, console into the project, the resources folder modify the following configuration file

. 1 CD / usr / local / rocketmq-externals / rocketmq-Console / the src / main / Resources
 2  
. 3  # View profile name
 . 4  LL
 . 5  
. 6  # open profile
 . 7 Vim the application.properties

Modify the following configurations:

1  # service port number
 2 the server.port = 8090 
. 3  #nameserver service address
 . 4 rocketmq.config.namesrvAddr = 127.0 . 0.1 : 9876 
. 5 #rocketmq data path, since the use of contact, are placed usr / local down
 . 6 rocketmq.config .dataPath = / usr / local / rocketdata / console

4: Normal package maven project

# Packaged and to skip the test 
mvn Clean the install -Dmaven.test.skip = to true

5: back to start, redirect the log file

1 nohup java -jar rocketmq-console-ng-1.0.1.jar > /usr/local/rocketdata/console/console.out 2>&1&

6: After starting a successful visit in the machine ip + port into the console













 

Guess you like

Origin www.cnblogs.com/xiaohong0128/p/11440726.html