Check all articles

Installation of Cassandra on Fedora 30

In this guide we install the Apache Cassandra database, which is a distributed NoSQL database. The goal is to create a single node in order to develop systems or test applications, it is not for a production environment. We are going to install it on the Fedora Linux operating system. For a Fedora Workstation 30 installation guide click here.


Install from the repository

Open a terminal and execute:

$sudo dnf -y install cassandra cassandra-server

CasandraScreen1

CasandraScreen2

Start the database

For starting the database, run:

$sudo service cassandra start

Configure for boot

With the following command when we restart the server also start cassandra:

$sudo chkconfig cassandra on

Create a KeySpace and the column family

After, cassandra was started. Perform:

$cqlsh

CasandraScreen3

cqlsh> CREATE KEYSPACE airline WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
cqlsh> USE airline;
cqlsh:airline>  CREATE COLUMNFAMILY Client (id text, LastName text, FirstName text, PRIMARY KEY(id));
cqlsh:airline>  INSERT INTO Client (id, LastName, FirstName) VALUES ('1', 'Leon', 'Juan');
cqlsh:airline>  SELECT * FROM Client;
cqlsh:airline>  quit;

CasandraScreen4

Add a port in the Firewall

In order to access the server remotely, add the entry to the firewall:

$sudo firewall-cmd --zone=public --add-port=9081/tcp --permanent
$sudo firewall-cmd --zone=public --add-port=9042/tcp --permanent
$sudo firewall-cmd --reload

And Ready!!!

We finished the installation of Apache Cassandra on Fedora Workstation 30.