Centos下RocketMQ单节点安装

环境:Centos7.2 8G 4核 ;JDK1.8 ;Maven:3.6.0 ;RocketMQ:4.3.2

1、java安装 jdk-8u191-linux-x64.tar.gz

2、maven安装 apache-maven-3.6.0-bin.tar.gz

[root@RocketMQmaster ~]# mkdir /usr/local/mvn
[root@RocketMQmaster ~]# tar -zxvf apache-maven-3.6.0-bin.tar.gz -C /usr/local/mvn
[root@RocketMQmaster ~]# vi /etc/profile
    export JAVA_HOME=/usr/java/jdk1.8.0_191
    export JRE_HOME=${JAVA_HOME}/jre
    export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
    export MAVEN_HOME=/usr/local/mvn/apache-maven-3.6.0
    export PATH=${JAVA_HOME}/bin:${MAVEN_HOME}/bin:$PATH
[root@RocketMQmaster ~]# source /etc/profile

3、RocketMQ安装 
    1)二进制安装 下载地址 http://rocketmq.apache.org/release_notes/release-notes-4.3.2/
    rocketmq-all-4.3.2-bin-release.zip
    [root@RocketMQmaster ~]# mv rocketmq-all-4.3.2-bin-release.zip /usr/rocketmq/
    进入/usr/rocketmq/
    [root@RocketMQmaster rocketmq]# unzip rocketmq-all-4.3.2-bin-release.zip
    if ->    -bash: unzip: command not found 
    [root@RocketMQmaster rocketmq]# yum install -y unzip zip

    2)源码安装 下载地址 https://www.apache.org/dyn/closer.cgi?path=rocketmq/4.3.2/rocketmq-all-4.3.2-source-release.zip
    unzip rocketmq-all-4.3.2-source-release.zip
    进入解压路径下
    mvn -Prelease-all -DskipTests clean install -U

RocketMQ单节点启动(这里是源码安装)
cd /usr/rocketMQ/rocketmq-all-4.3.2/distribution/target/apache-rocketmq
namesrv启动
nohup sh bin/mqnamesrv & tail -f ~/logs/rocketmqlogs/namesrv.log
broker启动
nohup sh bin/mqbroker -n localhost:9876 autoCreateTopicEnable=true & tail -f ~/logs/rocketmqlogs/broker.log

停止
sh bin/mqshutdown broker
sh bin/mqshutdown namesrv

你可能感兴趣的:(RocketMQ)