HBase
  1. HBase
  2. HBASE-2305

Client port for ZK has no default

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.90.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      From Doug Meil on the list:

      config.set("hbase.zookeeper.property.clientPort","2181");
      
      This is consistent with other references to the importance of "hbase.zookeeper.quorum" except that we did this testing with the intent of connecting using only parameters set in code to eliminate any classpath issues with XML files.
      
      FYI... If the last parameter isn't set you'll get the following error....       could this be defaulted to a reasonable value?
      
      
      10/03/09 10:04:55 ERROR zookeeper.ZooKeeperWrapper: no clientPort found in zoo.cfg
      Exception in thread "main" java.io.IOException: Could not read quorum servers from zoo.cfg
           at org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper.<init>(ZooKeeperWrapper.java:85)
           at org.apache.hadoop.hbase.client.HConnectionManager$ClientZKWatcher.getZooKeeperWrapper(HConnectionManager.java:223)
           at org.apache.hadoop.hbase.client.HConnectionManager$TableServers.getZooKeeperWrapper(HConnectionManager.java:932)
           at org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRootRegion(HConnectionManager.java:948)
           at org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:625)
      

      It should be easy to set it to 2181 along with the other port settings in HQuorumPeer.

      1. HBASE-2305.patch
        3 kB
        Suraj Varma
      2. HBASE-2305-update1.patch
        3 kB
        Suraj Varma

        Activity

        Hide
        stack added a comment -

        Marking these as fixed against 0.21.0 rather than against 0.20.5.

        Show
        stack added a comment - Marking these as fixed against 0.21.0 rather than against 0.20.5.
        Hide
        stack added a comment -

        Committed branch and trunk. Thanks for the patch Suraj Varma.

        Show
        stack added a comment - Committed branch and trunk. Thanks for the patch Suraj Varma.
        Hide
        Suraj Varma added a comment -

        Thanks for your suggestions - I have incorporated them in this updated patch.

        Show
        Suraj Varma added a comment - Thanks for your suggestions - I have incorporated them in this updated patch.
        Hide
        Jean-Daniel Cryans added a comment -

        Some comments:

        • ZK_CFG_PROPERTY + "clientPort", should be made static final
        • This should really be 1 line:
        +      int clientPortValue = HQuorumPeer.DEFAULT_ZOOKEPER_CLIENT_PORT;
        +      zkProperties.put(clientPortKey, Integer.valueOf(clientPortValue))
        
        • assignDefaultsForMissingProperties is a bit misleading, put all the other missing properties in there if there's any. If not, don't create a new method just for that.
        • No need to call Integer.valueOf on ints.

        Thx for looking at this Suraj!

        Show
        Jean-Daniel Cryans added a comment - Some comments: ZK_CFG_PROPERTY + "clientPort", should be made static final This should really be 1 line: + int clientPortValue = HQuorumPeer.DEFAULT_ZOOKEPER_CLIENT_PORT; + zkProperties.put(clientPortKey, Integer .valueOf(clientPortValue)) assignDefaultsForMissingProperties is a bit misleading, put all the other missing properties in there if there's any. If not, don't create a new method just for that. No need to call Integer.valueOf on ints. Thx for looking at this Suraj!
        Hide
        Suraj Varma added a comment -

        Assigns a default zookeeper client port in case it is not specified in a configuration.

        Show
        Suraj Varma added a comment - Assigns a default zookeeper client port in case it is not specified in a configuration.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jean-Daniel Cryans
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development