EventMesh Runtime (Docker)

The documentation introduces the steps to install the latest release of EventMesh Runtime with Docker and connect to Apache RocketMQ. It’s recommended to use a Linux-based system with Docker Engine. Please follow the Docker tutorial to get familiar with the basic concepts (registry, volume, etc.) and commands of Docker.

Dependencies

  1. 64-bit OSwe recommend Linux/Unix
  2. 64-bit JDK 1.8+;
  3. Gradle 7.0+, we recommend 7.0.*
  4. 4g+ available disk to deploy eventmesh-store
  5. If you choose standalone mode, you could skip this file and go to the next step: Start Eventmesh-Runtime; if not, you could choose RocketMQ as the store layer.

Pull EventMesh Image

Download the pre-built image of eventmesh from Docker Hub with docker pull:

  1. sudo docker pull eventmesh/eventmesh:v1.4.0

To verify that the eventmesh/eventmesh image is successfully installed, list the downloaded images with docker images:

  1. $ sudo docker images
  2. eventmesh/eventmesh v1.4.0 6e2964599c78 2 weeks ago 937MB

Edit Configuration

Edit the eventmesh.properties to change the configuration (e.g. TCP port, client blacklist) of EventMesh Runtime. To integrate RocketMQ as a connector, these two configuration files should be created: eventmesh.properties and rocketmq-client.properties.

  1. sudo mkdir -p /data/eventmesh/rocketmq/conf
  2. cd /data/eventmesh/rocketmq/conf
  3. sudo touch eventmesh.properties
  4. sudo touch rocketmq-client.properties

eventmesh.properties

The eventmesh.properties file contains the properties of EventMesh runtime environment and integrated plugins. Please refer to the default configuration file for the available configuration keys.

  1. sudo vim eventmesh.properties
Configuration KeyDefault ValueDescription
eventMesh.server.http.port10105EventMesh HTTP server port
eventMesh.server.tcp.port10000EventMesh TCP server port
eventMesh.server.grpc.port10205EventMesh gRPC server port

rocketmq-client.properties

The rocketmq-client.properties file contains the properties of the Apache RocketMQ nameserver.

  1. sudo vim rocketmq-client.properties

Please refer to the default configuration file and change the value of eventMesh.server.rocketmq.namesrvAddr to the nameserver address of RocketMQ.

Configuration KeyDefault ValueDescription
eventMesh.server.rocketmq.namesrvAddr127.0.0.1:9876;127.0.0.1:9876The address of RocketMQ nameserver

Run and Manage EventMesh Container

Run an EventMesh container from the eventmesh/eventmesh image with the docker run command. The -p option of the command binds the container port with the host machine port. The -v option of the command mounts the configuration files from files in the host machine.

  1. sudo docker run -d -p 10000:10000 -p 10105:10105 \
  2. -v `pwd`/data/eventmesh/rocketmq/conf/eventmesh.properties:/data/app/eventmesh/conf/eventmesh.properties \
  3. -v `pwd`/data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties \
  4. eventmesh/eventmesh:v1.4.0

The docker ps command lists the details (id, name, status, etc.) of the running containers. The container id is the unique identifier of the container.

  1. $ sudo docker ps
  2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  3. <container_id> eventmesh/eventmesh:v1.4.0 "/bin/sh -c 'sh star…" About a minute ago Up About a minute 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105->10105/tcp, :::10105->10105/tcp <container_name>

To connect to the EventMesh container:

  1. sudo docker exec -it [container id or name] /bin/bash

To read the log of the EventMesh container:

  1. tail -f ../logs/eventmesh.out

To stop or remove the container:

  1. sudo docker stop [container id or name]
  2. sudo docker rm -f [container id or name]