- These instructions are intended for installing Cassandra 2 on a single Fedora 20 node.
- I’ll be working from a Liquid Web Self Managed Fedora 20 server, and I’ll be logged in as root.
- You may be able to skip to Step #2 if you already have a stable version of Java 7 (preferably the Oracle/Sun JVM). Check to see if your server already has Java installed by running the following command: java -version
Step 1: Install JavaFirst, you’ll follow a simple best practice: ensuring the list of available packages is up to date before installing anything new.
yum -y updateAt this point, installing java is as simple as running just one command:
yum -y install java
Step #2: Add the DataStax Community RepositoryFor a refresher on editing files with vim see: New User Tutorial: Overview of the Vim Text Editor
vim /etc/yum.repos.d/datastax.repoAdd the following information to the file you’ve created, using i to insert:
[datastax] name = DataStax Repo for Apache Cassandra baseurl = http://rpm.datastax.com/community enabled = 1 gpgcheck = 0Then exit and save the file with the command :wq (see the example below):
Step #3: Install Apache Cassandra 2At this point, installing Cassandra is as simple as running just one command:
yum -y install dsc20
Step #4: Get Cassandra RunningStart-Up Cassandra
systemctl start cassandraCheck Cassandra Service Status
systemctl status cassandraEnable Cassandra to Start at Boot
systemctl enable cassandraCheck Cassandra Node Status
nodetool statusIf you get an error such as: ‘Failed to connect to ’127.0.0.1:7199′: Connection refused’ Then visit the following tutorial: Error: Failed to connect to ’127.0.0.1:7199′: Connection refused (Cassandra) [SOLVED] Restart Cassandra
systemctl restart cassandraShutdown Cassandra
service cassandra stopEnter the Cassandra Command Line
cqlshThe cqlsh interface should look similar to: Connected to Test Cluster at localhost:9160. [cqlsh 4.1.1 | Cassandra 2.0.10 | CQL spec 3.1.1 | Thrift protocol 19.39.0] Use HELP for help. cqlsh>