Snitch in the Cassandra database

Source: Internet
Author: User
Tags cassandra

The snitch in Cassandra is used to tell the Cassandra network topology, such as the relative distance between the nodes, how the nodes are grouped, and the rack where the nodes are located, so that the user requests can be efficiently routed.

Note: All nodes in a cluster must adopt the same snitch policy.

Classification of Snitch:

Simplesnitch:

This snitch is the default snitch and is most appropriate when there is no rack (rack) or data center. Because it doesn't recognize any rack or data center information.

Rackinferringsnitch:

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/database/extra/

This snitch the node location by analyzing the IP information of the node, assuming that the 2nd decimal point of the IP address 4 is the data center name, and the 3rd is the rack name. So if there are two nodes and the first 3 are the same, then the two nodes are on the same rack, and if the first 2 bits are the same, then the two nodes are in the same data center.

Propertyfilesnitch:

In this snitch, the location of the node is given through the user-configured Cassandra-topology.properties file. This method is the most flexible.

A template for this file is given in Cassandra and we need to configure this template if we want to enable this snitch:

Actual combat:

Let's look at the Snitch method in our environment, using the default Simplesnitch:

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.