0
votes
  • Cassandra is installed on a Virtual Machine ( IP address - 192.168.a.b) created using KVM on a Ubuntu host (H1) machine ( IP address - p.q.r.s)
  • Send cassandra stress command from another Ubuntu machine (H2)( IP address - p.q.r.t) which is in same network as H1
  • Ports 7000 and 9042 on H1 are forwarded to the same ports on the virtual machine using iptables on H1
  • When the listen_address and rpc_address of cassandra.yaml is set to the IP address of H1 (p.q.r.s) the following error is displayed

Unable to bind to address /p.q.r.s:7000 . Set listen_address in cassandra.yaml to an interface you can bind to, e.g., your private IP address on EC2​

  • My experiment requires a cluster of Cassandra on virtual machine installed on 3 host machines described like above. ( 1 VM per host machine)
1
You cannot bind to H1's IP address. Cassandra is not aware of that. Try binding it to an interface like eth0. I made an internal network on virtual box and configured the IP addresses manually just to make the cluster work. - Sreekar
Hey @Sreekar Thanks for the comment. How do you think I can bind it to the interface? I am using the machines in my university, so cant actually configure the IP addresses of the host machines and neither can I get new public addresses for the Virtual machines. Thank you - Mohit Vellanki
Try bridged networking, it will be easy, you will get a new IP address for your VM and it will be directly visible on the LAN. If that is not possible, you can give "eth0" or "eth1" at listen_interface to bind it to interface. Make sure you don't have any firewall running on VM, Still with this method, I'm not sure whether it will work though. - Sreekar
@Sreekar Does bridging the network on the host involve assigning a public IP to the VM? Because I think I cannot do that. I tried changing the listen_interface and it did not work as it could not find the interface. Thank you - Mohit Vellanki
In bridged netoworking, your VM will get it's own IP from the local DHCP server. If it's not possible, I mean if DHCP server rejects unknown servers on network, then bridged networking is not an option for you :( - Sreekar

1 Answers

0
votes

The only possible way I found was to assign public IP addresses to the virtual machines and use them.