avalanche123 / cassandra-web

A web interface for Apache Cassandra
http://avalanche123.com/cassandra-web/
MIT License
135 stars 52 forks source link

Cannot resolve hostname #19

Open ketigid opened 5 years ago

ketigid commented 5 years ago

Hi,

cassandra is the hostname of one of my cassandra nodes.

When I run cassandra-web --hosts cassandra, I get this error IPAddr::InvalidAddressError: invalid address: cassandra. Using the actual IP address works.

ping cassandra works fine.

Just to check, does cassandra-web only work with IP addresses and not hostnames?

saintube commented 4 years ago

@ketigid I think it was caused by the code below (bin/cassandra-web, line 74)

options[:load_balancing_policy] = ::Cassandra::LoadBalancing::Policies::WhiteList.new(hosts, ::Cassandra::LoadBalancing::Policies::RoundRobin.new)

WhiteList.new() would regard hosts as an IPAddr by default, so u got an error. BTW, DataStax Ruby driver supports DNS resolution by using resolv lib.