Apache Cassandra is a free and open-source distributed database management system designed for handling large amounts of data across multiple servers. Cassandra is known for its scalability, high availability, and support for complex data models. In this tutorial, we will show you how to install and configure Apache Cassandra on Rocky Linux 8.
Before starting, make sure that you have a Rocky Linux 8 server with a non-root user with sudo
privileges and a basic firewall configured.
Start by updating the package index and installing the required dependencies:
sudo dnf update
sudo dnf install java-1.8.0-openjdk-devel
Next, add the Apache Cassandra repository to the system by creating a new repository configuration file using your favorite text editor:
sudo vi /etc/yum.repos.d/cassandra.repo
Paste the following content into the file:
[cassandra]
name=Apache Cassandra
baseurl=https://www.apache.org/dist/cassandra/redhat/311x/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.apache.org/dist/cassandra/KEYS
Save the file and close the editor. Then, install Apache Cassandra by running the following command:
Copy code
sudo dnf install cassandra
After the installation is complete, start the Cassandra service and enable it to start automatically on boot:
sudo systemctl start cassandra
sudo systemctl enable cassandra
To verify that Cassandra is running and functioning properly, connect to the Cassandra shell using the following command:
cqlsh
You should see a prompt similar to this:
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.6 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help. cqlsh>
- Finally, open the Cassandra configuration file and update the
listen_address
andrpc_address
variables to match the server’s public IP address or hostname:
sudo vi /etc/cassandra/conf/cassandra.yaml
Update the listen and rpc_address
variables as follows:
listen_address: <server_public_ip_or_hostname>
rpc_address: <server_public_ip_or_hostname>
Save the file and close the editor. Then, restart the Cassandra service to apply the changes:
sudo systemctl restart cassandra
At this point, Apache Cassandra should be installed and configured on your Rocky Linux 8 server. You can now start using Cassandra to store and manage large amounts of data, and take advantage of its scalability and high availability features.
If you want to learn more about using Apache Cassandra, you can check the Cassandra documentation at **[https://cassandra.apache.org/doc/latest/](<https://cassandra.apache.org/doc/latest/>)**.
This documentation provides detailed information on how to use Cassandra and how to configure it for different use cases.
In this tutorial, we have shown you how to install and configure Apache Cassandra on Rocky Linux 8. We hope this tutorial has been helpful and you can now use Cassandra to store and manage your data.