Detailed installation and use of RocketMQ in Docker

Detailed installation and use of RocketMQ in Docker

To search for RocketMQ images, you can search on Docker's hub.docker.com, or you can search through Docker's search command in Linux. However, after the recent firewall upgrade, foreign websites are opened very slowly. It is more convenient to search through commands. To operate Docker commands, you must be the root user or a user with root privileges. The query operation is as follows:

docker search rocketmq

The following results can be obtained:

There are quite a lot of images, but none of them are officially released. I will just pick one, such as foxiswho/rocketmq. The following is a shell command to view all versions of the current image:

curl https://registry.hub.docker.com/v1/repositories/foxiswho/rocketmq/tags\
| tr -d '[\[\]" ]' | tr '}' '\n'\
| awk -F: -v image='foxiswho/rocketmq' '{if(NR!=NF && $3 != ""){printf("%s:%s\n",image,$3)}}'

If you want to view other images, just replace the image name foxiswho/rocketmq with other images. Execute the command to get the following results:

The following is to start the nameserver and broker step by step.

Start the NameServer:

docker run -d -p 9876:9876 --name rmqserver foxiswho/rocketmq:server-4.5.1

Start the broker:

docker run -d -p 10911:10911 -p 10909:10909\
 --name rmqbroker --link rmqserver:namesrv\
 -e "NAMESRV_ADDR=namesrv:9876" -e "JAVA_OPTS=-Duser.home=/opt"\
 -e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m"\
 foxiswho/rocketmq:broker-4.5.1

The default configuration file path in the Broker container is:

/etc/rocketmq/broker.conf

You can also specify the local configuration file through the -v parameter:

docker run -d -p 10911:10911 -p 10909:10909\
 --name rmqbroker --link rmqserver:namesrv\
 -e "NAMESRV_ADDR=namesrv:9876" -e "JAVA_OPTS=-Duser.home=/opt"\
 -e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m"\
 -v /conf/broker.conf:/etc/rocketmq/broker.conf \
 foxiswho/rocketmq:broker-4.5.1

If everything goes well, NameServer and Broker will be installed in a short while. For the convenience of management, rocketmq console is also an indispensable tool. Find the version to be started through the above query method. The startup method is as follows:

docker run -d --name rmqconsole -p 8180:8080 --link rmqserver:namesrv\
 -e "JAVA_OPTS=-Drocketmq.namesrv.addr=namesrv:9876\
 -Dcom.rocketmq.sendMessageWithVIPChannel=false"\
 -t styletang/rocketmq-console-ng

Then check the startup status with the following command:

docker ps | grep rocketmq

The results are as follows:

Then access localhost:8180 through the browser, the console page is displayed as follows:

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Implementation steps for installing RocketMQ in docker
  • A very detailed tutorial on installing rocketmq under Docker Desktop
  • Docker installation rocketMQ tutorial (most detailed)
  • Docker installation of RocketMQ and solutions to problems encountered during installation

<<:  Four solutions for using setTimeout in JS for loop

>>:  Detailed explanation of the my.ini Chinese configuration scheme for MySql optimization: InnoDB, 4GB memory, and multiple queries

Recommend

Mysql NULL caused the pit

Using NULL in comparison operators mysql> sele...

SQL insert into statement writing method explanation

Method 1: INSERT INTO t1(field1,field2) VALUE(v00...

Installation tutorial of MySQL 5.7 green version under windows2008 64-bit system

Preface This article introduces the installation ...

HTML simple web form creation example introduction

<input> is used to collect user information ...

Organize the common knowledge points of CocosCreator

Table of contents 1. Scene loading 2. Find Node 1...

CSS pixels and solutions to different mobile screen adaptation issues

Pixel Resolution What we usually call monitor res...

Detailed explanation of angular parent-child component communication

Table of contents APIs used Simple Example person...

6 Practical Tips for TypeScript Development

Table of contents 1. Determine the entity type be...

Using radial gradient in CSS to achieve card effect

A few days ago, a colleague received a points mal...

43 Web Design Mistakes Web Designers Should Watch Out For

This is an article about website usability. The a...

Setting up VMware vSphere in VMware Workstation (Graphic Tutorial)

VMware vSphere is the industry's leading and ...

Two methods of implementing automatic paging in Vue page printing

This article example shares the specific code of ...