Install ApacheCassandra on Ubuntu

Source: Internet
Author: User
Tags cassandra
ApacheCassandra is a distributed, scalable, highly available, and fault-tolerant NoSQL database. It was first developed by facebook and then contributed to the Apache Foundation. Cassandra's data model is inspired by GoogleBigtable, and its distributed model is inspired by AmazonDynamo. If you want to learn more about Cassandra's design details, refer to a Facebook paper. This article describes

Apache Cassandra is a distributed, scalable, highly available, and fault-tolerant NoSQL database. It was first developed by facebook and then contributed to the Apache Foundation. Cassandra's data model is inspired by Google Bigtable, and its distributed model is inspired by Amazon Dynamo. If you want to learn more about Cassandra's design details, refer to a Facebook paper.

This article describes how to install Cassandra on Ubuntu 12.04.
  1. Run the following command to install the new update:
    1 sudo apt-get update
    2 sudo apt-get upgrade
  2. Open/etc/apt/sources. list
     
    1 sudo gedit /etc/apt/sources.list
    Add the following content to the sources. list file:
    1 deb http://www.apache.org/dist/cassandra/debian 10x main
    2 deb-src http://www.apache.org/dist/cassandra/debian 10x main
  3. Register and add the PGP key and update it again. Note that you need to modify the key accordingly.
    1 gpg --keyserver wwwkeys.pgp.net --recv-keys 4BD736A82B5C1B00
    2 sudo apt-key add ~/.gnupg/pubring.gpg
    3 sudo apt-get update
  4. Start to install Cassandra
    1 sudo apt-get install cassandra
  5. Start Cassandra Server
    1 sudo cassandra -f
    After startup, you will see the following information:
    1 ....
    2 ....
    3 ....
    4 INFO 12:18:29,140 Listening for thrift clients...
  6. To stop a process on the Cassandra server, you must first find its process id.
     
    1 ps auwx | grep cassandra
    The following output information indicates that the process id is 3595.
    1 root      3595  0.0  0.0  60048  1908 pts/0    S+   12:18   0:00 sudo cassandra -f
    Then use the kill command to terminate the Cassandra Service (although this method is rough)
    1 sudo kill
    After the process is stopped, you can see the following information in Thrift:
    1 INFO 13:04:08,663 Stop listening to thrift clients
    2 INFO 13:04:08,666 Waiting for messaging service to quiesce
    3 INFO 13:04:08,667 MessagingService shutting down server thread.
  7. You can also use the following command to start the Cassandra service.
    1 sudo /etc/init.d/cassandra start
  8. Run the following command to stop the Cassandra service:
    1 sudo /etc/init.d/cassandra stop
Install Cassandra and create the following directory:
  • /Var/lib/cassandra (data directories)
  • /Var/log/cassandra (log directory)
  • /Var/run/cassandra (runtime files)
  • /Usr/share/cassandra (environment settings)
  • /Usr/share/cassandra/lib (JAR files)
  • /Usr/bin (binary files)
  • /Usr/sbin
  • /Etc/cassandra (configuration files)
  • /Etc/init. d (service startup script)
  • /Etc/security/limits. d (cassandra user limits)
  • /Etc/default

Installing JNA on Linux will optimize Cassandra's memory usage. To install JNA, you only need to download jna from here. jar file, and save the file to the/usr/share/cassandra/lib directory.

If the following error occurs when you start the Cassandra server, it may be that Cassandra has started. You need to stop the running service first.

 
1 Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 7199; nested exception is: 
2  java.net.BindException: Address already in use

You can also use the binary installation method. For more information, see here.

Original English, OSCHINA Original translation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.