Skip to content

Instantly share code, notes, and snippets.

@lotusirous
Last active March 24, 2019 04:24
Show Gist options
  • Select an option

  • Save lotusirous/8ede738c761181aa36a1da13db898fe4 to your computer and use it in GitHub Desktop.

Select an option

Save lotusirous/8ede738c761181aa36a1da13db898fe4 to your computer and use it in GitHub Desktop.

Install production ready cassandra cluster

  1. Download cassandra
  2. Configure export CASSANDRA_HOME=/home/test/local/cassandra
  3. configure $CASSANDRA_HOME/conf/cassandra.yaml as follows:
cluster_name: '[Your Cluster Name]'
listen_address: [public_ip_address]
rpc_address: [public_ip_address]
endpoint_snitch: GossipingPropertyFileSnitch
seed_provider:
    # Addresses of hosts that are deemed contact points. 
    # Cassandra nodes use this list of hosts to find each other and learn
    # the topology of the ring.  You must change this if you are running
    # multiple nodes!
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
    parameters:
        # seeds is actually a comma-delimited list of addresses.
        # Ex: "<ip1>,<ip2>,<ip3>"
        - seeds: "127.0.0.1,192.168.72.163,192.168.72.162"
auto_bootstrap: false
  1. rm -rf $CASSANDRA_HOME/data/data/system/* if you installed a cluster before
  2. Start cluster $CASSANDRA_HOME/bin/cassandra

Verify our cluster:

[test@gamma cassandra]$ bin/nodetool status
Datacenter: dc1
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address         Load       Tokens       Owns (effective)  Host ID                               Rack
UN  192.168.72.162  161.27 KiB  256          100.0%            bb16fed5-e5a4-460f-9c6a-2bacb118fa87  rack1
UN  192.168.72.163  160.78 KiB  256          100.0%            b111d838-32f4-492f-b561-0375d849af78  rack1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment