Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of RokcetMq installation and Quick start

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "the method of RokcetMq installation and quick startup". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "RokcetMq installation and quick start method" it!

RokcetMq installation & Quick start

Visit: http://rocketmq.apache.org/dowloading/releases/ to download the latest version

Put the latest version of the downloaded package on the linux server. Here, take rocketmq-all-4.5.2-bin-release.zip as an example

[jenkins@test01 rocketmq] the total amount of $ll is 12296 RW, RW, and RMI. 1 jenkins jenkins 12589252 October 22 15:45 rocketmq-all-4.5.2-bin-release.zip [jenkins@test01 rocketmq] $unzip rocketmq-all-4.5.2-bin-release.zip Archive: rocketmq-all-4.5.2-bin-release.zip creating: rocketmq-all-4.5.2-bin-release/ creating: rocketmq-all-4.5.2-bin-release/benchmark/ inflating: rocketmq-all-4.5.2-bin-release/benchmark / consumer.sh inflating: rocketmq-all-4.5.2-bin-release/benchmark/runclass.sh inflating: rocketmq-all-4.5.2-bin-release/benchmark/tproducer.sh inflating: rocketmq-all-4.5.2-bin-release/benchmark/producer.sh.

Then refer to the quick launch document on the official website: http://rocketmq.apache.org/docs/quick-start/

Start memory configuration

Since name server and broker are configured with 4G to 8g memory by default, the default memory needs to be modified if the server is out of memory.

Solution: find runserver.sh and runbroker.sh and edit JAVA_OPT= "${JAVA_OPT}-server-Xms256m-Xmx256m-Xmn125m-XX:MetaspaceSize=128m-XX:MaxMetaspaceSize=320m"

