0

I'm having this issue below, I'm using google cloud VM

:~$ cqlsh

Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})

~$ cd /etc/cassandra/

I set my hosts like this

127.0.0.1 localhost



10.14*.0.* vm-1

10.15*.0.* vm-2

I got the ip from ifconfig

vm-1 inet addr:10.14*.0.* Bcast:10.14*.0.* Mask:255.255.255.255

vm-2 inet addr:10.15*.0.* Bcast:10.15*.0.* Mask:255.255.255.255

in cassandra.yaml

I set in VM-2

listen_address: 10.15*.0.*

rpc_address: 10.15*.0.*

and in cassandra-env.sh

JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=10.15*.0.*"

vm2@vm-2:/etc/cassandra$ netstat -nl | grep 7199
tcp        0      0 127.0.0.1:7199          0.0.0.0:*               LISTEN

It works only if I do:

vm2@vm-2:/etc/cassandra$ cqlsh vm-2
Connected to dc1 at vm-2:9042.
[cqlsh 5.0.1 | Cassandra 3.11.6 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh>

Is it possible to change the default ip to the one I use in my Listen_address?

Igor
  • 3
  • 3

1 Answers1

-3

Try using "cqlsh IP address". It should work. You may also you username and password if you configured in the cassandra.yaml.

LetsNoSQL
  • 1,478
  • 1
  • 11
  • 23