Database Reference
In-Depth Information
and it trades away a little flexibility and ease of maintenance in order to give you more control
and better runtime performance, as Cassandra doesn't have to figure out where nodes are. In-
stead, you just tell it where they are.
NOTE
The PropertyFileSnitch used to be called PropertyFileEndPointSnitch and was in the contrib
directory before being promoted to part of the standard distribution, in case you see references to that
online.
Creating a Cluster
You can run Cassandra on a single machine, which is fine for getting started as you learn how
to read and write data. But Cassandra is specifically engineered to be used in a cluster of many
machines that can share the load in very high-volume situations. In this section, we see what you
have to do to get multiple Cassandra instances to talk to each other in a ring.
NOTE
During the writing of this topic, the entire coniguration mechanism was changing dramatically. This
section covers how to create a cluster using version 0.6.
What we want to do here is just use the sample keyspace that ships with Cassandra to make sure
that we can get multiple machines in a ring together. So we'll start with the default configuration
file and keyspace definition, and change only those settings required to create a simple cluster.
For this exercise, let's say that we have two boxes we want to set up as a Cassandra cluster, with
the IP addresses 192.168.1.5 and 192.168.1.7. When you start Cassandra, it reads the config-
uration file to determine how you want the current node to broadcast—that is, what host or IP
address and what port to use. You need to tell the current node about the other nodes with which
it should participate in a ring. Doing this is a simple matter of opening the config file in a text
editor and updating a few values, as we'll examine here.
A new node in a cluster needs what's called a seednode. If node A acts as a seed for node B,
when node B comes online, it will use node A as a reference point from which to get data. Seed
nodes will ignore the AutoBootstrap setting because it is assumed that they will be the first
nodes in the cluster.
Search WWH ::




Custom Search