Search code examples
datastaxwindows-dev-center

Need help connected to datastax sandbox from windows 10 host running VirtualBox


  1. Sandbox up and running in Virtual Box, bridged. My VM's IP is 192.168.14.200.
  2. I can connect to ops center from my windows host by going to http://192.168.14.200:8888, as well as from within the VM by browsing to http://127.0.0.1:8888.
  3. I can run DevCenter from within the VM, whose connection is localhost:9042
  4. I downloaded DevCenter to my Windows 10 host and setup a connection to 192.168.14.200:9042, which fails to connect:

    The specified host(s) could not be reached.
    All host(s) tried for query failed (tried: /192.168.14.200:9042(com.datastax.driver.core.TransportException: [/192.168.14.200:9042] Cannot connect))
    

I have the same problem from within my C# code that throws a connection exception. I think if I can solve the DevCenter issue my C# code will work.

I have tried the following changes to the sandboxes cassandra.yaml file;

Change the listen_address by excluding it, changing it from localhost to 127.0.0.1, and 192.168.14.200, as well as with rpc_address.

At this point I am at a loss and any help just getting DevCenter working would be a great start.


Solution

  • My main goal was to get a development Cassandra instance running in VirtualBox on windows and connect to it using Datastax DevCenter from the Windows Host. I was hoping to just use the Datastax sandbox, but I ultimately got it working using this method which was using Vagrant to setup Cassandra on an Ubuntu VM;

    https://github.com/bcantoni/vagrant-cassandra/tree/master/1.Base
    There is a very nice Youtube walkthrough and written instructions here.

    After getting this to work, I made the following changes to cassandra.yaml;

    Comment out listen_address  
    Un-comment listen_interface: eth0
    
    Comment out rpc_address  
    Un-comment rpc_interface: eth1
    
    kill the CassandraDaemon  
    restart Cassandra.  
    

    I was able to use the 10.211.54.10 address from the windows host to connect via DevCenter.

    Here is the network information of the Ubuntu VM which is hosting Cassandra.

    vagrant@cassandra:~/apache-cassandra-3.4$ ifconfig  
    eth0      
    Link encap:Ethernet  HWaddr 08:00:27:c9:24:d6  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0  
          inet6 addr: fe80::a00:27ff:fec9:24d6/64 Scope:Link  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1  
          RX packets:138562 errors:0 dropped:0 overruns:0 frame:0  
          TX packets:33785 errors:0 dropped:0 overruns:0 carrier:0  
          collisions:0 txqueuelen:1000  
          RX bytes:125767502 (125.7 MB)  TX bytes:2587641 (2.5 MB)  
    
    eth1      
    Link encap:Ethernet  HWaddr 08:00:27:2e:5d:ae  
          inet addr:10.211.54.10  Bcast:10.211.54.255  Mask:255.255.255.0  
          inet6 addr: fe80::a00:27ff:fe2e:5dae/64 Scope:Link  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1  
          RX packets:680 errors:0 dropped:0 overruns:0 frame:0  
          TX packets:110 errors:0 dropped:0 overruns:0 carrier:0  
          collisions:0 txqueuelen:1000  
          RX bytes:95365 (95.3 KB)  TX bytes:36810 (36.8 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:126277 errors:0 dropped:0 overruns:0 frame:0  
          TX packets:126277 errors:0 dropped:0 overruns:0 carrier:0  
          collisions:0 txqueuelen:0  
          RX bytes:6395285 (6.3 MB)  TX bytes:6395285 (6.3 MB)