Event Store with Docker

1. Prerequisites

  • 64-bit OS, we recommend Linux/Unix.
  • 4GB+ available disk to deploy Event Store

This document provides an example of deploying it with RocketMQ as Event Store, but you can also choose another Event Store supported by EventMesh. If you choose default standalone mode, you could skip this file and go to the next step: Deploy EventMesh Runtime; if not, you could choose RocketMQ as the store layer.

In a production environment, you should use an Event Store other than standalone to support greater throughput and higher availability.

2. Deploy

2.1 Pull Images

Pull RocketMQ image from Docker Hub:

  1. #Pull rocketmq image
  2. sudo docker pull apache/rocketmq:4.9.4

You can list and view existing local mirrors with the following command:

  1. sudo docker images

If the terminal displays the image information as shown below, the RocketMQ image has been successfully downloaded locally.

  1. REPOSITORY TAG IMAGE ID CREATED SIZE
  2. apache/rocketmq 4.9.4 a2a50ca263c3 13 months ago 548MB

rocketmq_docker_1

2.2 Run Docker

Run namesrv container:

  1. sudo docker run -d -p 9876:9876 \
  2. -v `pwd`/data/namesrv/logs:/root/logs \
  3. -v `pwd`/data/namesrv/store:/root/store \
  4. --name rmqnamesrv \
  5. apache/rocketmq:4.9.4 \
  6. sh mqnamesrv

Run broker container:

  1. sudo docker run -d -p 10911:10911 -p 10909:10909 \
  2. -v `pwd`/data/broker/logs:/root/logs \
  3. -v `pwd`/data/broker/store:/root/store \
  4. --name rmqbroker \
  5. --link rmqnamesrv:namesrv \
  6. -e "NAMESRV_ADDR=namesrv:9876" \
  7. apache/rocketmq:4.9.4 \
  8. sh mqbroker -c ../conf/broker.conf

rocketmq_docker_2

Please note that the rocketmq-broker ip is pod ip. If you want to modify this ip, you can set it your custom value in broker.conf

By now, the deployment of Event Store has finished, please go to the next step: Start EventMesh Runtime Using Docker