MhnSkta
MhnSkta

Reputation: 83

Cassandra-i able to connect via sudo command but unable to connect via cqlsh

i am trying to run below command

#!/bin/bash 
cqlsh -u usename -p password -e "SELECT * from poh.ne_q_iam;" 

but m getting below error

Connection error: ('Unable to connect to any servers', {'127.0.0.1': Connection Shutdown('Connection <Asyncore Connection(140545783069776) 127.0.0.1:9042 (closed)> is already closed',)})

but when i try to run via sudo its working

sudo -u casadm cqlsh node-1 -u cassandra -p 3D4TMobile@ --ssl 

what will be cqlsh equivalent of above sudo command

Upvotes: 1

Views: 83

Answers (1)

Alex Ott
Alex Ott

Reputation: 87069

It looks like that the node is listening only on specific interface, and not on the localhost (127.0.0.1). You just need to add node-1 to the cqlsh command:

cqlsh -u usename -p password -e "SELECT * from poh.ne_q_iam;" node-1

Upvotes: 1

Related Questions