Teamwork Cloud 18.4 Documentation
- Created by Mimi Sari Kurnia, last modified on Feb 02, 2017
This page provides the steps you need to install Cassandra and configure the Cassandra node on your machine. You can also download the rpm package first and install Cassandra offline.
Note
- If a firewall is running on your machine, you need to open the following Cassandra client ports: 9042 and 9160. See the detail here http://docs.datastax.com/en/cassandra/2.0/cassandra/security/secureFireWall_r.html.
- Make sure that both zone_reclaim_mode and swap are disabled. Failure to do so can cause severe performance issues. For detailed instructions on how to disable them, see https://docs.datastax.com/en/cassandra/2.2/cassandra/install/installRecommendSettings.html.
How to install Cassandra on Linux
Check which version of Java is installed by running the following command:
$ java -version
Note
Use Oracle JDK 1.8.0_92.
Add a yum repository specification for the Datastax repository in /etc/yum.repos.d
$sudo vi /etc/yum.repos.d/datastax.repo
In this file, add the following lines for the Datastax repository:[datastax] name = DataStax Repo for Apache Cassandra baseurl = http://rpm.datastax.com/community enabled = 1 gpgcheck = 0
Install the packages by using the following command line:
$ sudo yum install dsc22-2.2.5-1 cassandra22-2.2.5-1
4. Configure Cassandra:
4.1 Locate the keys '- seeds', 'listen_address:', and 'broadcast_rpc_address:' in the file in /etc/cassandra/ conf/cassandra.yaml (they are at different locations in the file). If, for example, the node's IP address was 10.1.1.123, the following values would apply:
Note
The IP address 10.1.1.123 is just an example. You need to change it to the IP address of your server.
seeds: "10.1.1.123"
listen_address: 10.1.1.123
broadcast_rpc_address: 10.1.1.123
Warning
- There is a space before each IP address for parameters "listen_address" and "broadcast_rpc_address". The space is required for Cassandra to start.
- When entering the parameters to configure cassandra.yaml, be sure that there is no '#' (pound sign) or 'space' before the parameter name. If there is a #, for example, #broadcast_rpc_address: 10.1.1.123, this value will become a comment. If there is a space before the parameter name, for example, <space>#broadcast_rpc_address: 10.1.1.123, you will get an error after starting Cassandra.
Tip
Cassandra nodes exchange information about one another using a mechanism called Gossip. A Seed is a node used as a Gossip contact point for information regarding ring topology. There must be one or more Seed elements for a working cluster.
4.2 Use the following keys' values to change the existing ones:
thrift_framed_transport_size_in_mb: 100
commitlog_segment_size_in_mb: 64
read_request_timeout_in_ms: 600000
range_request_timeout_in_ms: 600000
write_request_timeout_in_ms: 600000
cas_contention_timeout_in_ms: 1000
truncate_request_timeout_in_ms: 600000
request_timeout_in_ms: 600000
start_rpc: true
rpc_address: 0.0.0.0
batch_size_warn_threshold_in_kb: 3000
batch_size_fail_threshold_in_kb: 5000
5. Verify the installation of Cassandra.
5.1 When installed as above, you can start Cassandra using the following command:
$ sudo service cassandra start
5.2 Issue the following command to verify that Cassandra is ready:
$ tail /var/log/cassandra/cassandra.log
5.3 Verify that it contains lines similar to the following:
INFO 15:51:58,644 Node/10.1.1.123 state jump to normal |
Tip
If you get an out of memory error when starting Cassandra, you need to increase the Java stack size. The instructions for increasing the stack size are given in the section Starting Cassandra on Linux.
6. Verify that Cassandra is running:
$ nodetool status
Cassandra status.
How to install Cassandra using predownloaded rpm package
Check which version of Java is installed by running the following command:
$ java -version
Note
Use Oracle JDK 1.8.0_92.
- Download rpm package of Cassandra 2.2.8 from http://rpm.datastax.com/community/noarch/cassandra22-2.2.8-1.noarch.rpm
Install the package using the following command line:
$ sudo rpm -ivh cassandra22-2.2.8-1.noarch.rpm
If you already have an older version of cassandra22 installed, use the following command instead.
$ sudo rpm -Uvh cassandra22-2.2.8-1.noarch.rpm
Configure Cassandra:
4.1 Locate the keys '- seeds', 'listen_address:', and 'broadcast_rpc_address:' in the file in /etc/cassandra/ conf/cassandra.yaml (they are at different locations in the file). If, for example, the node's IP address was 10.1.1.123, the following values would apply:Note
The IP address 10.1.1.123 is just an example. You need to change it to the IP address of your server.
seeds: "10.1.1.123"
listen_address: 10.1.1.123
broadcast_rpc_address: 10.1.1.123
Warning
- There is a space before each IP address for parameters "listen_address" and "broadcast_rpc_address". The space is required for Cassandra to start.
- When entering the parameters to configure cassandra.yaml, be sure that there is no '#' (pound sign) or 'space' before the parameter name. If there is a #, for example, #broadcast_rpc_address: 10.1.1.123, this value will become a comment. If there is a space before the parameter name, for example, <space>#broadcast_rpc_address: 10.1.1.123, you will get an error after starting Cassandra.
Tip
Cassandra nodes exchange information about one another using a mechanism called Gossip. A Seed is a node used as a Gossip contact point for information regarding ring topology. There must be one or more Seed elements for a working cluster.
4.2 Use the following keys' values to change the existing ones:thrift_framed_transport_size_in_mb: 100
commitlog_segment_size_in_mb: 64
read_request_timeout_in_ms: 600000
range_request_timeout_in_ms: 600000
write_request_timeout_in_ms: 600000
cas_contention_timeout_in_ms: 1000
truncate_request_timeout_in_ms: 600000
request_timeout_in_ms: 600000
start_rpc: true
rpc_address: 0.0.0.0
batch_size_warn_threshold_in_kb: 3000
batch_size_fail_threshold_in_kb: 5000
- Verify the installation of Cassandra.
5.1 When installed as above, you can start Cassandra using the following command:
$ sudo service cassandra start
5.2 Issue the following command to verify that Cassandra is ready:
$ tail /var/log/cassandra/cassandra.log
5.3 Verify that it contains lines similar to the following:
INFO 15:51:58,644 Node/10.1.1.123 state jump to normal
INFO 15:51:58,650 Waiting for gossip to settle before accepting client requests...
INFO 15:52:06,650 No gossip backlog; proceedingTip
If you get an out of memory error when starting Cassandra, you need to increase the Java stack size. The instructions for increasing the stack size are given in the section Starting Cassandra on Linux.
Verify that Cassandra is running:
Cassandra status.
- No labels