8-dubbo cluster fault tolerance in the first Knowledge Dubbo series

Source: Internet
Author: User
Tags failover

Cluster fault tolerance

(+) (#)

When the cluster call fails, Dubbo provides a variety of fault tolerant schemes, which are failover retries by default.

Each node relationship:

    • The invoker here is a callable service abstraction for provider, Invoker encapsulates provider address and service interface information.
    • The directory represents multiple Invoker, which can be viewed as list<invoker>, but unlike list, its value may be dynamically variable, such as a registry push change.
    • Cluster disguise multiple invoker in directory as a invoker, transparent to the upper layer, the spoofing process contains the fault-tolerant logic, and after the call fails, retry the other.
    • Router is responsible for selecting subsets from multiple invoker by routing rules, such as read/write separation, application isolation, etc.
    • LoadBalance is responsible for selecting a specific one for this invocation from multiple Invoker, and the selected process contains the load balancing algorithm, which needs to be re-elected after the call fails.
Cluster fault Tolerant mode:

You can extend the cluster fault tolerance policy yourself, see: Cluster expansion

Failover Cluster
    • Failed to automatically switch, when the failure occurs, retry the other server. Default
    • Typically used for read operations, but retries can lead to longer delays.
    • The number of retries can be set by retries= "2" (excluding the first time).
Failfast Cluster
    • Fast failure, only one call is initiated, failure immediately error.
    • Typically used for non-idempotent write operations, such as New records.
Failsafe Cluster
    • Fail safe, when an exception occurs, it is ignored directly.
    • Typically used to write operations such as audit logs.
Failback Cluster
    • Failure auto-recovery, background record failed request, timed re-send.
    • Typically used for message notification operations.
Forking Cluster
    • Multiple servers are called in parallel, as long as a success is returned.
    • It is often used for high-real-time read operations, but more service resources need to be wasted.
    • The maximum number of parallelism can be set by forks= "2".
Broadcast Cluster
    • Broadcast call all providers, call each, any one error is an error. (2.1.0 start support)
    • Typically used to notify all providers to update local resource information such as cache or log.

Number of retries configured such as: (Failover cluster mode is in effect)

<dubbo:serviceretries="2"/>

Or:

<dubbo:referenceretries="2"/>

Or:

<dubbo:reference>    <dubbo:methodname="findFoo"retries="2"/></dubbo:reference>

Cluster mode configuration such as:

<dubbo:servicecluster="failsafe"/>

Or:

<dubbo:referencecluster="failsafe"/>

8-dubbo cluster fault tolerance in the first Knowledge Dubbo series

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.