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

Stephen Yuan Jiang commented on HBASE-12706:
--------------------------------------------

[~enis] In the review board, I mentioned that we could document the 2 formats 
(old way and new way) as supported format - internally, we can keep my current 
implementation (the confusing s1:p1, s2:p2, s3:p3:/hbase input would be the 
same as s1:p1, s2:p2, s3:p3:p3:/hbase - even the input is not supported, it 
would work as expected).  

Your modified change in ZKUtil.java need more changes:
{code}
+      String quorum = key.substring(0, key.length() - znode.length() - 1);
+      int clientPort = 2181; // use default client port, since it is already 
in the quorum string
+
+      return new ZKClusterKey(quorum, clientPort, znode);
{code}

- we need to parse the quorum and make sure that they are in correct format 
(server:port list separated by ,) - if not, throw exception.
- I also don't know hard-code the magic 2181 is desired - maybe using -1 to 
indicate the default client port is unused - (need more testing that it don't 
break anything).



> Support multiple port numbers in ZK quorum string
> -------------------------------------------------
>
>                 Key: HBASE-12706
>                 URL: https://issues.apache.org/jira/browse/HBASE-12706
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 1.0.0, 2.0.0
>            Reporter: Stephen Yuan Jiang
>            Assignee: Stephen Yuan Jiang
>            Priority: Critical
>             Fix For: 2.0.0, 1.1.0
>
>         Attachments: HBASE-12706.v1-branch-1.patch, 
> HBASE-12706.v2-master.patch, hbase-12706-alternate.patch
>
>
> HBase does not allow the zk quorum string to contain port numbers in this 
> format:
> {noformat}
> hostname1:port1,hostname2:port2,hostname3:port3
> {noformat}
> Instead it expects the string to be in this format:
> {noformat}
> hostname1,hostname2,hostname3:port3
> {noformat}
> And port 3 is used for all the client ports. We should flex the parsing so 
> that both forms are accepted.
> A sample exception:
> {code}
> java.io.IOException: Cluster key passed 
> host1:2181,host2:2181,host3:2181,host4:2181,host5:2181:2181:/hbase is 
> invalid, the format should 
> be:hbase.zookeeper.quorum:hbase.zookeeper.client.port:zookeeper.znode.parent
>       at 
> org.apache.hadoop.hbase.zookeeper.ZKUtil.transformClusterKey(ZKUtil.java:403)
>       at 
> org.apache.hadoop.hbase.zookeeper.ZKUtil.applyClusterKeyToConf(ZKUtil.java:386)
>       at 
> org.apache.hadoop.hbase.replication.ReplicationPeersZKImpl.getPeerConf(ReplicationPeersZKImpl.java:304)
>       at 
> org.apache.hadoop.hbase.replication.ReplicationPeersZKImpl.createPeer(ReplicationPeersZKImpl.java:435)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to