Cassandra Configuring a multi-node cluster

Source: Internet
Author: User
Tags cassandra

previous article Cassandra The Getting Started guide, we've configured a single node cluster, and then we'll add a few more nodes to the cluster to see how multiple nodes work at the same time.

The exchange of information between Cassandra nodes is through a mechanism called gossip (which is not known for a moment to be appropriate for which proper noun to translate). But to get a message to a newly added node, at least you need to know the other node, which is called seed. Usually we choose a small number of relatively stable nodes as seed nodes, but this is not a hard rule. It is important to ensure that each seed node is aware of at least one other seed node. Remember, this is done to avoid chicken and egg problems, providing a way for all nodes in the cluster to discover other nodes.
In addition to the seed nodes, we also need to configure the IP interface to listen for gossip and CQL (Listen_address and Rpc_address, respectively), as follows:
s) install Cassandra on each node

6) Other configurations see Cassandra.yaml configuration files and cassandra-rackdc.properties configuration files.


This example describes a cluster that installs 3 nodes in a single rack in a single data center.
Steps
1. Installation node:
node0 192.168.0.111 (seed1)
Node1 192.168.0.112 (SEED2)
Node2 192.168.0.113
Note: Having multiple seed nodes per data center is a best practice.
2. If there is a firewall in the cluster, ensure that the ports are passed so that the nodes can access each other.
3. If the Cassandra is running, you must first stop and clean up the data:
Stop Cassandra:
$ ps-ef | grep Cassandra
$ sudo kill pid

Cleanup Data:
$ sudo rm-rf/var/lib/apache-cassandra-2.1.9/data/*
4. Configure the properties in Cassandra.yaml:
Only two changes are needed here, other default:
-seeds: The internal IP of each seed node. The seed node does not boot, and it is responsible for processing the newly joined nodes in the existing cluster. For a new cluster, boot processing skips the seed node.
listen_address: If not set, Cassandra will read the local address corresponding to the hostname from the system, in some cases Cassandra get the address is not correct, at this time we have to manually specify.
such as:
cluster_name: ' Monitorcluster '
Seed_provider:
-Class_name:org.apache.cassandra.locator.SimpleSeedProvider
Parameters
-Seeds: "192.168.0.111,192.168.0.112"
listen_address:192.168.0.111
rpc_address:192.168.0.111


once all nodes have been configured, start the seed node one at a time before starting the other node
$ cd/var/lib/apache-cassandra-2.1.9

$ sudo bin/cassandra


As we can see, each node joins the cluster in turn.

After all nodes are up:



Finally check the cluster running status:
$ cd/var/lib/apache-cassandra-2.1.9
$ Bin/nodetool Status
(This command can be added without sudo)


We are sharing the load from the nodes in the state that we can join.


Have to mention, for my 2010 think this, run three nodes of the virtual machine has been very laborious, 4G memory reached 80%, so basic can only use CQLSH to interact, follow-up learning or to use a single node, unless you have sufficient resources.



Reference:
Http://docs.datastax.com/en/cassandra/2.1/cassandra/initialize/initializeSingleDS.html


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Cassandra Configuring a multi-node cluster

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.