Contents
Installing and Deploying Cassandra 2.2
Installing Cassandra
Complete this procedure for each Cassandra node.
Prerequisites
- If you are using Web Services and Application v8.5.2.41 or earlier, a 2.1.4 version of the Cassandra distribution needs to be downloaded first. This package includes the cassandra-cli tool that you need to load the schema into your Cassandra 2.2 cluster.
- You have installed the latest Java SE Development Toolkit 8. For more information, refer to the Java documentation.
Start
- Download the latest 2.2.x version of Cassandra.
- Copy the Cassandra archive to the installation directory. For example, /usr/local
- Use a tar utility to extract the files. For example, tar -zxvf apache-cassandra-2.2.7-bin.tar.gz
- Add directories for data, commitlog, and saved_caches. You can create these directories anywhere or in the default locations configured in the Cassandra_install_dir/conf/cassandra.yaml file. For example:
- /var/lib/cassandra/data
- /var/lib/cassandra/commitlog
- /var/lib/cassandra/saved_caches
- Add a directory for logging. You can create this directory anywhere, such as /var/log/cassandra/.
End
Configuring Cassandra
The procedures below describe how to create the Cassandra keyspace for the following scenarios:
- Development: 1 Cassandra node (appropriate for a development or lab environment)
- Single Data Center: 1 data center with a minimum of three Cassandra nodes
Important
For more complex Cassandra deployments, please consult with GenesysSelect a tab below for the procedure that matches your deployment scenario.
Configuring Cassandra (1 Cassandra node)
Important
The files modified in this procedure are typically found in the Cassandra_install_dir/conf directory.Prerequisites
Start
- Modify the cassandra.yaml file:
- Set seeds to the list of host name of the node. For example: -seeds: “127.0.0.1”
- Set listen_address and rpc_address to the host name.
- Set data_file_directories, commitlog_directory, and saved_caches_directory to the directories you created in Step 4 of Installing Cassandra.
- Set the start_rpc parameter to true.
- Save your changes and close the file.
- Open the log4j-server.properties file and set the log4j.appender.R.File property to the directory you created in Step 5 of Installing Cassandra.
- Save your changes and close the file.
End
Configuring Cassandra (1 data center)
Complete the steps below for each node.
Important
The files modified in this procedure are typically found in the Cassandra_install_dir/conf directory.Prerequisites
Start
- Modify the cassandra.yaml file:
- Set the cluster_name. It must be the same name on all nodes.
- Set the initial_token according to the node's place in ring. It must be one of the following:
Node #1: -9223372036854775808 Node #2: -3074457345618258603 Node #3: 3074457345618258602
- Set seeds to the list of host names of all nodes. For example: -seeds: "node1, node2, node3"
- Set listen_address and rpc_address to the host name.
- Set data_file_directories, commitlog_directory, and saved_caches_directory to the directories you created in Step 4 of Installing Cassandra.
- Change endpoint_snitch to PropertyFileSnitch.
- Save your changes and close the file.
- Open the log4j-server.properties file and set the log4j.appender.R.File property to the directory you created in Step 5 of Installing Cassandra.
- Save your changes and close the file.
- Open the cassandra-topology.properties file and update for your cluster topology. For each node in your cluster, add the following line:
[node]=[datacenter]:[rack]
Where:
- [node] is the IP address of the node.
- [datacenter] is the name of the data center for this node.
- [rack] is the name of the rack for this node.
The following is a sample cassandra-topology.properties file for a Single Data Center scenario:
192.0.2.10=datacenter1:rack1 192.0.2.11=datacenter1:rack1 192.0.2.12=datacenter1:rack1
- Save your changes and close the file.
Important
The tokens shown here can be used for a three-node Cassandra cluster in a single data center. If you are using a different topology or cluster size,
consult the Cassandra documentation.End
Verifying the Cassandra installation
Prerequisites
Start
- Start all Cassandra nodes using the following command: Cassandra_install_dir/bin/cassandra
- Use the nodetool utility to verify that all nodes are connected by entering the following command:
Cassandra_install_dir/bin/nodetool -h Cassandra_host ring
The following is sample output for a Single Data Center scenario with three Cassandra nodes:/genesys/apache-cassandra-1.2/bin$ ./nodetool ring Address DC Rack Status State Load Owns Token 192.0.2.10 datacenter1 rack1 Up Normal 14.97 MB 100.00% -9223372036854775808 192.0.2.11 datacenter1 rack1 Up Normal 14.97 MB 100.00% -3074457345618258603 192.0.2.12 datacenter1 rack1 Up Normal 14.97 MB 100.00% 3074457345618258602
The following is sample output for a Development scenario with a single Cassandra node:
/genesys/apache-cassandra-2.2/bin$ ./nodetool ring Address DC Rack Status State Load Effective-Ownership Token 127.0.0.1 datacenter1 rack1 Up Normal 1.89 MB 100.00% 76880863635469966884037445232169973201
End
Next step
This page was last edited on July 14, 2017, at 16:40.
Comments or questions about this documentation? Contact us for support!