You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Zhou wenjian (JIRA)" <ji...@apache.org> on 2012/11/07 04:10:12 UTC
[jira] [Created] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Zhou wenjian created HBASE-7111:
-----------------------------------
Summary: hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
Key: HBASE-7111
URL: https://issues.apache.org/jira/browse/HBASE-7111
Project: HBase
Issue Type: Bug
Components: Zookeeper
Affects Versions: 0.94.2
Reporter: Zhou wenjian
Assignee: Zhou wenjian
Fix For: 0.94.4
there are 3 zookeeper servers in my cluster.
s1
s2
s3
after killing s3, i found the hbase zkcli will not start again.
it will try to connect to s3 continuely.
/11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
from the code
public String parse(final Configuration c) {
// Note that we do not simply grab the property
// HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
// user may be using a zoo.cfg file.
Properties zkProps = ZKConfig.makeZKProps(c);
String host = null;
String clientPort = null;
for (Entry<Object, Object> entry: zkProps.entrySet()) {
String key = entry.getKey().toString().trim();
String value = entry.getValue().toString().trim();
if (key.startsWith("server.") && host == null) {
String[] parts = value.split(":");
host = parts[0];
} else if (key.endsWith("clientPort")) {
clientPort = value;
}
if (host != null && clientPort != null) break;
}
return host != null && clientPort != null? host + ":" + clientPort: null;
}
the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Posted by "Zhou wenjian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zhou wenjian updated HBASE-7111:
--------------------------------
Attachment: HBASE-7111-trunk.patch
> hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-7111
> URL: https://issues.apache.org/jira/browse/HBASE-7111
> Project: HBase
> Issue Type: Bug
> Components: Zookeeper
> Affects Versions: 0.94.2
> Reporter: Zhou wenjian
> Assignee: Zhou wenjian
> Fix For: 0.94.4
>
> Attachments: HBASE-7111-trunk.patch
>
>
> there are 3 zookeeper servers in my cluster.
> s1
> s2
> s3
> after killing s3, i found the hbase zkcli will not start again.
> it will try to connect to s3 continuely.
> /11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
> 12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> from the code
> public String parse(final Configuration c) {
> // Note that we do not simply grab the property
> // HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
> // user may be using a zoo.cfg file.
> Properties zkProps = ZKConfig.makeZKProps(c);
> String host = null;
> String clientPort = null;
> for (Entry<Object, Object> entry: zkProps.entrySet()) {
> String key = entry.getKey().toString().trim();
> String value = entry.getValue().toString().trim();
> if (key.startsWith("server.") && host == null) {
> String[] parts = value.split(":");
> host = parts[0];
> } else if (key.endsWith("clientPort")) {
> clientPort = value;
> }
> if (host != null && clientPort != null) break;
> }
> return host != null && clientPort != null? host + ":" + clientPort: null;
> }
> the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Posted by "Zhou wenjian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492898#comment-13492898 ]
Zhou wenjian commented on HBASE-7111:
-------------------------------------
will give a patch later
> hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-7111
> URL: https://issues.apache.org/jira/browse/HBASE-7111
> Project: HBase
> Issue Type: Bug
> Components: Zookeeper
> Affects Versions: 0.94.2
> Reporter: Zhou wenjian
> Assignee: Zhou wenjian
> Fix For: 0.94.4
>
>
> there are 3 zookeeper servers in my cluster.
> s1
> s2
> s3
> after killing s3, i found the hbase zkcli will not start again.
> it will try to connect to s3 continuely.
> /11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
> 12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> from the code
> public String parse(final Configuration c) {
> // Note that we do not simply grab the property
> // HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
> // user may be using a zoo.cfg file.
> Properties zkProps = ZKConfig.makeZKProps(c);
> String host = null;
> String clientPort = null;
> for (Entry<Object, Object> entry: zkProps.entrySet()) {
> String key = entry.getKey().toString().trim();
> String value = entry.getValue().toString().trim();
> if (key.startsWith("server.") && host == null) {
> String[] parts = value.split(":");
> host = parts[0];
> } else if (key.endsWith("clientPort")) {
> clientPort = value;
> }
> if (host != null && clientPort != null) break;
> }
> return host != null && clientPort != null? host + ":" + clientPort: null;
> }
> the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Posted by "Zhou wenjian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493030#comment-13493030 ]
Zhou wenjian commented on HBASE-7111:
-------------------------------------
The testcase modified could assert my change.
And i have tested it in my local test cluster, if one of the zookeeper server in conf works, the script will connect to zookeeper
> hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-7111
> URL: https://issues.apache.org/jira/browse/HBASE-7111
> Project: HBase
> Issue Type: Bug
> Components: Zookeeper
> Affects Versions: 0.94.2
> Reporter: Zhou wenjian
> Assignee: Zhou wenjian
> Fix For: 0.94.4
>
> Attachments: HBASE-7111-trunk.patch, HBASE-7111-trunk-v2.patch
>
>
> there are 3 zookeeper servers in my cluster.
> s1
> s2
> s3
> after killing s3, i found the hbase zkcli will not start again.
> it will try to connect to s3 continuely.
> /11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
> 12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> from the code
> public String parse(final Configuration c) {
> // Note that we do not simply grab the property
> // HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
> // user may be using a zoo.cfg file.
> Properties zkProps = ZKConfig.makeZKProps(c);
> String host = null;
> String clientPort = null;
> for (Entry<Object, Object> entry: zkProps.entrySet()) {
> String key = entry.getKey().toString().trim();
> String value = entry.getValue().toString().trim();
> if (key.startsWith("server.") && host == null) {
> String[] parts = value.split(":");
> host = parts[0];
> } else if (key.endsWith("clientPort")) {
> clientPort = value;
> }
> if (host != null && clientPort != null) break;
> }
> return host != null && clientPort != null? host + ":" + clientPort: null;
> }
> the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492889#comment-13492889 ]
stack commented on HBASE-7111:
------------------------------
Random seems fine but won't it just fail if we happen to choose the wrong one? Why not a loop trying all ensemble members (as long as it times out fas). You have a patch for us Zhou? Thanks.
> hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-7111
> URL: https://issues.apache.org/jira/browse/HBASE-7111
> Project: HBase
> Issue Type: Bug
> Components: Zookeeper
> Affects Versions: 0.94.2
> Reporter: Zhou wenjian
> Assignee: Zhou wenjian
> Fix For: 0.94.4
>
>
> there are 3 zookeeper servers in my cluster.
> s1
> s2
> s3
> after killing s3, i found the hbase zkcli will not start again.
> it will try to connect to s3 continuely.
> /11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
> 12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> from the code
> public String parse(final Configuration c) {
> // Note that we do not simply grab the property
> // HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
> // user may be using a zoo.cfg file.
> Properties zkProps = ZKConfig.makeZKProps(c);
> String host = null;
> String clientPort = null;
> for (Entry<Object, Object> entry: zkProps.entrySet()) {
> String key = entry.getKey().toString().trim();
> String value = entry.getValue().toString().trim();
> if (key.startsWith("server.") && host == null) {
> String[] parts = value.split(":");
> host = parts[0];
> } else if (key.endsWith("clientPort")) {
> clientPort = value;
> }
> if (host != null && clientPort != null) break;
> }
> return host != null && clientPort != null? host + ":" + clientPort: null;
> }
> the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492647#comment-13492647 ]
stack commented on HBASE-7111:
------------------------------
What did you have in your configuration? Just z3?
> hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-7111
> URL: https://issues.apache.org/jira/browse/HBASE-7111
> Project: HBase
> Issue Type: Bug
> Components: Zookeeper
> Affects Versions: 0.94.2
> Reporter: Zhou wenjian
> Assignee: Zhou wenjian
> Fix For: 0.94.4
>
>
> there are 3 zookeeper servers in my cluster.
> s1
> s2
> s3
> after killing s3, i found the hbase zkcli will not start again.
> it will try to connect to s3 continuely.
> /11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
> 12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> from the code
> public String parse(final Configuration c) {
> // Note that we do not simply grab the property
> // HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
> // user may be using a zoo.cfg file.
> Properties zkProps = ZKConfig.makeZKProps(c);
> String host = null;
> String clientPort = null;
> for (Entry<Object, Object> entry: zkProps.entrySet()) {
> String key = entry.getKey().toString().trim();
> String value = entry.getValue().toString().trim();
> if (key.startsWith("server.") && host == null) {
> String[] parts = value.split(":");
> host = parts[0];
> } else if (key.endsWith("clientPort")) {
> clientPort = value;
> }
> if (host != null && clientPort != null) break;
> }
> return host != null && clientPort != null? host + ":" + clientPort: null;
> }
> the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Posted by "Zhou wenjian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492917#comment-13492917 ]
Zhou wenjian commented on HBASE-7111:
-------------------------------------
patch for trunk
> hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-7111
> URL: https://issues.apache.org/jira/browse/HBASE-7111
> Project: HBase
> Issue Type: Bug
> Components: Zookeeper
> Affects Versions: 0.94.2
> Reporter: Zhou wenjian
> Assignee: Zhou wenjian
> Fix For: 0.94.4
>
> Attachments: HBASE-7111-trunk.patch
>
>
> there are 3 zookeeper servers in my cluster.
> s1
> s2
> s3
> after killing s3, i found the hbase zkcli will not start again.
> it will try to connect to s3 continuely.
> /11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
> 12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> from the code
> public String parse(final Configuration c) {
> // Note that we do not simply grab the property
> // HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
> // user may be using a zoo.cfg file.
> Properties zkProps = ZKConfig.makeZKProps(c);
> String host = null;
> String clientPort = null;
> for (Entry<Object, Object> entry: zkProps.entrySet()) {
> String key = entry.getKey().toString().trim();
> String value = entry.getValue().toString().trim();
> if (key.startsWith("server.") && host == null) {
> String[] parts = value.split(":");
> host = parts[0];
> } else if (key.endsWith("clientPort")) {
> clientPort = value;
> }
> if (host != null && clientPort != null) break;
> }
> return host != null && clientPort != null? host + ":" + clientPort: null;
> }
> the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Posted by "Zhou wenjian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492089#comment-13492089 ]
Zhou wenjian commented on HBASE-7111:
-------------------------------------
IMO, need to choose a random server to connect, rather than the fixed one which is depended on the properties reading from conf
> hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-7111
> URL: https://issues.apache.org/jira/browse/HBASE-7111
> Project: HBase
> Issue Type: Bug
> Components: Zookeeper
> Affects Versions: 0.94.2
> Reporter: Zhou wenjian
> Assignee: Zhou wenjian
> Fix For: 0.94.4
>
>
> there are 3 zookeeper servers in my cluster.
> s1
> s2
> s3
> after killing s3, i found the hbase zkcli will not start again.
> it will try to connect to s3 continuely.
> /11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
> 12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> from the code
> public String parse(final Configuration c) {
> // Note that we do not simply grab the property
> // HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
> // user may be using a zoo.cfg file.
> Properties zkProps = ZKConfig.makeZKProps(c);
> String host = null;
> String clientPort = null;
> for (Entry<Object, Object> entry: zkProps.entrySet()) {
> String key = entry.getKey().toString().trim();
> String value = entry.getValue().toString().trim();
> if (key.startsWith("server.") && host == null) {
> String[] parts = value.split(":");
> host = parts[0];
> } else if (key.endsWith("clientPort")) {
> clientPort = value;
> }
> if (host != null && clientPort != null) break;
> }
> return host != null && clientPort != null? host + ":" + clientPort: null;
> }
> the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Posted by "Zhou wenjian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zhou wenjian updated HBASE-7111:
--------------------------------
Attachment: HBASE-7111-trunk-v2.patch
> hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-7111
> URL: https://issues.apache.org/jira/browse/HBASE-7111
> Project: HBase
> Issue Type: Bug
> Components: Zookeeper
> Affects Versions: 0.94.2
> Reporter: Zhou wenjian
> Assignee: Zhou wenjian
> Fix For: 0.94.4
>
> Attachments: HBASE-7111-trunk.patch, HBASE-7111-trunk-v2.patch
>
>
> there are 3 zookeeper servers in my cluster.
> s1
> s2
> s3
> after killing s3, i found the hbase zkcli will not start again.
> it will try to connect to s3 continuely.
> /11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
> 12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> from the code
> public String parse(final Configuration c) {
> // Note that we do not simply grab the property
> // HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
> // user may be using a zoo.cfg file.
> Properties zkProps = ZKConfig.makeZKProps(c);
> String host = null;
> String clientPort = null;
> for (Entry<Object, Object> entry: zkProps.entrySet()) {
> String key = entry.getKey().toString().trim();
> String value = entry.getValue().toString().trim();
> if (key.startsWith("server.") && host == null) {
> String[] parts = value.split(":");
> host = parts[0];
> } else if (key.endsWith("clientPort")) {
> clientPort = value;
> }
> if (host != null && clientPort != null) break;
> }
> return host != null && clientPort != null? host + ":" + clientPort: null;
> }
> the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492956#comment-13492956 ]
stack commented on HBASE-7111:
------------------------------
Please follow coding style the rest of the file has. Any chance of a unit test asserting your change does as you suggest? Thanks.
> hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-7111
> URL: https://issues.apache.org/jira/browse/HBASE-7111
> Project: HBase
> Issue Type: Bug
> Components: Zookeeper
> Affects Versions: 0.94.2
> Reporter: Zhou wenjian
> Assignee: Zhou wenjian
> Fix For: 0.94.4
>
> Attachments: HBASE-7111-trunk.patch
>
>
> there are 3 zookeeper servers in my cluster.
> s1
> s2
> s3
> after killing s3, i found the hbase zkcli will not start again.
> it will try to connect to s3 continuely.
> /11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
> 12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> from the code
> public String parse(final Configuration c) {
> // Note that we do not simply grab the property
> // HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
> // user may be using a zoo.cfg file.
> Properties zkProps = ZKConfig.makeZKProps(c);
> String host = null;
> String clientPort = null;
> for (Entry<Object, Object> entry: zkProps.entrySet()) {
> String key = entry.getKey().toString().trim();
> String value = entry.getValue().toString().trim();
> if (key.startsWith("server.") && host == null) {
> String[] parts = value.split(":");
> host = parts[0];
> } else if (key.endsWith("clientPort")) {
> clientPort = value;
> }
> if (host != null && clientPort != null) break;
> }
> return host != null && clientPort != null? host + ":" + clientPort: null;
> }
> the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-7111) hbase zkcli will not start if the
zookeeper server choosen to connectted to is not available
Posted by "Zhou wenjian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492882#comment-13492882 ]
Zhou wenjian commented on HBASE-7111:
-------------------------------------
[~saint.ack@gmail.com]
i have s1,s2,s3 in my configuration
but the script will always choose s3 which is unavailable
> hbase zkcli will not start if the zookeeper server choosen to connectted to is not available
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-7111
> URL: https://issues.apache.org/jira/browse/HBASE-7111
> Project: HBase
> Issue Type: Bug
> Components: Zookeeper
> Affects Versions: 0.94.2
> Reporter: Zhou wenjian
> Assignee: Zhou wenjian
> Fix For: 0.94.4
>
>
> there are 3 zookeeper servers in my cluster.
> s1
> s2
> s3
> after killing s3, i found the hbase zkcli will not start again.
> it will try to connect to s3 continuely.
> /11/07 11:01:01 INFO zookeeper.ClientCnxn: Opening socket connection to server s3
> 12/11/07 11:01:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> from the code
> public String parse(final Configuration c) {
> // Note that we do not simply grab the property
> // HConstants.ZOOKEEPER_QUORUM from the HBaseConfiguration because the
> // user may be using a zoo.cfg file.
> Properties zkProps = ZKConfig.makeZKProps(c);
> String host = null;
> String clientPort = null;
> for (Entry<Object, Object> entry: zkProps.entrySet()) {
> String key = entry.getKey().toString().trim();
> String value = entry.getValue().toString().trim();
> if (key.startsWith("server.") && host == null) {
> String[] parts = value.split(":");
> host = parts[0];
> } else if (key.endsWith("clientPort")) {
> clientPort = value;
> }
> if (host != null && clientPort != null) break;
> }
> return host != null && clientPort != null? host + ":" + clientPort: null;
> }
> the code will choose the fixed zookeeper server (here is the unavailable s3), which leads to the script fails
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira