Deployment process

preparation

Local environment: macOS 10.14.6 Docker

1. Pull the official image
docker pull rocketmqinc/rocketmq
Copy the code

You can see the corresponding mirror image after successfully pulling:

2. Run the Docker container

Running nameserver.

docker run -d -p 9876:9876 -v `pwd`/data/namesrv/logs:/root/logs -v `pwd`/data/namesrv/store:/root/store --name rmqnamesrv  rocketmqinc/rocketmq sh mqnamesrv
Copy the code

Run the broker:

docker run -d -p 10911:10911 -p 10909:10909 -v `pwd`/data/broker/logs:/root/logs -v `pwd`/data/broker/store:/root/store --name rmqbroker --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" rocketmqinc/rocketmq sh mqbroker -c The/opt/rocketmq - 4.4.0 / conf/broker. ConfCopy the code

Note:

  1. /opt/ Rocketmq-4.4.0 /conf/broker.conf is the path to the configuration file in the container
  2. To prevent ports from becoming inaccessible, remember to turn off the firewall
  3. The cluster address of a docker broker is the IP address of the Docker by default. The IP address of the docker broker cannot be accessed from the external network. For details, see the following.

Note 3 Operation process:

  1. Go to the container and modify the configuration file
Docker exec -it broker id /bin/sh: vi /opt/ Rocketmq-4.4.0 /conf/broker.conf Add brokerIP1 property to broker. BrokerIP1 = Save and exit when the external IP address of the machine is changedCopy the code
  1. Restart the container
Docker container restart broker container ID // Note: Run -c /opt/ Rocketmq-4.4.0 /conf/brokerCopy the code

At this point, RocketMQ’s Nameserver and Broker are deployed locally

3. Deploy a visual interface

1. Pull the RocketMQ-Console image

docker pull styletang/rocketmq-console-ng
Copy the code

2. Run rocketmq – the console

Docker run - e "JAVA_OPTS = - Drocketmq. Namesrv. IP addr = this closed network: 9876 - Dcom. Rocketmq. SendMessageWithVIPChannel = false" -p 8001:8080 -t styletang/rocketmq-console-ngCopy the code

3. View the home pagehttp://localhost:8001