# rocketmq部署

### 环境

* Ubuntu 18.04
* Maven 3.6.0

### 部署步骤

* 下载源码

  ```shell
  cd /root/roketmq
  wget http://mirrors.tuna.tsinghua.edu.cn/apache/rocketmq/4.4.0/rocketmq-all-4.4.0-source-release.zip
  ```

* 编译安装

  ```shell
  unzip rocketmq-all-4.4.0-source-release.zip
  cd rocketmq-all-4.4.0/
  mvn -Prelease-all -DskipTests clean install -U
  ```

* Name Server 启动

  ```shell
  cd distribution/target/apache-rocketmq
  nohup sh bin/mqnamesrv &
  tail -f ~/logs/rocketmqlogs/namesrv.log
  ```

* Broker 启动

  ```shell
  cd distribution/target/apache-rocketmq
  nohup sh bin/mqbroker -n localhost:9876 -c /root/roketmq/rocketmq-all-4.4.0/distribution/conf/broker.conf autoCreateTopicEnable=true &
  tail -f ~/logs/rocketmqlogs/broker.log
  ```

* web控制台安装

  1. 下载开源的rocketmq-externals项目

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

  2. 修改项目里application.properties的rocketmq.config.namesrvAddr配置

     ```shell
     rocketmq.config.namesrvAddr=127.0.0.1:9876
     ```

  3. 项目打包

     ```shell
     mvn clean package -Dmaven.test.skip=true
     ```

  4. 运行jar包

     ```shell
     java -jar rocketmq-console-ng-1.0.0.jar --server.port=12345 --rocketmq.config.namesrvAddr=127.0.0.1:9876
     ```

     