Uploaded image for project: 'Bookkeeper'
  1. Bookkeeper
  2. BOOKKEEPER-618

Better resolution of bookie address

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.2.1
    • Fix Version/s: 4.2.2, 4.3.0
    • Component/s: bookkeeper-server
    • Labels:
      None

      Description

      Bookie#getBookieAddress uses the following code:

      Bookie.java
          /**
           * Return the configured address of the bookie.
           */
          public static InetSocketAddress getBookieAddress(ServerConfiguration conf)
                  throws UnknownHostException {
              return new InetSocketAddress(InetAddress.getLocalHost()
                      .getHostAddress(), conf.getBookiePort());
          }
      

      This code is subject to the contents of one's /etc/hosts file, in that if they have an entry like 127.0.0.1 myhostname, this method will return the same 127.0.0.1 address on all bookie servers. This causes conflicts due to the way bookies register in zookeeper.

      There should be an optional bk_server.conf setting to allow one to select their preferred network interface to use for the bookie. Then you could use something like NetworkInterface.getByName(PREFERRED_INTERFACE).getInetAddresses() instead. This method is not effected by the /etc/hosts.

      An alternative method of registering the bookie that does not rely on the local address would be another possible solution, such as using the DNS like other apache projects (hbase).

        Attachments

        1. BOOKKEEPER-618.branch4-2.diff
          38 kB
          Ivan Kelly
        2. BOOKKEEPER-618.branch4-2.diff
          37 kB
          Ivan Kelly
        3. 0001-BOOKKEEPER-618-Better-resolution-of-bookie-address.patch
          42 kB
          Ivan Kelly

          Activity

            People

            • Assignee:
              ikelly Ivan Kelly
              Reporter:
              bbeaudreault Bryan Beaudreault
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: