Bhaskar
Bhaskar

Reputation: 337

Connecting to Cassandra Instance Remotely using Linux Shell Script

I want to connect to Cassandra installed in a remote server from my dev environment. Dev Environment doesn't have cassandra installed and hence it is not allowing me to do the below for connecting to my cassandra server running on a different machine.

Client System - Dev System without Cassandra Destination System - Prod Environment where Cassandra is installed

I am trying the below command over my dev terminal to connect to Prod Cassandra.

/opt/cassandra/dse-4.8.7/bin/cqlsh -e "select * from /"IasService/"./"Table/" limit 10" remote.stress.py1.s.com 9160 -u test-p test2;

Any leads would be helpful.

Upvotes: 0

Views: 1296

Answers (1)

Aaron
Aaron

Reputation: 57748

tldr;

Remove the 9160 from your command.

It would be easier to help you if you provided the error message or result of your command.

That being said, DSE 4.8.7 has Cassandra 2.1.14 at its core. As of Cassandra 2.1, cqlsh connects using the native binary protocol on port 9042. So forcing it to 9160 (as you are) will definitely not work.

$ cqlsh -e "SELECT release_version FROM system.local" 192.168.6.5 9042 
  -u cassdba -p superSecret

 release_version
-----------------
          2.1.13

(1 rows)

And since 9042 is the default port used by cqlsh now, you don't need to specify it at all.

Upvotes: 1

Related Questions