cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mo Omer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-2380) Cassandra requires hostname is resolvable even when specifying IP's for listen and rpc addresses
Date Tue, 22 Apr 2014 15:26:16 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-2380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13976910#comment-13976910
] 

Mo Omer commented on CASSANDRA-2380:
------------------------------------

This is an issue, editing /etc/hosts isn't working for me on this network. I ended up using
`scutil --set HostName localhost` to resolve the issue.

java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

> Cassandra requires hostname is resolvable even when specifying IP's for listen and rpc
addresses
> ------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2380
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.4
>         Environment: open jdk 1.6.0_20 64-Bit 
>            Reporter: Eric Tamme
>            Priority: Trivial
>
> A strange looking error is printed out, with no stack trace and no other log, when hostname
is not resolvable regardless of whether or not the hostname is being used to specify a listen
or rpc address.  I am specifically using IPv6 addresses but I have tested it with IPv4 and
gotten the same result.
> Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name
unknown: java.net.UnknownHostException
> I have spent several hours trying to track down what is happening and have been unable
to determine if this is down in the java getByName->getAllByName->getAllByName0 set
of methods that is happening when  
> listenAddress = InetAddress.getByName(conf.listen_address);
> is called from DatabaseDescriptor.java
> I am not able to replicate the error in a stand alone java program (see below) so I am
not sure what cassandra is doing to force name resolution.  Perhaps the issue is not in DatabaseDescriptor,
but some where else?  I get no log output, and no stack trace when this happens, only the
single line error.
> import java.net.InetAddress;
> import java.net.UnknownHostException;
> class Test
> {
>     public static void main(String args[])
>     {
>         try
>         {
>             InetAddress listenAddress = InetAddress.getByName("foo");
>             System.out.println(listenAddress);
>         }
>         catch (UnknownHostException e)
>         {
>             System.out.println("Unable to parse address");
>         }
>     }
> }
> People have just said "oh go put a line in your hosts file" and while that does work,
it is not right.  If I am not using my hostname for any reason cassandra should not have to
resolve it, and carrying around that application specific stuff in your hosts file is not
correct.
> Regardless of if this bug gets fixed, I want to better understand what the heck is going
on that makes cassandra crash and print out that exception.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message