1. Whirr
  2. WHIRR-338

byon cluster with hostnames defined in /etc/hosts


    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.6.0
    • Component/s: core
    • Labels:


      Basically the subject combined with the single-line patch should make it clear, what follows is the long story.

      I am unable to get HBase to work when using BYON nodes due to the following error:

      2011-07-14 14:46:07,837 FATAL org.apache.hadoop.hbase.master.HMaster: Unhandled exception. Starting shutdown.
      java.lang.IllegalArgumentException: Wrong FS: hdfs://, expected: hdfs://ubuntutest2
              at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:410)
              at org.apache.hadoop.hdfs.DistributedFileSystem.checkPath(DistributedFileSystem.java:106)

      The situation is I'm using two VirtualBox instances whose hostnames I defined manually through /etc/hosts

      In the byon yaml file, I specify the host by IP address:

          - id: ubuntutest2

      When specifying the hostname instead, I get an error when starting Whirr:

      invalid IP address: ubuntutest2

      This message is produced in the constructor of Cluster.Instance, earlier Whirr got the address by calling NodeMetadata.getPublicAddresses(), so jclouds returns there a hostname rather than an address (which might be considered a bug in jclouds, but even if it returned an ip address, the problem described next stays true).

      Back to the case where I specify the IP address in the byon yaml:

      The address in the hdfs URL is determined in HBaseMasterClusterActionHandler and comes down to:


      which is determined by xbill/dnsjava (see DnsUtil), which does not make use of /etc/hosts.

      As fix (see attached patch), I propose to fall back to Java's getCanonicalHostName() in case dnsjava did not return any results.


        Bruno Dumon created issue -
        Bruno Dumon added a comment - Added patch, also available as https://github.com/bdumon/whirr/commit/8d44cf874619c0b5bafae1e7da834ef047fc224e
        Bruno Dumon made changes -
        Field Original Value New Value
        Attachment WHIRR-338.patch [ 12486596 ]
        Tom White added a comment -

        I've just committed this. Thanks, Bruno!

        Tom White added a comment - I've just committed this. Thanks, Bruno!
        Tom White made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Bruno Dumon [ bruno ]
        Fix Version/s 0.6.0 [ 12316468 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        5h 12m 1 Tom White 15/Jul/11 19:19


          • Assignee:
            Bruno Dumon
            Bruno Dumon
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: