Skip to content

Instantly share code, notes, and snippets.

@tmusabbir
Last active December 25, 2015 18:19
Show Gist options
  • Save tmusabbir/7019759 to your computer and use it in GitHub Desktop.
Save tmusabbir/7019759 to your computer and use it in GitHub Desktop.
Install Cassandra Cluster within 30 minutes
Install Cassandra Cluster within 30 minutes
cluster_name: 'Simple Cluster'
initial_token: -9223372036854775808
partitioner: org.apache.cassandra.dht.Murmur3Partitioner
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: ",,"
- seeds: "10.0.0.57,10.0.0.59"
listen_address: 10.0.0.57
rpc_address: 0.0.0.0
endpoint_snitch: Ec2Snitch
[root@ip-10-0-0-57 ~]# alternatives --install /usr/bin/java java /usr/java/jre1.6.0_43/bin/java 20000
[root@ip-10-0-0-57 ~]# alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
+ 1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
* 2 /usr/java/jre1.6.0_43/bin/java
Enter to keep the current selection[+], or type selection number: 2
[root@ip-10-0-0-57 ~]# java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.0.57 ip-10-0-0-57
10.0.0.58 ip-10-0-0-58
10.0.0.59 ip-10-0-0-59
[root@ip-10-0-0-57 cassandra]# nodetool -h localhost ring
Datacenter: us-east
==========
Replicas: 0
Address Rack Status State Load Owns Token
3074457345618258602
10.0.0.57 1b Up Normal 64.57 KB 33.33% -9223372036854775808
10.0.0.58 1b Up Normal 47.38 KB 33.33% -3074457345618258603
10.0.0.59 1b Up Normal 67.1 KB 33.33% 3074457345618258602
[root@ip-10-0-0-57 conf]# python -c 'print [str(((2**64 / 3) * i) - 2**63) for i in range(3)]'
['-9223372036854775808', '-3074457345618258603', '3074457345618258602']
[root@ip-10-0-0-14 ~]# token-generator 3
DC #1:
Node #1: 0
Node #2: 56713727820156410577229101238628035242
Node #3: 113427455640312821154458202477256070484
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment