One, foreword

1. Main contents of this paper

  • DockerWay to installRocketMQ-Console
  • Source code installationRocketMQ-Console
  • How do I enable login access

2. Introduction to RocketMQ-Console

RocketMQ has an open source project to extend the incubator- RocketMq-Externals, which has a submodule called RocketMq-Console. This is the Management Console project, which provides a visual management tool for RocketMQ. Easy visual operation.

Contains several functions: operation, cockpit, cluster, theme, consumer, producer, message, message trace, Connector, and so on

3. Environmental information of this paper

  • The server
The server The operating system The hardware configuration version instructions
Linux CentOS 7 4C16G A 64 – bit Linux/Unix is recommended for the production environment
  • software
Tools/Environment version instructions
JDK 1.8 The RocketMQ Console requires version 1.7 or later
Git 1.8.3.1 Source installation is required, version is not required
Maven 3.6.3 Source code installation requirements, version is not required

Two, the installation process

1, install,

Rocketmq-console can be installed in two ways:

  • Install by Docker image;

  • Pull the source code from GitHub, compile it, and then start the installation.

Details are as follows:

Using Docker

#Pull the mirror
#You can also package the image by the way of source code, need to have a mirror warehouse, want to know you can take a look at the docker-related article in the public number history article. Run the MVN clean package-dmaven.test. skip= command to open an imagetrue docker:build
$ docker pull styletang/rocketmq-console-ng
#Start, the default port number is port 8080, mapping to the server inside can be changed as required
$ docker run -e "JAVA_OPTS = - Drocketmq. Namesrv. Addr = 127.0.0.1:9876 - Dcom. Rocketmq. SendMessageWithVIPChannel = false" -p 8080:8080 -t styletang/rocketmq-console-ng
Copy the code

Through source code

#Pull code from GitHub
$ git clone https://github.com/apache/rocketmq-externals.git
$ cd rocketmq-console
#Maven packaging
$ mvn clean package -Dmaven.test.skip=true
$Java - jar target/rocketmq - the console - ng - 2.0.0. Jar
Copy the code

The default port number is 8080, can go to the rocketmq – the console/SRC/main/resources/application properties.

server.address=0.0.0.0
# server.port=8080
# I have changed 8080 to 19876 here
server.port=19876
#...
# middle ellipsis
#...
Nameserv = Nameserv = Nameserv
rocketmq.config.namesrvAddr=localhost:9876
#...
# subsequent ellipsis
#...
Copy the code

welfare

Considering that GitHub access speed is sometimes extremely slow, I put my package to the network disk, the port number has been changed to 19876, will not occupy the more commonly used port 8080. You can download it directly and start it with java-JAR.

Follow the “Hugh’s Whiteboard” public account and reply to “MQ Console” to obtain it.

2. Enable the port number corresponding to the firewall

If your server is firewall enabled, you need to open the port number

#View the default firewall status (" NoTrunning "is displayed when disabled," RUNNING "is displayed when enabled)
$ firewall-cmd --state 
#Enables a specified port number
#-permanent Takes effect permanently. If this parameter is not specified, the parameter becomes invalid after the restart 
$ firewall-cmd --zone=public --add-port=19876/tcp --permanent   
#Overloaded firewall rule
firewall-cmd --reload
Copy the code

3, access,

Address: http://localhost:19876 port default 8080, if changed to use the changed, use the JAR package I provide direct access to the address I give.

3. Log in to the Console

You can log in to the Console using the user name and password and log out after the operation is complete. The following Settings need to be made:

  • In the Spring configuration fileresources/application.propertiesModify Enable the login function
#Open the login function rocketmq. Config. LoginRequired =true
#DataPath =/ TMP/RocketMQ.config. dataPath=/ rocketMq-console /data
Copy the code
  • Make sure that${rocketmq.config.dataPath}The directory defined exists and the login profile is created under this directoryusers.propertiesIf the file does not exist in the directory, the file is used by defaultresources/users.propertiesFile.users.propertiesThe file format is:
#This file supports hot modification, which means that users can be added or modified without restarting the ConsoleUsername =password[,N] #N = 0 1 (Administrator)  
#Define administrator admin=admin,1
#Define common user user1=user1user2=user2
Copy the code

At this point, starting the console enables the login function

Reference: rocketmq – 1. Gitbook. IO/rocketmq – co…