Jump to: navigation, search

Deploying a Cassandra Cluster Node for a Single Data Center

Linux

Installation

  1. Download version 3.11.2 or higher from the Cassandra 3.11 stream.
  2. Unpack the archive into the installation directory, for example:


cd /genesys
tar xzf apache-cassandra-3.11.x-bin.tar.gz

{{NoteFormat|Do not use pathnames with spaces when installing Cassandra}.}

Configuration

  1. Go to the directory where you installed your Cassandra node.
  2. Edit conf/cassandra.yaml, using the following custom values:
    • cluster_name: cluster name without spaces, for example ucs9cassandracluster
    • seeds: <comma-separated list="" of="" fully="" qualified="" domain="" names="" (fqdn)="" or="" ip="" addresses="" one="" more="" cassandra="" nodes=""></comma-separated> Note: This value must be the same for all nodes. Here are two examples:
      • 192.168.0.1,192.168.0.3
      • host1.mydomain.com, host2.mydomain.com
    • storage_port: 7000 (default value)
    • listen_address: <current node="" ip="" address=""></current> (it's not possible to use a host name)
    • native_transport_port: 9042 (default value)
    • rpc_address: <current node="" ip="" address=""></current> (it's not possible to use a host name)
    • rpc_port: 9160 (default value)
    • endpoint_snitch: SimpleSnitch
    • write_request_timeout_in_ms: 30000 (increased from default)
    • batch_size_fail_threshold_in_kb: 16384 (increased from default)


Note: Genesys recommends that you use the same rack ID for all nodes in your data center. For more information about cassandra-topology.properties, refer to http://cassandra.apache.org/doc/latest/operating/snitch.html.
  1. In order to install Elasticsearch Cassandra plugin, copy all jar files from UCS installation directory/lib4cassandra to Cassandra installation directory/lib:

Setting Up a Cassandra Service

  1. Create the /etc/init.d/cassandra startup script.
  2. Edit the contents of the file:
  3. #!/bin/sh
    #
    # chkconfig: - 80 45
    # description: Starts and stops Cassandra
    # update daemon path to point to the cassandra executable
    DAEMON=<Cassandra_installation_dir>/bin/cassandra
    start() {
            echo -n "Starting Cassandra... "
            $DAEMON -p /var/run/cassandra.pid
            echo "OK"
            return 0
    }
    stop() {
            echo -n "Stopping Cassandra... "
            kill $(cat /var/run/cassandra.pid)
            echo "OK"
            return 0
    }
    case "$1" in
      start)
            start
            ;;
      stop)
            stop
            ;;
      restart)
            stop
            start
            ;;
      *)
            echo $"Usage: $0 {start|stop|restart}"
            exit 1
    esac
    exit $?
  1. Make the file executable: sudo chmod +x /etc/init.d/cassandra
  2. Add the new service to the list: sudo chkconfig --add cassandra
  3. Now you can manage the service from the command line:
  • sudo /etc/init.d/cassandra start
  • sudo /etc/init.d/cassandra stop
  1. Configure the service to be started automatically together with the VM: sudo chkconfig --level 2345 cassandra on

Windows

Installation

  1. Download version 3.11.2 or higher from the Cassandra stream.
  2. Unpack the archive into a path without spaces.


Configuration

  1. Go to the directory where you installed your Cassandra node.
  2. Edit cassandra.yaml, using the following custom values:
    • cluster_name: cluster name without spaces, for example UCS_Cassandra_Cluster
    • seeds: <comma-separated list="" of="" fully="" qualified="" domain="" names="" (fqdn)="" or="" ip="" addresses="" one="" more="" cassandra="" nodes=""></comma-separated> Note: This value must be the same for all nodes. Here are two examples:
      • 192.168.0.1,192.168.0.3
      • host1.mydomain.com, host2.mydomain.com
    • storage_port: 7000 (default value)
    • listen_address: <current node="" ip="" address=""></current> (it's not possible to use a host name)
    • native_transport_port: 9042 (default value)
    • rpc_address: <current node="" ip="" address=""></current> (it's not possible to use a host name)
    • rpc_port: 9160 (default value)
    • endpoint_snitch: SimpleSnitch
    • write_request_timeout_in_ms: 30000 (increased from default)
    • batch_size_fail_threshold_in_kb: 16384 (increased from default)


Note: Genesys recommends that you use the same rack ID for all nodes in your data center. For more information about cassandra-topology.properties, refer to http://cassandra.apache.org/doc/latest/operating/snitch.html.
  1. In order to install Elasticsearch Cassandra plugin, copy all jar files from UCS installation directory\lib4cassandra to Cassandra installation directory\lib:

  2. Start Cassandra.

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on May 18, 2018, at 06:55.