系统相关
首页 > 系统相关> > Linux安装rocketmq

Linux安装rocketmq

作者:互联网

#1.下载rocketmq安装包
    wget https://github.com/apache/rocketmq/archive/rocketmq-all-4.7.1.tar.gz
#2.解压
    tar -zxvf rocketmq-all-4.7.1.tar.gz
#3.将解压包拷贝到指定目录
    mv rocketmq-rocketmq-all-4.7.1  /data/local/rocketmq
#4.安装maven插件
    #下载安装包
    wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
    #解压
    tar -zxvf apache-maven-3.6.3-bin.tar.gz
    #将解压包拷贝到指定目录
    mv apache-maven-3.6.3  /data/local/maven
    #新增maven镜像
    vim /data/local/apache-maven-3.6.3/conf/setting.xml 
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
#5.配置环境变量
    #修改/etc/profile文件
    vi /etc/profile
    #最后一行添加
    export PATH=$PATH:/data/local/maven/bin
    #使配置文件生效:
    source /etc/profile
#6.编译rocketmq
    在rocketmq目录下执行 mvn -Prelease-all -DskipTests clean install -U
    mkdir logs
#7.启动rocketmq
    cd /data/local/rocketmq/distribution/target/rocketmq-4.7.1/rocketmq-4.7.1/bin
    #启动 nameserver 
    nohup sh mqnamesrv >/data/local/rocketmq/logs/mqnamesrv.log 2>&1 &
    #启动 nameserver 
    nohup sh mqbroker -n localhost:9876 >/data/local/rocketmq/logs/broker.log 2>&1 &
    #查看rocketmq服务
    ps aux|grep rocketmq
#8.关闭rocketmq
    cd /data/local/rocketmq/distribution/target/rocketmq-4.7.1/rocketmq-4.7.1
    #停止 broker
    sh bin/mqshutdown broker  
    #停止 nameserver 
    sh bin/mqshutdown namesrv

标签:bin,4.7,安装,data,maven,Linux,local,rocketmq
来源: https://blog.csdn.net/qq_38410795/article/details/122110799