Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save avinash-mishra/e37d36d16fcee9f28d91446aeb5ba2e2 to your computer and use it in GitHub Desktop.
Save avinash-mishra/e37d36d16fcee9f28d91446aeb5ba2e2 to your computer and use it in GitHub Desktop.

Revisions

  1. @diegopacheco diegopacheco revised this gist Aug 18, 2016. 1 changed file with 20 additions and 0 deletions.
    20 changes: 20 additions & 0 deletions cassandra-cluster-ec2-linux.md
    Original file line number Diff line number Diff line change
    @@ -67,3 +67,23 @@ bin/cassandra start
    9160
    9042
    ```

    #### Test data replication with CQLSH

    ```bash
    # Connect to any node - you can run: hostname -i to get the IP
    apache-cassandra-2.1.9/bin/cqlsh IP
    ```
    ```bash
    CREATE KEYSPACE CLUSTER_TEST WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };
    USE CLUSTER_TEST;
    CREATE TABLE TEST ( key text PRIMARY KEY, value text);
    INSERT INTO TEST (key,value) VALUES ('1', 'works');
    SELECT * from TEST;
    ```
    ```bash
    # Connect to any other node - you can run: hostname -i to get the IP - check for data replication
    apache-cassandra-2.1.9/bin/cqlsh IP
    USE CLUSTER_TEST;
    SELECT * from TEST;
    ```
  2. @diegopacheco diegopacheco revised this gist Aug 18, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cassandra-cluster-ec2-linux.md
    Original file line number Diff line number Diff line change
    @@ -50,7 +50,7 @@ seed_provider:
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
    parameters:
    - seeds: "ip1,ip2,...ipN"
    endpoint_snitch: Ec2Snitch
    endpoint_snitch: GossipingPropertyFileSnitch
    ```
    #### Start up the cluster
  3. @diegopacheco diegopacheco revised this gist Aug 18, 2016. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions cassandra-cluster-ec2-linux.md
    Original file line number Diff line number Diff line change
    @@ -53,6 +53,14 @@ seed_provider:
    endpoint_snitch: Ec2Snitch
    ```
    #### Start up the cluster
    ```bash
    # on each cass node...
    cd ~/apache-cassandra-2.1.9
    bin/cassandra start
    ```

    #### Open EC2 Security Group ports
    ```bash
    7000
  4. @diegopacheco diegopacheco revised this gist Aug 18, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions cassandra-cluster-ec2-linux.md
    Original file line number Diff line number Diff line change
    @@ -46,6 +46,10 @@ vim ~/apache-cassandra-2.1.9/conf/cassandra.yaml
    cluster_name: 'Test Cluster'
    listen_address: your_server_ip
    rpc_address: your_server_ip
    seed_provider:
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
    parameters:
    - seeds: "ip1,ip2,...ipN"
    endpoint_snitch: Ec2Snitch
    ```
  5. @diegopacheco diegopacheco revised this gist Aug 18, 2016. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion cassandra-cluster-ec2-linux.md
    Original file line number Diff line number Diff line change
    @@ -36,6 +36,7 @@ rm -rf apache-cassandra-2.1.9-bin.tar.gz
    ```

    #### Configure the Clsuter

    ```bash
    # your_server_ip - copy the IP
    hostname -i
    @@ -46,4 +47,11 @@ cluster_name: 'Test Cluster'
    listen_address: your_server_ip
    rpc_address: your_server_ip
    endpoint_snitch: Ec2Snitch
    ```
    ```
    #### Open EC2 Security Group ports
    ```bash
    7000
    9160
    9042
    ```
  6. @diegopacheco diegopacheco revised this gist Aug 18, 2016. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions cassandra-cluster-ec2-linux.md
    Original file line number Diff line number Diff line change
    @@ -33,4 +33,17 @@ java -version
    wget https://archive.apache.org/dist/cassandra/2.1.9/apache-cassandra-2.1.9-bin.tar.gz
    tar -xzvf apache-cassandra-2.1.9-bin.tar.gz
    rm -rf apache-cassandra-2.1.9-bin.tar.gz
    ```

    #### Configure the Clsuter
    ```bash
    # your_server_ip - copy the IP
    hostname -i
    vim ~/apache-cassandra-2.1.9/conf/cassandra.yaml
    ```
    ```yaml
    cluster_name: 'Test Cluster'
    listen_address: your_server_ip
    rpc_address: your_server_ip
    endpoint_snitch: Ec2Snitch
    ```
  7. @diegopacheco diegopacheco revised this gist Aug 18, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion cassandra-cluster-ec2-linux.md
    Original file line number Diff line number Diff line change
    @@ -30,5 +30,7 @@ java -version

    #### Cassandra 2.x
    ```bash

    wget https://archive.apache.org/dist/cassandra/2.1.9/apache-cassandra-2.1.9-bin.tar.gz
    tar -xzvf apache-cassandra-2.1.9-bin.tar.gz
    rm -rf apache-cassandra-2.1.9-bin.tar.gz
    ```
  8. @diegopacheco diegopacheco created this gist Aug 18, 2016.
    34 changes: 34 additions & 0 deletions cassandra-cluster-ec2-linux.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    ## Cassandra 2.x Cluster on AWS EC2

    #### Install java 8
    ```bash
    # Remove java 7
    sudo yum remove -y java

    # Install basic packages
    sudo yum install -y git

    # Download and install java 8
    wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz"
    tar -xzvf jdk-8u45-linux-x64.tar.gz
    rm -rf jdk-8u45-linux-x64.tar.gz

    # Configure JAVA_HOME
    sudo vim ~/.bashrc
    ```
    ```bash
    alias cls='clear'

    export JAVA_HOME=~/jdk1.8.0_45
    export JRE_HOME=~/jdk1.8.0_45/jre
    export PATH=$PATH:~/jdk1.8.0_45/bin:/~/jdk1.8.0_45/jre/bin
    ```
    ```bash
    source ~/.bashrc
    java -version
    ```

    #### Cassandra 2.x
    ```bash

    ```