Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have been using ccm for some time and it's pretty awesome tool to test out admin stuff. Now, I really want to test modeling data by trying to access ccm running cassandra using Thrift based pycassaShell client from remote hosts (not locally). My setup is like this:

Lets say, private IP of this machine is: 10.11.12.13 (Just an example)

lo    Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:16436  Metric:1
      RX packets:67392708 errors:0 dropped:0 overruns:0 frame:0
      TX packets:67392708 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:7398829042 (6.8 GiB)  TX bytes:7398829042 (6.8 GiB)

lo:1  Link encap:Local Loopback  
      inet addr:127.0.0.2  Mask:255.255.255.0
      UP LOOPBACK RUNNING  MTU:16436  Metric:1

lo:2  Link encap:Local Loopback  
      inet addr:127.0.0.3  Mask:255.0.0.0
      UP LOOPBACK RUNNING  MTU:16436  Metric:1

lo:3  Link encap:Local Loopback  
      inet addr:127.0.0.4  Mask:255.0.0.0
      UP LOOPBACK RUNNING  MTU:16436  Metric:1

and 127.0.0.1 (node1), 127.0.0.2 (node2), 127.0.0.3 (node3), 127.0.0.4 (node4)

$ ccm status
  node1: UP  
  node3: UP
  node2: UP
  node4: UP

How to connect to any of the instance from non-local hosts? When I do: pycassaShell --host 10.11.12.13 --port 9160, it throws an exception,

thrift.transport.TTransport.TTransportException: Could not connect to 10.11.12.13:9160

Is there a way to make it work?

References

In case you're unfamiliar,CCM, or Cassandra Cluster Manager is a script for managing instances of Cassandra nodes.

excerpt

A script/library to create, launch and remove a Apache Cassandra cluster on localhost.

The goal of ccm and ccmlib is to make is easy to create, manage and destroy a small cluster on a local box. It is meant for testing of a Cassandra cluster.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can establish a tunnel with ssh to make it appear that pycassaShell is connecting from the server running Cassandra.

On the remote host, establish a SSH tunnel with this -
ssh -N -L 9160:127.0.0.1:9160 10.11.12.13

Then on the remote host, run pycassaShell --host 127.0.0.1 --port 9160

Alternatively, you could setup ccm to listen on a non-localhost port.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.