[Alibaba Middleware Technology Series] "RocketMQ Technology Special Topic" Let us practice the RocketMQ service and its console installation guide

  • 64-bit operating system, Linux/Unix/MacOS is recommended for production environment (for Windows operating system installation instructions, please refer to the Windows operating system installation tutorial)
  • 64-bit JDK 1.8+
  • 4G+ available disk

unzip rocketmq-all-4.5.1-bin-release.zip

cd rocketmq-all-4.5.1-bin-release

nohup sh bin/mqnamesrv &

tail -f ~/logs/rocketmqlogs/namesrv.log

2019-07-18 17:03:56 INFO main - The Name Server boot success. …

nohup sh bin/mqbroker -n localhost:9876 &

tail -f ~/logs/rocketmqlogs/broker.log

2019-07-18 17:08:41 INFO main - The broker[itmuchcomdeMacBook-Pro.local, 192.168.43.197:10911] b

export NAMESRV_ADDR=localhost:9876
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
复制代码

SendResult [sendStatus=SEND_OK, msgId=C0A82BC5F36C511D50C05B41…

Execute the following command:

sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer
复制代码

You can see output similar to the following:

ConsumeMessageThread_4 Receive New Messages: [MessageExt [queueId=3, stor....

复制代码

Just execute the following two commands in sequence

sh bin/mqshutdown broker
复制代码
The mqbroker(36695) is running...

Send shutdown request to mqbroker(36695) OK
复制代码
sh bin/mqshutdown namesrv
复制代码
The mqnamesrv(36664) is running...

Send shutdown request to mqnamesrv(36664) OK
复制代码

Find rocketmq-console/src/main/resources/application.properties and modify the configuration as needed

  • server.contextPath
    • Management background access context path, empty by default
    • If filled in, it needs to be written in the form of /xxx, such as /console
  • console port
    • server.port=8080
  • Name Server地址(if this value is empty,use env value rocketmq.config.namesrvAddr NAMESRV_ADDR | now, you can set it in ops page.default localhost:9876)
    • rocketmq.config.namesrvAddr=
  • rocketmq.config.isVIPChannel=( if you use rocketmq version < 3.5.8, rocketmq.config.isVIPChannel should be false.default true)
  • rocketmq-console’s data path:dashboard/monitor
  • rocketmq.config.dataPath=/tmp/rocketmq-console/data
  • rocketmq.config.enableDashBoardCollect=true
  • rocketmq.config.msgTrackTopicName=(set the message track trace topic if you don’t want use the default one)
  • rocketmq.config.ticketKey=ticket

rocketmq.config.loginRequired=false(#Must create userInfo file: ${rocketmq.config.dataPath}/users.properties if the login is required)

server.port=17890

You can also leave it unchanged. After starting the console, set it in the console navigation bar - Operation and Maintenance - NameSvrAddrList.

rocketmq.config.namesrvAddr=localhost:9876

Modify pom.xml and modify the version of RocketMQ related dependencies

<rocketmq.version>4.4.0rocketmq.version>
修改为
<rocketmq.version>你的RocketMQ版本rocketmq.version>
复制代码

For example:

<rocketmq.version>4.5.1rocketmq.version>
复制代码

After modifying pom.xml, an error will be reported when compiling org.apache.rocketmq.console.service.impl.MessageServiceImpl#queryMessageByTopic, so it needs to be solved.

DefaultMQPullConsumer consumer = new DefaultMQPullConsumer(MixAll.TOOLS_CONSUMER_GROUP, null)
改为:RPCHook rpcHook = null
DefaultMQPullConsumer consumer = new DefaultMQPullConsumer(MixAll.TOOLS_CONSUMER_GROUP, rpcHook)
复制代码

Switch to the code root directory

cd rocketmq-externals
复制代码
cd rocketmq-console
复制代码
mvn clean package -DskipTests
复制代码
java -jar rocketmq-console-ng-1.0.1.jar
复制代码

Visit http://localhost:17890 (the port is specified with server.port=17890 in application.properties above, the default is 8080), you can see the interface

share resources

Information sharing
To obtain the above resources, please visit the open source project and click to jump.

Guess you like

Origin blog.csdn.net/star20100906/article/details/132388469