Skip to content

Instantly share code, notes, and snippets.

@ervinb
Created March 30, 2017 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ervinb/ba71eb6ed578f4793b275d1e6cbbe7f0 to your computer and use it in GitHub Desktop.
Save ervinb/ba71eb6ed578f4793b275d1e6cbbe7f0 to your computer and use it in GitHub Desktop.
##
# Exception:
# ThriftClient::NoServersAvailable:
# No live servers in [127.0.0.1:9160]
##
# install Cassandra Cluster Manager
$ sudo pip install ccm
# install Ruby driver
$ gem install cassandra-driver --no-ri --no-rdoc
# stop the system Cassandra service to free up the default port
$ sudo service cassandra stop
##
# Cassandra 2.1.2
##
$ ccm create -n 1 -v 2.1.2 -i 127.0.0. -s -b cluster-212
$ irb
> require 'cassandra'
> cluster = Cassandra.cluster
=> Cassandra::Errors::NoHostsAvailable: All attempted hosts failed: 127.0.0.1
# destroy cluster and stop instances
$ ccm clear
##
# Cassandra 2.1.17
##
$ ccm create -n 1 -v 2.1.17 -i 127.0.0. -s -b cluster-217
$ irb
> require 'cassandra'
> cluster = Cassandra.cluster
=> #<Cassandra::Cluster:0x3ff73a3ee600 name="cluster-217",
port=9042,
protocol_version=3,
execution_profiles={:default=>#<Cassandra::Execution::Profile:0x3ff73a3f4d20 load_balancing_policy=#<Cassandra::LoadBalancing::Policies::TokenAware:0x3ff73a3f4dfc policy=#<Cassandra::LoadBalancing::Policies::DCAwareRoundRobin:0x3ff73a3f4e9c datacenter="datacenter1",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment