Discussion:
Can not connect with cqlsh to something different than localhost
Richard Snowden
2014-12-08 04:43:45 UTC
Permalink
I am running Cassandra 2.1.2 in an Ubuntu VM.

"cqlsh" or "cqlsh localhost" works fine.

But I can not connect from outside the VM (firewall, etc. disabled).

Even when I do "cqlsh 192.168.111.136" in my VM I get connection refused.
This is strange because when I check my network config I can see that
192.168.111.136 is my IP:

***@ubuntu:~# ifconfig

eth0 Link encap:Ethernet HWaddr 00:0c:29:02:e0:de
inet addr:192.168.111.136 Bcast:192.168.111.255
Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16042 errors:0 dropped:0 overruns:0 frame:0
TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21307125 (21.3 MB) TX bytes:709471 (709.4 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:148053 (148.0 KB) TX bytes:148053 (148.0 KB)


***@ubuntu:~# cqlsh 192.168.111.136 9042
Connection error: ('Unable to connect to any servers', {'192.168.111.136':
error(111, "Tried connecting to [('192.168.111.136', 9042)]. Last error:
Connection refused")})


What to do?
Michael Dykman
2014-12-08 04:54:26 UTC
Permalink
Try:
$ netstat -lnt
and see which interface port 9042 is listening on. You will likely need to
update cassandra.yaml to change the interface. By default, Cassandra is
listening on localhost so your local cqlsh session works.
Post by Richard Snowden
I am running Cassandra 2.1.2 in an Ubuntu VM.
"cqlsh" or "cqlsh localhost" works fine.
But I can not connect from outside the VM (firewall, etc. disabled).
Even when I do "cqlsh 192.168.111.136" in my VM I get connection refused.
This is strange because when I check my network config I can see that
eth0 Link encap:Ethernet HWaddr 00:0c:29:02:e0:de
inet addr:192.168.111.136 Bcast:192.168.111.255
Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16042 errors:0 dropped:0 overruns:0 frame:0
TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21307125 (21.3 MB) TX bytes:709471 (709.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:148053 (148.0 KB) TX bytes:148053 (148.0 KB)
Connection refused")})
What to do?
Richard Snowden
2014-12-08 10:49:28 UTC
Permalink
This did not work either. I changed /etc/cassandra.yaml and restarted
Cassandra (I even restarted the machine to make 100% sure).

What I tried:

1) "listen_address: localhost"
-> connection OK (but of course I can't connect from outside the VM
to "localhost")

2) Set "listen_interface: eth0"
-> connection refused

3) Set "listen_address: 192.168.111.136"
-> connection refused


What to do?
Post by Michael Dykman
$ netstat -lnt
and see which interface port 9042 is listening on. You will likely need to
update cassandra.yaml to change the interface. By default, Cassandra is
listening on localhost so your local cqlsh session works.
Post by Richard Snowden
I am running Cassandra 2.1.2 in an Ubuntu VM.
"cqlsh" or "cqlsh localhost" works fine.
But I can not connect from outside the VM (firewall, etc. disabled).
Even when I do "cqlsh 192.168.111.136" in my VM I get connection refused.
This is strange because when I check my network config I can see that
eth0 Link encap:Ethernet HWaddr 00:0c:29:02:e0:de
inet addr:192.168.111.136 Bcast:192.168.111.255
Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16042 errors:0 dropped:0 overruns:0 frame:0
TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21307125 (21.3 MB) TX bytes:709471 (709.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:148053 (148.0 KB) TX bytes:148053 (148.0 KB)
Connection refused")})
What to do?
Vivek Mishra
2014-12-08 10:54:18 UTC
Permalink
Two things:
1. Try telnet 192.168.111.136 9042 and see if it connects?
2. check for hostname in /etc/hosts, if it is mapped correctly.

-Vivek
This did not work either. I changed /etc/cassandra.yaml and restarted Cassandra (I even restarted the machine to make 100% sure).
1) "listen_address: localhost"
-> connection OK (but of course I can't connect from outside the VM to "localhost")
2) Set "listen_interface: eth0"
-> connection refused
3) Set "listen_address: 192.168.111.136"
-> connection refused
What to do?
Post by Michael Dykman
$ netstat -lnt
and see which interface port 9042 is listening on. You will likely need to
update cassandra.yaml to change the interface. By default, Cassandra is
listening on localhost so your local cqlsh session works.
Post by Richard Snowden
I am running Cassandra 2.1.2 in an Ubuntu VM.
"cqlsh" or "cqlsh localhost" works fine.
But I can not connect from outside the VM (firewall, etc. disabled).
Even when I do "cqlsh 192.168.111.136" in my VM I get connection refused.
This is strange because when I check my network config I can see that
eth0 Link encap:Ethernet HWaddr 00:0c:29:02:e0:de
inet addr:192.168.111.136 Bcast:192.168.111.255
Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16042 errors:0 dropped:0 overruns:0 frame:0
TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21307125 (21.3 MB) TX bytes:709471 (709.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:148053 (148.0 KB) TX bytes:148053 (148.0 KB)
Connection refused")})
What to do?
Jonathan Haddad
2014-12-08 11:18:55 UTC
Permalink
Listen address needs the actual address, not the interface. This is best
accomplished by setting up proper hostnames for each machine (through DNS
or hosts file) and leaving listen_address blank, as it will pick the
external ip. Otherwise, you'll need to set the listen address to the IP of
the machine you want on each machine. I find the former to be less of a
pain to manage.

On Mon Dec 08 2014 at 2:49:55 AM Richard Snowden <
This did not work either. I changed /etc/cassandra.yaml and restarted Cassandra (I even restarted the machine to make 100% sure).
1) "listen_address: localhost"
-> connection OK (but of course I can't connect from outside the VM to "localhost")
2) Set "listen_interface: eth0"
-> connection refused
3) Set "listen_address: 192.168.111.136"
-> connection refused
What to do?
Post by Michael Dykman
$ netstat -lnt
and see which interface port 9042 is listening on. You will likely need to
update cassandra.yaml to change the interface. By default, Cassandra is
listening on localhost so your local cqlsh session works.
Post by Richard Snowden
I am running Cassandra 2.1.2 in an Ubuntu VM.
"cqlsh" or "cqlsh localhost" works fine.
But I can not connect from outside the VM (firewall, etc. disabled).
Even when I do "cqlsh 192.168.111.136" in my VM I get connection refused.
This is strange because when I check my network config I can see that
eth0 Link encap:Ethernet HWaddr 00:0c:29:02:e0:de
inet addr:192.168.111.136 Bcast:192.168.111.255
Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16042 errors:0 dropped:0 overruns:0 frame:0
TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21307125 (21.3 MB) TX bytes:709471 (709.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:148053 (148.0 KB) TX bytes:148053 (148.0 KB)
Connection refused")})
What to do?
Richard Snowden
2014-12-08 12:18:50 UTC
Permalink
I left listen_address blank - still I can't connect (connection refused).

"cqlsh" -> OK
"cqlsh ubuntu" -> fail ("ubuntu" is my hostname)
"cqlsh 192.168.111.136" -> fail

"telnet 192.168.111.136 9042" from outside the VM gives me a "connection
refused".

I just started a Tomcat in my VM and did a "telnet 192.168.111.136 8080"
from outside the VM - and got the expected result ("Connected to
192.168.111.136. Escape character is '^]'.

So what's so special in Cassandra?
Post by Jonathan Haddad
Listen address needs the actual address, not the interface. This is best
accomplished by setting up proper hostnames for each machine (through DNS
or hosts file) and leaving listen_address blank, as it will pick the
external ip. Otherwise, you'll need to set the listen address to the IP of
the machine you want on each machine. I find the former to be less of a
pain to manage.
On Mon Dec 08 2014 at 2:49:55 AM Richard Snowden <
This did not work either. I changed /etc/cassandra.yaml and restarted Cassandra (I even restarted the machine to make 100% sure).
1) "listen_address: localhost"
-> connection OK (but of course I can't connect from outside the VM to "localhost")
2) Set "listen_interface: eth0"
-> connection refused
3) Set "listen_address: 192.168.111.136"
-> connection refused
What to do?
Post by Michael Dykman
$ netstat -lnt
and see which interface port 9042 is listening on. You will likely need to
update cassandra.yaml to change the interface. By default, Cassandra is
listening on localhost so your local cqlsh session works.
Post by Richard Snowden
I am running Cassandra 2.1.2 in an Ubuntu VM.
"cqlsh" or "cqlsh localhost" works fine.
But I can not connect from outside the VM (firewall, etc. disabled).
Even when I do "cqlsh 192.168.111.136" in my VM I get connection refused.
This is strange because when I check my network config I can see that
eth0 Link encap:Ethernet HWaddr 00:0c:29:02:e0:de
inet addr:192.168.111.136 Bcast:192.168.111.255
Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16042 errors:0 dropped:0 overruns:0 frame:0
TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21307125 (21.3 MB) TX bytes:709471 (709.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:148053 (148.0 KB) TX bytes:148053 (148.0 KB)
Connection refused")})
What to do?
Michael Dykman
2014-12-08 18:30:32 UTC
Permalink
The difference is what interface your service is listening on. What is the
output of

$ netstat -ntl | grep 9042
Post by Richard Snowden
I left listen_address blank - still I can't connect (connection refused).
"cqlsh" -> OK
"cqlsh ubuntu" -> fail ("ubuntu" is my hostname)
"cqlsh 192.168.111.136" -> fail
"telnet 192.168.111.136 9042" from outside the VM gives me a "connection
refused".
I just started a Tomcat in my VM and did a "telnet 192.168.111.136 8080"
from outside the VM - and got the expected result ("Connected to
192.168.111.136. Escape character is '^]'.
So what's so special in Cassandra?
Post by Jonathan Haddad
Listen address needs the actual address, not the interface. This is best
accomplished by setting up proper hostnames for each machine (through DNS
or hosts file) and leaving listen_address blank, as it will pick the
external ip. Otherwise, you'll need to set the listen address to the IP of
the machine you want on each machine. I find the former to be less of a
pain to manage.
On Mon Dec 08 2014 at 2:49:55 AM Richard Snowden <
This did not work either. I changed /etc/cassandra.yaml and restarted Cassandra (I even restarted the machine to make 100% sure).
1) "listen_address: localhost"
-> connection OK (but of course I can't connect from outside the VM to "localhost")
2) Set "listen_interface: eth0"
-> connection refused
3) Set "listen_address: 192.168.111.136"
-> connection refused
What to do?
Post by Michael Dykman
$ netstat -lnt
and see which interface port 9042 is listening on. You will likely need to
update cassandra.yaml to change the interface. By default, Cassandra is
listening on localhost so your local cqlsh session works.
Post by Richard Snowden
I am running Cassandra 2.1.2 in an Ubuntu VM.
"cqlsh" or "cqlsh localhost" works fine.
But I can not connect from outside the VM (firewall, etc. disabled).
Even when I do "cqlsh 192.168.111.136" in my VM I get connection refused.
This is strange because when I check my network config I can see that
eth0 Link encap:Ethernet HWaddr 00:0c:29:02:e0:de
inet addr:192.168.111.136 Bcast:192.168.111.255
Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16042 errors:0 dropped:0 overruns:0 frame:0
TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21307125 (21.3 MB) TX bytes:709471 (709.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:148053 (148.0 KB) TX bytes:148053 (148.0 KB)
Connection refused")})
What to do?
Richard Snowden
2014-12-08 19:21:12 UTC
Permalink
$ netstat -ntl | grep 9042
tcp6 0 0 127.0.0.1:9042 :::* LISTEN

("listen_address" not set in cassandra.yaml)

Even with "listen_address: 192.168.111.136" I get:
$ netstat -ntl | grep 9042
tcp6 0 0 127.0.0.1:9042 :::* LISTEN


All I want to do is to access Cassandra from outside my VM. Is this really
that hard?
Post by Michael Dykman
The difference is what interface your service is listening on. What is the
output of
$ netstat -ntl | grep 9042
Post by Richard Snowden
I left listen_address blank - still I can't connect (connection refused).
"cqlsh" -> OK
"cqlsh ubuntu" -> fail ("ubuntu" is my hostname)
"cqlsh 192.168.111.136" -> fail
"telnet 192.168.111.136 9042" from outside the VM gives me a "connection
refused".
I just started a Tomcat in my VM and did a "telnet 192.168.111.136 8080"
from outside the VM - and got the expected result ("Connected to
192.168.111.136. Escape character is '^]'.
So what's so special in Cassandra?
Post by Jonathan Haddad
Listen address needs the actual address, not the interface. This is
best accomplished by setting up proper hostnames for each machine (through
DNS or hosts file) and leaving listen_address blank, as it will pick the
external ip. Otherwise, you'll need to set the listen address to the IP of
the machine you want on each machine. I find the former to be less of a
pain to manage.
On Mon Dec 08 2014 at 2:49:55 AM Richard Snowden <
This did not work either. I changed /etc/cassandra.yaml and restarted Cassandra (I even restarted the machine to make 100% sure).
1) "listen_address: localhost"
-> connection OK (but of course I can't connect from outside the VM to "localhost")
2) Set "listen_interface: eth0"
-> connection refused
3) Set "listen_address: 192.168.111.136"
-> connection refused
What to do?
Post by Michael Dykman
$ netstat -lnt
and see which interface port 9042 is listening on. You will likely need to
update cassandra.yaml to change the interface. By default, Cassandra is
listening on localhost so your local cqlsh session works.
Post by Richard Snowden
I am running Cassandra 2.1.2 in an Ubuntu VM.
"cqlsh" or "cqlsh localhost" works fine.
But I can not connect from outside the VM (firewall, etc. disabled).
Even when I do "cqlsh 192.168.111.136" in my VM I get connection refused.
This is strange because when I check my network config I can see that
eth0 Link encap:Ethernet HWaddr 00:0c:29:02:e0:de
inet addr:192.168.111.136 Bcast:192.168.111.255
Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16042 errors:0 dropped:0 overruns:0 frame:0
TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21307125 (21.3 MB) TX bytes:709471 (709.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:148053 (148.0 KB) TX bytes:148053 (148.0 KB)
Connection refused")})
What to do?
Sam Tunnicliffe
2014-12-08 19:49:01 UTC
Permalink
rpc_address (or rpc_interface) is used for client connections,
listen_address is for inter-node communication.
Post by Michael Dykman
$ netstat -ntl | grep 9042
tcp6 0 0 127.0.0.1:9042 :::*
LISTEN
("listen_address" not set in cassandra.yaml)
$ netstat -ntl | grep 9042
tcp6 0 0 127.0.0.1:9042 :::*
LISTEN
All I want to do is to access Cassandra from outside my VM. Is this really
that hard?
Post by Michael Dykman
The difference is what interface your service is listening on. What is
the output of
$ netstat -ntl | grep 9042
Post by Richard Snowden
I left listen_address blank - still I can't connect (connection refused).
"cqlsh" -> OK
"cqlsh ubuntu" -> fail ("ubuntu" is my hostname)
"cqlsh 192.168.111.136" -> fail
"telnet 192.168.111.136 9042" from outside the VM gives me a "connection
refused".
I just started a Tomcat in my VM and did a "telnet 192.168.111.136 8080"
from outside the VM - and got the expected result ("Connected to
192.168.111.136. Escape character is '^]'.
So what's so special in Cassandra?
Post by Jonathan Haddad
Listen address needs the actual address, not the interface. This is
best accomplished by setting up proper hostnames for each machine (through
DNS or hosts file) and leaving listen_address blank, as it will pick the
external ip. Otherwise, you'll need to set the listen address to the IP of
the machine you want on each machine. I find the former to be less of a
pain to manage.
On Mon Dec 08 2014 at 2:49:55 AM Richard Snowden <
This did not work either. I changed /etc/cassandra.yaml and restarted Cassandra (I even restarted the machine to make 100% sure).
1) "listen_address: localhost"
-> connection OK (but of course I can't connect from outside the VM to "localhost")
2) Set "listen_interface: eth0"
-> connection refused
3) Set "listen_address: 192.168.111.136"
-> connection refused
What to do?
Post by Michael Dykman
$ netstat -lnt
and see which interface port 9042 is listening on. You will likely need to
update cassandra.yaml to change the interface. By default, Cassandra is
listening on localhost so your local cqlsh session works.
Post by Richard Snowden
I am running Cassandra 2.1.2 in an Ubuntu VM.
"cqlsh" or "cqlsh localhost" works fine.
But I can not connect from outside the VM (firewall, etc. disabled).
Even when I do "cqlsh 192.168.111.136" in my VM I get connection refused.
This is strange because when I check my network config I can see that
eth0 Link encap:Ethernet HWaddr 00:0c:29:02:e0:de
inet addr:192.168.111.136 Bcast:192.168.111.255
Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16042 errors:0 dropped:0 overruns:0 frame:0
TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21307125 (21.3 MB) TX bytes:709471 (709.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:148053 (148.0 KB) TX bytes:148053 (148.0 KB)
Connection refused")})
What to do?
Richard Snowden
2014-12-08 21:25:02 UTC
Permalink
Ah! That did the trick!

Thanks Sam!
Post by Sam Tunnicliffe
rpc_address (or rpc_interface) is used for client connections,
listen_address is for inter-node communication.
Post by Michael Dykman
$ netstat -ntl | grep 9042
tcp6 0 0 127.0.0.1:9042 :::*
LISTEN
("listen_address" not set in cassandra.yaml)
$ netstat -ntl | grep 9042
tcp6 0 0 127.0.0.1:9042 :::*
LISTEN
All I want to do is to access Cassandra from outside my VM. Is this
really that hard?
Post by Michael Dykman
The difference is what interface your service is listening on. What is
the output of
$ netstat -ntl | grep 9042
Post by Richard Snowden
I left listen_address blank - still I can't connect (connection refused).
"cqlsh" -> OK
"cqlsh ubuntu" -> fail ("ubuntu" is my hostname)
"cqlsh 192.168.111.136" -> fail
"telnet 192.168.111.136 9042" from outside the VM gives me a
"connection refused".
I just started a Tomcat in my VM and did a "telnet 192.168.111.136
8080" from outside the VM - and got the expected result ("Connected to
192.168.111.136. Escape character is '^]'.
So what's so special in Cassandra?
Post by Jonathan Haddad
Listen address needs the actual address, not the interface. This is
best accomplished by setting up proper hostnames for each machine (through
DNS or hosts file) and leaving listen_address blank, as it will pick the
external ip. Otherwise, you'll need to set the listen address to the IP of
the machine you want on each machine. I find the former to be less of a
pain to manage.
On Mon Dec 08 2014 at 2:49:55 AM Richard Snowden <
This did not work either. I changed /etc/cassandra.yaml and restarted Cassandra (I even restarted the machine to make 100% sure).
1) "listen_address: localhost"
-> connection OK (but of course I can't connect from outside the VM to "localhost")
2) Set "listen_interface: eth0"
-> connection refused
3) Set "listen_address: 192.168.111.136"
-> connection refused
What to do?
Post by Michael Dykman
$ netstat -lnt
and see which interface port 9042 is listening on. You will likely need to
update cassandra.yaml to change the interface. By default, Cassandra is
listening on localhost so your local cqlsh session works.
Post by Richard Snowden
I am running Cassandra 2.1.2 in an Ubuntu VM.
"cqlsh" or "cqlsh localhost" works fine.
But I can not connect from outside the VM (firewall, etc. disabled).
Even when I do "cqlsh 192.168.111.136" in my VM I get connection refused.
This is strange because when I check my network config I can see that
eth0 Link encap:Ethernet HWaddr 00:0c:29:02:e0:de
inet addr:192.168.111.136 Bcast:192.168.111.255
Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16042 errors:0 dropped:0 overruns:0 frame:0
TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21307125 (21.3 MB) TX bytes:709471 (709.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:148053 (148.0 KB) TX bytes:148053 (148.0 KB)
Connection refused")})
What to do?
Loading...