我的主要目标是让开发 Cassandra 实例在 Windows 上的 VirtualBox 中运行,并使用 Windows 主机中的 Datastax DevCenter 连接到它。我希望只使用 Datastax 沙箱,但我最终使用这种方法让它工作,该方法使用 Vagrant 在 Ubuntu VM 上设置 Cassandra;
https://github.com/bcantoni/vagrant-cassandra/tree/master/1.Base
这里有一个非常好的 Youtube 演练和书面说明。
让它工作后,我对 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.
我能够使用来自 windows 主机的10.211.54.10地址通过 DevCenter 进行连接。
这是托管 Cassandra 的 Ubuntu VM 的网络信息。
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)