Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Cassandra, or Apache Cassandra, is a highly scalable open source NoSQL database system,
- # achieving great performance on multi-node setups.
- # install it to run a single-node cluster on Ubuntu 14.04.
- # Prerequisites:
- # Ubuntu 14.04 Droplet
- # A non-root user with sudo privileges (Initial Server Setup with Ubuntu 14.04 explains how to set this up.)
- # Step 1 — Installing the Oracle Java Virtual Machine
- # Cassandra requires that the Oracle Java SE Runtime Environment (JRE) be installed.
- # So, in this step, you'll install and verify that it's the default JRE.
- # make the Oracle JRE package available
- sudo add-apt-repository ppa:webupd8team/java
- # Update the package database:
- sudo apt-get update -y
- # install the Oracle JRE. Installing this particular package not only installs it but also makes it the default JRE.
- # When prompted, accept the license agreement:
- sudo apt-get install oracle-java8-set-default
- # verify that it's now the default JRE:
- java -version > install-log-cassandra.txt
- # Step 2 — Installing Cassandra
- # install Cassandra using packages from the official Apache Software Foundation repositories,
- # so start by adding the repo so that the packages are available to your system.
- echo "deb http://www.apache.org/dist/cassandra/debian 22x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
- # add the repo's source
- echo "deb-src http://www.apache.org/dist/cassandra/debian 22x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
- # To avoid package signature warnings during package updates, we need to add three public keys from the
- # Apache Software Foundation associated with the package repositories.
- gpg --keyserver pgp.mit.edu --recv-keys F758CE318D77295D
- gpg --export --armor F758CE318D77295D | sudo apt-key add -
- gpg --keyserver pgp.mit.edu --recv-keys 2B5C1B00
- gpg --export --armor 2B5C1B00 | sudo apt-key add -
- gpg --keyserver pgp.mit.edu --recv-keys 0353B12C
- gpg --export --armor 0353B12C | sudo apt-key add -
- # Update the package database once again:
- sudo apt-get update -y
- # Finally, install Cassandra:
- sudo apt-get install cassandra -y
- # Step 3 — Troubleshooting and Starting Cassandra
- # Ordinarily, Cassandra should have been started automatically at this point.
- # However, because of a bug, it does not. To confirm that it's not running, type:
- sudo service cassandra status >> install-log-cassandra.txt
- ### /etc/init.d/cassandra
- ### line 60
- ### CMD_PATT="cassandra.+CassandraDaemon" ==>> CMD_PATT="cassandra"
- sudo reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement