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

What is the role of database service activemq in the construction of double active activities for disaster preparedness?

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what is the role of database service activemq in the construction of disaster preparedness". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the role of database service activemq in the construction of disaster preparedness?"

Overview

Activemq is a very popular, powerful, open source messaging middleware in the industry. Known for its high speed and support for multiple cross-language clients and protocols; full support for JMS 1.1 and J2EE 1.4. There are a large number of application cases in various industries.

As activemq plays an important role in the message service, in this article we focus on the design, planning and deployment of activemq in the construction of disaster recovery and double activities.

target

The most perfect architecture design for disaster recovery and double active construction: in the most extreme cases, such as the collapse of a single data center, zero message loss is guaranteed and 724 service requirements are supported in two data centers in the same city and in different places.

Requirement description

1.1 computer room failure

1) phenomenon description

Message queuing middleware is deployed in two different computer rooms An and B, and the client forwards it to the message middleware in the corresponding computer room according to the load policy, in which An or B computer room fails due to power outage or disaster and cannot continue to provide services. Only one computer room is normal at this time.

2) phenomenon diagram

3) Service impact

Normally, the connection for the client is evenly distributed between the two data centers. If a single server room fails, the connection in the failed data center will be disconnected, and the uncommitted transaction will be rolled back. The new connection initiated will not be affected. You can still access the message middleware service in the normal server room through the configured load policy.

4) Fault recovery

When the computer room returns to normal, start the message middleware service. At this time, as long as the host and network return to normal, the message middleware service can be started successfully. At this time, the AB computer room continues to process connections according to the load strategy, eventually making the number of middleware connections in each computer room infinitely close.

1.2 Server DOWN

1) phenomenon description

In the running message middleware cluster architecture, there are N hosts, of which any Nmuri 2 host down machines do not have the ability to provide services, and only more than one host can survive to provide services.

2) phenomenon diagram

3) Service impact

After the host DOWN is dropped, the connection already connected to the host message middleware is disconnected, the corresponding transaction is rolled back, and the new connection is not affected.

4) Fault recovery

When the host fault is handled, start the failed host and start the message middleware service. According to the load balancing algorithm, client connections are redistributed to nodes on that host.

1.3 message middleware node crashes

1) phenomenon description

In the running message middleware cluster architecture, there are N nodes, of which 2 nodes crash and do not have the ability to provide services, and only more than 1 node survives to provide services.

2) phenomenon diagram

3) Service impact

When the message middleware node crashes, the connection already connected to the host message middleware will be broken, the corresponding transaction will be rolled back, and the new connection will not be affected.

4) Fault recovery

When the failure of the message queue node is handled, the message middleware service is started. According to the load balancing algorithm, client connections are redistributed to the node.

Architecture design

1.1 key points of architecture design

●, what architecture of activemq is adopted to achieve the above requirements?

The master-slave + Broker-Cluster mode is adopted to achieve the HA (highly available) function, and the election voting function of zookeeper is used to ensure that "more than half of the nodes are available". Therefore, the recommended HA architecture has an odd number of nodes, at least 3 nodes, and the normal use of a node will not be affected at any time.

At the same time, the deployment mode of Broker-Cluster,Broker-Cluster can solve the problem of load balancing and distribution, because a single master-slave mode can not solve the problem of load balancing.

●, how to ensure the synchronization of unconsumed messages between nodes?

Using leveldb (LevelDB is Google open source persistent KV stand-alone database, with high random write, sequential read / write performance) to achieve synchronous write between each node to ensure that the data is replicated under the same Broker-Cluster group. Take three nodes as an example, the same stacked message is kept synchronized in three nodes. In the most extreme cases, even if the data files of two nodes are lost, it can prevent data loss.

●, how to ensure that the message service can still provide services normally in the event of a disaster? For example, consider the most extreme case of unilateral data center downtime?

Adopt 2 sets of master-slave and 2 sets of Broker-Cluster, and ensure that each of the two data centers contains a set of master-slave 2 nodes. As shown in the following figure, 2 nodes of cluster1 are in center B and 2 nodes of cluster2 are in center A. even if a disaster occurs in the whole data center of An and B, the normal operation of jms services will not be affected.

●, do you ensure that 724 and zero message loss are achieved in all kinds of disaster scenarios?

Yes, jms services are available under any combination as long as the two nodes under one cluster are available.

●, how does the client call the jms address of the cluster

ConnectionFactory = new ActiveMQConnectionFactory (

ActiveMQConnection.DEFAULT_USER

ActiveMQConnection.DEFAULT_PASSWORD

"failover: (tcp://192.168.40.140:61616,tcp://192.168.40.140:61617,tcp://192.168.40.141:61619,tcp://192.168.40.141:61620,tcp://192.168.40.141:61621,tcp://192.168.40.140:61618)")

As in the example above, activemq invokes any available node according to random policy

1.2 Architectural diagram

The example diagram of ● and architecture is as follows:

◆, which node is master, if there is no requirement, the one that starts first may become master.

◆ and master nodes are currently providing services.

Thank you for your reading. The above is the content of "what is the role of database service activemq in the construction of double active activities for disaster preparedness". After the study of this article, I believe you have a deeper understanding of the role of database service activemq in the construction of double active activities of disaster preparedness, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Database

Wechat

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

12
Report