Start Name Server [jenkins@test01 rocketmq] $mv rocketmq-all-4.5.2-bin-release rocketmq-all-4.5.2 [jenkins@test01 rocketmq] $cd rocketmq-all-4.5.2 [jenkins@test01 rocketmq-all-4.5.2] $ll total usage 44drwxr-xr-x. 2 jenkins jenkins 4096 August 2 10:05 benchmarkdrwxr-xr-x. 3 jenkins jenkins 4096 July 31 21:11 bindrwxr-xr-x. 6 jenkins jenkins 4096 July 31 21:09 confdrwxr-xr-x. 2 jenkins jenkins 4096 August 2 10:05 lib-rw-r--r--. 1 jenkins jenkins 17336 July 31 21:09 LICENSE-rw-r--r--. 1 jenkins jenkins 1338 July 31 21:09 NOTICE-rw-r--r--. 1 jenkins jenkins 4020 July 31 21:09 README.md [jenkins@test01 rocketmq-all-4.5.2] $nohup sh bin/mqnamesrv > mqnamesrv.out & [1] 13179nohup: ignore input redirection errors to standard output [jenkins@test01 rocketmq-all-4.5.2] $tail-500f mqnamesrv.out Java HotSpot (TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future releaseJava HotSpot (TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.The Name Server boot success. SerializeType=JSON

See The Name Server boot success. The serializeType=JSON representative has successfully deployed name server.

Launch Broker [Jenkins @ test01 rocketmq-all-4.5.2] $nohup sh bin/mqbroker-n 10.130.44.165 Exit 9876 > mqbroker.out & [8] 13782 [6] Exit 143 nohup sh bin/mqbroker-n 10.130.44.165 nohup sh bin/mqbroker > mqbroker.out [jenkins@test01 rocketmq-all-4.5.2] $nohup: ignore input redirection errors to standard output [jenkins@test01 rocketmq-all-4.5 .2] $tail-500f mqbroker.out The broker [test01 10.130.44.165:10911] boot success. SerializeType=JSON and name server is 10.130.44.165:9876

See that the The broker [test01, 10.130.44.165 Broker 10911] boot success represents that the Broker has been started and connected to the name server.

Message sending and receiving testing

Set the NAMESRV_ADDR environment variable first, and then use the messaging tool

[jenkins@test01 rocketmq-all-4.5.2] $export NAMESRV_ADDR=localhost: 9876 [Jenkins @ test01 rocketmq-all-4.5.2] $sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer14:55:28.799 [main] DEBUG i.n.u.i.l.InternalLoggerFactory-Using SLF4J as the default logging frameworkRocketMQLog:WARN No appenders could be found for logger (io.netty.util.internal.PlatformDependent0). RocketMQLog:WARN Please initialize the logger system properly.SendResult [sendStatus=SEND_OK, msgId=0A822CA5432112A3A380747FC2A30000, offsetMsgId=0A822CA500002A9F0000000000000000, messageQueue=MessageQueue [topic=TopicTest, brokerName=test01, queueId=0] QueueOffset=0] SendResult [sendStatus=SEND_OK, msgId=0A822CA5432112A3A380747FC3120001, offsetMsgId=0A822CA500002A9F00000000000000B2, messageQueue=MessageQueue [topic=TopicTest, brokerName=test01, … SendResult [sendStatus=SEND_OK, msgId=0A822CA5432112A3A380747FD3FD03E7, offsetMsgId=0A822CA500002A9F000000000002BDFE, messageQueue=MessageQueue [topic=TopicTest, brokerName=test01, queueId=3], queueOffset=249] 14 msgId=0A822CA5432112A3A380747FD3FD03E7 55 offsetMsgId=0A822CA500002A9F000000000002BDFE 34.461 [NettyClientSelector_1] INFO RocketmqRemoting-closeChannel: close the connection to remote address [127.0.0.1 offsetMsgId=0A822CA500002A9F000000000002BDFE 9876] result: true14:55:34.470 [NettyClientSelector_1] INFO RocketmqRemoting-closeChannel: close the connection to remote address [10.130.44.165virtual 10911] result: true [jenkins@test01 rocketmq-all-4.5.2] $

Start the message receiving tool, which will wait for the message to be sent and will not stop automatically

[jenkins@test01 rocketmq-all-4.5.2] $sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer14:59:55.032 [main] DEBUG i.n.u.i.l.InternalLoggerFactory-Using SLF4J as the default logging frameworkConsumer Started. ConsumeMessageThread_2 Receive New Messages: [MessageExt [queueId=2, storeSize=180, queueOffset=485, sysFlag=0, bornTimestamp=1571813940924, bornHost=/10.130.44.165:58852, storeTimestamp=1571813940925, storeHost=/10.130.44.165:10911, msgId=0A822CA500002A9F0000000000055334, commitLogOffset=348980, bodyCRC=1786477042, reconsumeTimes=0, preparedTransactionOffset=0, toString () = Message {topic='TopicTest', flag=0, properties= {MIN_OFFSET=0, MAX_OFFSET=500, CONSUME_START_TIME=1571813984202, UNIQ_KEY=0A822CA543EA12A3A3807482FABC03AC, WAIT=true, TAGS=TagA}, body= [72,101,108,108,111,32,82,111,99,107,101,116,77, 81, 32, 57, 52 48], transactionId='null'}]] ConsumeMessageThread_5 Receive New Messages: [MessageExt [queueId=2, storeSize=180, queueOffset=482, sysFlag=0, bornTimestamp=1571813940894, bornHost=/10.130.44.165:58852, storeTimestamp=1571813940895, storeHost=/10.130.44.165:10911, msgId=0A822CA500002A9F0000000000054AC4, commitLogOffset=346820, bodyCRC=855266886, reconsumeTimes=0, preparedTransactionOffset=0, toString () = Message {topic='TopicTest', flag=0, properties= {MIN_OFFSET=0, MAX_OFFSET=500, CONSUME_START_TIME=1571813984200, UNIQ_KEY=0A822CA543EA12A3A3807482FA9E03A0, WAIT=true, TAGS=TagA}, body= [72,101,108,108,111,32,82,111,99,107,101,116,77 81, 32, 57, 50, 56], transactionId='null'}]]

At this point, the environment has been built and passed the test.

Service stop

To stop, you need to pause broker, and then stop namesrv. The specific commands are as follows:

[jenkins@test01 rocketmq-all-4.5.2] $sh bin/mqshutdown brokerThe mqbroker (13790) is running...Send shutdown request to mqbroker (13790) OK [jenkins@test01 rocketmq-all-4.5.2] $sh bin/mqshutdown namesrvThe mqnamesrv (13501) is running...Send shutdown request to mqnamesrv (13501) OK [jenkins@test01 rocketmq-all-4.5.2] $log directory

The RocketMq default log directory is placed under the current user's logs directory.

[jenkins@test01 rocketmqlogs] $pwd/home/jenkins/logs/rocketmqlogs [jenkins@test01 rocketmqlogs] $ll total dosage 31220 Murray RW Murray. 1 jenkins jenkins 5063 October 23 17:01 broker_default.log-rw-rw-r--. 1 jenkins jenkins 707575 October 23 18:26 broker.log-rw-rw-r--. 1 jenkins jenkins 0 October 22 17:03 commercial.log-rw-rw-r--. 1 jenkins jenkins 0 October 22 17:03 filter.log-rw-rw-r--. 1 jenkins jenkins 0 October 22 17:03 lock.log-rw-rw-r--. 1 jenkins jenkins 3157 October 23 17:00 namesrv_default.log-rw-rw-r--. 1 jenkins jenkins 203504 October 23 18:21 namesrv.log-rw-rw-r--. 1 jenkins jenkins 0 October 22 17:03 protection.log-rw-rw-r--. 1 jenkins jenkins 157157 October 23 18:19 remoting.log-rw-rw-r--. 1 jenkins jenkins 1368353 October 23 18:19 rocketmq_client.log-rw-rw-r--. 1 jenkins jenkins 194451 October 23 18:26 stats.log-rw-rw-r--. 1 jenkins jenkins 0 October 22 17:03 storeerror.log-rw-rw-r--. 1 jenkins jenkins 3510867 October 23 18:25 store.log-rw-rw-r--. 1 jenkins jenkins 1515006 October 23 18:25 transaction.log-rw-rw-r--. 1 jenkins jenkins 24251040 October 23 18:26 watermark.log here, I believe you have a deeper understanding of the "RokcetMq installation and quick start method", might as well to practical operation it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report