Java Product Optimization Deployment _day01 (4)

Source: Internet
Author: User

2.1.1 Starting the cluster
Starting a cluster is starting each instance individually.

After startup, we'll check the running status of each instance.
Query First Service first

Mode for follower expression is follower (from)
Re-query the second service Mod for leader represents the leader (master)


Query the third one for follower (from)

2.1.2 Simulating cluster anomalies
(1) First of all, we'll test what happens if we hang out of the server.
Stop server 3rd, observe numbers 1th and 2nd, and find the status unchanged.

It concludes that 3 nodes of the cluster, from the server hanging off, the cluster is normal
(2) We also stop the server 1th (from the server) and check the status of number 2nd (primary server), and found that it has stopped running.


It concludes that 3 nodes of the cluster, 2 from the server are hung off, the primary server will not be able to run. Because the machine that can run does not exceed half of the total number of clusters.

(3) We started up server 1th again and found that server 2nd was working again. And still a leader.

(4) We put the number 3rd server up and Shut down server 2nd (sweat ~ ~ Why?) The leader hung up? ) After stopping
Observe the status of numbers 1th and 3rd.

Discover the new leader produced ~

From this we conclude that when the primary server in the cluster is hung up, the other servers in the cluster will be automatically elected and then generate a new leader

(5) We test again, when we restart the server 2nd (sweat ~ ~ This is Zha corpse Ah!) What happens when you start up? Will server number 2nd become a new leader again? We look at the results.

We will find that server 2nd is still the follower (from the server), server 3rd is still the leader (master server), does not shake the leadership of server 3rd. Ah ~ retired is retired, said no forget, haha.
This leads us to conclude that once a leader has been created, new servers are added to the cluster again without affecting the incumbent leader.


2.3 Dubbox Connecting Zookeeper cluster
Modify the spring configuration file for service providers and service callers

Java Product Optimization Deployment _day01 (4)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.