Advertisement
henrydenhengst

Install Cassandra on a Single-Node Cluster of Ubuntu 14

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