简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM