OS: CentOS 6.4 (server)
I have successfully installed (yum install dsc20) the cassandra database layer in my server and can connect to it using the CQL SHel (cqlsh).
If there's somebody working with docker locally, it can run this command.
docker run --name cassandra -p 127.0.0.1:9042:9042 -p 127.0.0.1:9160:9160
-e CASSANDRA_LISTEN_ADDRESS=localhost
-e CASSANDRA_BROADCAST_ADDRESS=localhost
-e CASSANDRA_RPC_ADDRESS=localhost -d cassandra
DataStax DevCenter being built on top of the DataStax Java driver has the same connectivity requirements as the driver. Namely:
start_native_transport: true
rpc_address
: IP or hostname reachable from the client9042
(the native_transport_port
config option)If rpc_address
is set to either a private IP or to 0.0.0.0
, DevCenter will not know what node to connect to.
If your cluster has multiple nodes and these are using rpc_address: 0.0.0.0
, even if you configure DevCenter with the IP(s) of a couple of nodes, it will still have issues discovering the other nodes in the cluster.
In cassandra.yaml there's a comment/warning about using rpc_address: 0.0.0.0
:
Note that unlike ListenAddress above, it is allowed to specify 0.0.0.0 here if you want to listen on all interfaces, but that will break clients that rely on node auto-discovery.
Note: it is possible that in the future DevCenter might be able to ignore/filter out nodes in the cluster configured with rpc_address: 0.0.0.0
.
Try this.. It worked for me!
Run the following command on your machine where you have DevCenter installed
$> ssh -L 9042:localhost:9042 <username>@<ip-address-cassandra-db> -N
After running this command, it will prompt for password
Now in your DevCenter > Contact Hosts, provide "127.0.0.1" and test connection. Bingo, you see the magic...
In the cassandra.yaml, I set
After doing a
sudo service cassandra restart
DevCenter was able to successfully connect.
After this change, cqlsh would not start without the address:
cqlsh 1.2.3.4
You can set the environment variable $CQLSH_HOST=1.2.3.4. Then simply type cqlsh.