How to Install Apache Cassandra on Debian 11 / Debian 10 | Holhol24

0 8

Apache Cassandra, or just Cassandra, is an open-source allotted database control gadget designed to maintain massive quantities of knowledge throughout many commodity servers, offering top availability with out a unmarried level of failure.

Every Cassandra node within the cluster could have the similar position. Data is sent around the cluster, which means that every node holds other knowledge. Also, it helps replication and multi-datacenter replication for redundancy, failover, and crisis restoration.

Here, we will be able to see methods to set up Apache Cassandra on Debian 11 / Debian 10.

Install Java

Update repository index.

sudo apt replace

Apache Cassandra calls for the most recent edition of Java 8. But, OpenJDK 8 isn’t to be had in Debian 11/10. Also, Cassandra 4.0  helps Java 11 (EXPERIMENTAL). So, we will be able to use OpenJDK 11 instead of OpenJDK 8.

# Debian 11

sudo apt set up -y openjdk-11-jre

# Debian 10

sudo apt set up -y openjdk-8-jre

Check the Java edition put up the set up of OpenJDK.

java -version

You gets an identical output like underneath.

openjdk edition "11.0.12" 2021-07-20
OpenJDK Runtime Environment (construct 11.0.12+7-post-Debian-2)
OpenJDK 64-Bit Server VM (construct 11.0.12+7-post-Debian-2, combined mode, sharing)

Add Apache Cassandra Repository

We will set up Cassandra the use of the legitimate Debian repository supplied by means of Apache Software Foundation.

First, upload the general public key of the Cassandra repository to the gadget.

sudo apt set up -y curl

curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key upload -

Add Cassandra repository on your gadget with the underneath command.

echo "deb https://downloads.apache.org/cassandra/debian 40x main" | sudo tee -a /and many others/apt/assets.record.d/cassandra.assets.record

Install Apache Cassandra on Debian

First, replace the repository index.

sudo apt replace

Then, set up Cassandra with the underneath command.

sudo apt set up -y cassandra

You can to find Cassandra’s configuration recordsdata in /and many others/cassandra and the logs and information are in /var/log/cassandra/ and /var/lib/cassandra, respectively.

Ensure Cassandra is up and operating with the underneath command.

sudo systemctl standing cassandra

You gets an identical output like underneath.

 cassandra.carrier - LSB: allotted garage gadget for structured knowledge
     Loaded: loaded (/and many others/init.d/cassandra; generated)
     Active: energetic (operating) since Sat 2021-08-28 12:22:57 CDT; 21min in the past
       Docs: guy:systemd-sysv-generator(8)
    Process: 5336 ExecStart=/and many others/init.d/cassandra get started (code=exited, standing=0/SUCCESS)
      Tasks: 69 (prohibit: 2321)
     Memory: 1.3G
        CPU: 1min 7.794s
     CGroup: /gadget.slice/cassandra.carrier
             └─5461 java -ea -da:web.openhft... -XX:+UseThreadPriorities -XX:+HeapDumpOnOutOfMemoryError -Xss256k -XX:+AlwaysPreTouch -XX:-UseBiasedLocking -XX:+UseTLA>

Aug 28 12:22:57 debian11.holhol24.native systemd[1]: Starting LSB: allotted garage gadget for structured knowledge...
Aug 28 12:22:57 debian11.holhol24.native systemd[1]: Started LSB: allotted garage gadget for structured knowledge.

Verify Apache Cassandra Cluster

Wait for a minute to let the cluster comes on-line. Then, you’ll be able to test the Cassandra cluster by means of executing the underneath command.

sudo nodetool standing

The underneath output confirms that the Cassandra cluster is up and operating.

Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (efficient)  Host ID                               Rack
UN  127.0.0.1  69.05 KiB  16      100.0%            fb0e8bf7-dcf4-41a6-96de-e8f230f1b797  rack1

Means,

UCluster is UP
NCluster is Normal

Connect to the Cassandra cluster the use of the cqlsh command.

cqlsh

You are actually attached to the cluster.

Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.0.0 | Cassandra 4.0.0 | CQL spec 3.4.5 | Native protocol v5]
Use HELP for lend a hand.
cqlsh>

Conclusion

That’s All. I am hoping you realized methods to set up Apache Cassandra on Debian 11 / Debian 10. You can now cross forward and configure Apache Cassandra as in keeping with your requirement.

Leave A Reply

Your email address will not be published.

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

I agree to these terms.