# 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
  ```

  