Reputation: 876
I am trying to set up a test Cassandra 3.3 cluster on Ubuntu 15.10 with OpenJDK 1.8. The nodes can't talk to each other because Cassandra only listens on the loopback interface, as netstat
shows.
tcp 0 0 127.0.0.1:7199 0.0.0.0:* LISTEN
tcp6 0 0 127.0.0.1:9042 :::* LISTEN
I have tried to insert my external IP address in /etc/cassandra/cassandra.yml.
listen_address
: I tried the actual external IP address and leaving the field empty.
rpc_address
: I tried the actual external IP address and 0.0.0.0.
I also tried modifying the following in /etc/cassandra/cassandra-env.sh.
JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=<actual external IP address>"
Between each change I stop the service, delete /var/lib/cassandra/data/system, and restart the service.
How does one configure the interface Cassandra listens to?
Upvotes: 3
Views: 5658
Reputation: 57748
rpc_address
is the address that external app clients will use to connect with Cassandra.
listen_address
is the address that Cassandra will use to connect to other Cassandra nodes.
I would make sure that your nodes can communicate on that IP. Specifically, Cassandra will use port 7000 for inter-node communication (7001 if using node-to-node SSL). The best way to test this is with telnet. If it works, this is what you will see:
$ telnet 192.168.0.101 7000
Trying 192.168.0.101...
Connected to 192.168.0.101.
Escape character is '^]'.
So I would:
listen_address
.Upvotes: 4