0

Using Win7 host, Ubuntu 14.04 LTS guest, VM Player4.0 and Datastax 4.8.11 Cassandra 2.1.17

My application on the same VM is unable to connect to a service running on the same VM. Everything was working fine but suddenly not. It is a Cassandra service and the service is up and running- I can see nothing in the logs. cqlsh unable to connect to server. I am successfully starting dse and datastax-agent and they are all running fine, including cassandra. The error is:

ubuntu:~$ cqlsh Connection error: ('Unable to connect to any servers', {'192.168.254.143': error(113, "Tried connecting to [('192.168.254.143', 9042)]. Last error: No route to host")}

Tried rebooting VM and my VM Player also, also tried below but did not help

$ sudo service network-manager restart

@ubuntu:~$ ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:0c:29:0f:c0:d4  
          inet addr:192.168.254.145  Bcast:192.168.254.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:c0d4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1152 errors:0 dropped:0 overruns:0 frame:0
          TX packets:887 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:803063 (803.0 KB)  TX bytes:156336 (156.3 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:546 errors:0 dropped:0 overruns:0 frame:0
          TX packets:546 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:61405 (61.4 KB)  TX bytes:61405 (61.4 KB)

@ubuntu:~$ sudo netstat -anp|grep 9042

[sudo] password for xxxxx: 
@ubuntu:~$

No output

l@ubuntu:~$ route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 192.168.254.2 0.0.0.0 UG 0 0 0 eth0

192.168.254.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0

Thanks

(posted on stack overflow did not get response trying here - sorry for duplicate)

karel
  • 110,292
  • 102
  • 269
  • 299
Sam-T
  • 173
  • 3
  • 12
  • Can you give more information - OS on Guest and OS on host? What is your virtual network configuration. Have you disabled the network on the VM player ? – Rostislav Kandilarov Nov 30 '16 at 15:06
  • @Rostislav Kandilarov I am having Win7 host, Ubuntu 14.04 LTS guest. I don't know my 'virtual network configuration'- how? I didn't enable/disable network on my VM Player- I see the Network Adpater NAT: **Status Connected**? I can browse the web from my VM. How do I confirm the setting? – Sam-T Nov 30 '16 at 16:10
  • Give us info about the result of `ifconfig -a` and `sudo netstat -anp|grep 9042` and `route -n` of your Ubuntu. – Rostislav Kandilarov Nov 30 '16 at 21:03
  • @Rostislav Kandilarov - Added debug info in main question, Thx – Sam-T Nov 30 '16 at 22:38
  • Is vmplayer network adapter in bridged mode? What is setting the IP of the host to 192.168.254.145 ? Do you have DHCP enabled - seems that the IP have changed from 192.168.254.143 to 145 during reboots. So do you have some router with DHCP and bridged network? Try adding a static ARP/lease entry if this is the case. – Rostislav Kandilarov Nov 30 '16 at 23:28
  • Based on my VMPlayer network setting that I can see - I am on NAT (**not bridged**). In Windows (host mc) I have 2 Vmware network adapters - both have **DHCP Not enabled** and **bridge protocol not checked**. But my windows network (home wifi) has DHCP enabled. How do I - adding a static ARP/lease – Sam-T Dec 01 '16 at 00:03
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/49403/discussion-between-rostislav-kandilarov-and-sam-t). – Rostislav Kandilarov Dec 01 '16 at 00:58
  • I think this has to do with **DHCP** - my VM IP is changing and does not match the IP in Cassandra config (**how to make static IP?**). I tried cqlsh providing it new IP : cqlsh 192.168.254.146 9160. I tried both ports 9160 (rpc_port) and 9042 (native_transport_port) both don't work (**which one to use?**). But the error msg is different now "Connection refused" (instead of no route to host). (Details of my VM network setup in main Q.) So nonetheless still stuck. – Sam-T Dec 01 '16 at 21:42
  • Updated .yaml rpc_address and listen_address to localhost, restarted Cassandra (DSE/datastax-agent). Now cqlsh tried to go to 127.0.0.1/9042 - but again "Connection refused". – Sam-T Dec 01 '16 at 23:44

0 Answers0