Categories
Uncategorized

Apache RocketMQ Message Queuing installation and deployment visualization interface

I. INTRODUCTION

Apache RocketMQ is a distributed queue model messaging middleware, low latency, high performance and high reliability, the capacity of one trillion and flexible scalability. The core assembly consists of four parts: Name Servers, Brokers, Producer and Consumer; each of them can be extended horizontally, and no single node failure.

    NameServer: almost no state is a node, the cluster can be deployed, no synchronization information between the node

    Broker: relatively complex deployment, Broker into Master and Slave, Master may correspond to a plurality of Slaver, but corresponds to only one Slaver a Master, Master and the correspondence relationship Slaver designated by the same BrokerName, different BrokerId defined, BrokerId as 0 for Master, nonzero if Slaver. Master can deploy multiple. Broker and build all nodes of each cluster NameServer long link, the timing of the registration information to all Topic NameServer

    Producer: Establishment and NameServer one of the nodes in the cluster (randomly selected) long connection, are taken regularly from NameServer Topic routing information, and provide long Topic Service Master established connection, and the timer sends a heartbeat to the Master. Produce completely stateless, can be clustered deployment

    Consumer: Establishment and NameServer one of the nodes in the cluster (randomly selected) long connection, are taken regularly from NameServer Topic routing information, and provide services Topic Master, Slaver long established connections, and the timing of sending a heartbeat to the Master, Slaver. Consumer can subscribe to the Master, you can subscribe to news from the Slave, subscription rules by the Broker configuration decisions

 

Two, MQ installation deployment

2.1 Download

直接找最新版下载后解压
http://rocketmq.apache.org/release_notes

 

2.2 modify the configuration

修改 conf/broker.conf
添加以下配置

brokerIP1: configure the broker of the server ip address to Name Server connection

And modifying runserver.sh runbroker.sh (not changed)
    Because rocketMQ default boot parameters memory footprint is very large, if the environment is not so much memory is required to modify parameters JAVA_OPT

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

 

2.3 Running Name Server

nohup sh bin/mqnamesrv &

View the Run Log: tail -f ~ / logs / rocketmqlogs / namesrv.log

 

2.4. Run Broker

nohup sh bin/mqbroker -n localhost:9876 -c conf/broker.conf &

-C parameter specifies the configuration file
    View the Run Log: tail -f ~ / logs / rocketmqlogs / broker.log

 

2.5. The way out of service

If you need to stop RocketMQ service in a production environment is not recommended to directly kill, you should use the following command

sh bin/mqshutdown broker

sh bin/mqshutdown namesrv

 

Third, the installation visual management interface

  • 下载
    https://github.com/apache/rocketmq-externals/tree/master/rocketmq-console
  • Compile

mvn clean package -Dmaven.test.skip=true

    run

nohup java -jar \
    -Drocketmq.config.namesrvAddr=192.168.28.130:9876 \
    -Drocketmq.config.isVIPChannel=false \
    rocketmq-console-ng-1.0.0.jar &
  • 访问
    http://192.168.28.130:8080/

 

Fourth, the common exception handling

4.1. MQClientException: No route info of this topic, TopicTest1

4.1.1. Exception description

Up and running in the client’s Producer reason Throws exception occurs as “No route info of this topic” when ready to send the message might be:

    Broker disables the automatic creation Topic, and users do not have to create manually by Topic

    Broker is not properly connected to the Name Server

    Producer is not properly connected to the Name Server

 

4.1.2. Solution

  • 排查1Broker 禁止自动创建 Topic,且用户没有通过手工方式创建 Topic

      You can execute “sh bin / mqbroker -m” in the directory where rocketmq to view the configuration parameters of broker

    • 如下所示,autoCreateTopicEnable=true 证明是没有问题的

 

    Investigation 2: Broker is not properly connected to the Name Server
            By looking at the broker’s log tail -f ~ / logs / rocketmqlogs / broker.log see if there is an error message

 

  • 排查3Producer 没有正确连接到 Name Server

      Check the program address connection Name Server There are no wrong

      If on a cloud server, configure the 9876 port check security groups have not been developed

    1. 看看有没有打开防火墙,有的话设置防火墙开放9876端口
      bash [[email protected] rocketmq-all-4.5.0-bin-release]# firewall-cmd --zone=public --list-ports 8090/tcp 80/tcp 8080/tcp [[email protected] rocketmq-all-4.5.0-bin-release]# firewall-cmd --zone=public --add-port=9876/tcp --permanent success [[email protected] rocketmq-all-4.5.0-bin-release]# firewall-cmd --reload success [[email protected] rocketmq-all-4.5.0-bin-release]# firewall-cmd --zone=public --list-ports 9876/tcp 8090/tcp 80/tcp 8080/tcp

 

4.2. RemotingTooMuchRequestException: sendDefaultImpl call timeout

4.2.1. Exception description

    When ready to throw to send messages up and running in the client’s abnormal follows Producer

  • 通常因为Name Server连接不上Broker

 

4.2.2. Solution

Check the rocketmq-console cluster tab, broker’s address is correct
    
    Please address configuration steps to deploy broker mentioned reference installation:

    Broker.conf modify configuration parameters add brokerIP1

    Plus -c parameter specifies the configuration file at startup broker

 

4.3 Consumer / can not view the dead letter queue messages topic

4.3.1. Exception description

死信队列默认的 perm 值为2没有查看权限
 

4.3.2. Solution

在控制台把队列的 perm 改为6就可以了
主题点击 TOPIC配置

修改perm

 

Recommended Reading

    Logs to troubleshoot difficult problems? Distributed link tracking log to help you

    zuul latest Sentinel integrated gateway flow control assembly

    Ali registry Nacos production deployment

    Spring Boot custom configuration item inside the IDE automatically prompted

    How dynamic routing Spring Cloud Zuul do? Nacos very simple to achieve integration

    How Spring Cloud service developers to resolve conflicts and instances scurrying?

    How Spring Cloud synchronization scenario distributed transactions do? Try Seata

Scan code concern surprise!

Leave a Reply