You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "maoling (JIRA)" <ji...@apache.org> on 2019/02/24 05:42:00 UTC

[jira] [Commented] (ZOOKEEPER-2503) Inconsistency between myid documentation and implementation

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

maoling commented on ZOOKEEPER-2503:
------------------------------------

when set the number of myid to a invalid one(e.g 256),we will get:

2019-02-24 05:40:01,095 [myid:] - INFO [main:QuorumPeerConfig@141] - Reading configuration from: /data/software/zookeeper/zookeeper-test3/bin/../conf/zoo.cfg
2019-02-24 05:40:01,103 [myid:] - WARN [main:VerifyingFileFactory@59] - ../../zkdata3 is relative. Prepend ./ to indicate that you're sure!
2019-02-24 05:40:01,104 [myid:] - WARN [main:VerifyingFileFactory@59] - ../../zkdataLog3 is relative. Prepend ./ to indicate that you're sure!
2019-02-24 05:40:01,110 [myid:] - INFO [main:QuorumPeerConfig@406] - clientPortAddress is 0.0.0.0:32181
2019-02-24 05:40:01,110 [myid:] - INFO [main:QuorumPeerConfig@410] - secureClientPort is not set
2019-02-24 05:40:01,110 [myid:] - INFO [main:QuorumPeerConfig@427] - observerMasterPort is not set
2019-02-24 05:40:01,110 [myid:] - INFO [main:QuorumPeerConfig@445] - metricsProvider.className is org.apache.zookeeper.metrics.impl.NullMetricsProvider
2019-02-24 05:40:01,120 [myid:256] - ERROR [main:QuorumPeerMain@94] - Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /data/software/zookeeper/zookeeper-test3/bin/../conf/zoo.cfg
 at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:162)
 at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:118)
 at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:87)
*Caused by: java.lang.IllegalArgumentException: myid must have a value between 1 and 255.*
 at org.apache.zookeeper.server.quorum.QuorumPeerConfig.setupMyId(QuorumPeerConfig.java:726)
 at org.apache.zookeeper.server.quorum.QuorumPeerConfig.setupQuorumPeerConfig(QuorumPeerConfig.java:638)
 at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:455)
 at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:158)
 ... 2 more
Invalid config, exiting abnormally

> Inconsistency between myid documentation and implementation
> -----------------------------------------------------------
>
>                 Key: ZOOKEEPER-2503
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2503
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.4.9, 3.5.2, 3.4.11
>            Reporter: Michael Han
>            Assignee: maoling
>            Priority: Major
>
> In ZK documentation, we have:
> "The myid file consists of a single line containing only the text of that machine's id. So myid of server 1 would contain the text "1" and nothing else. The id must be unique within the ensemble and should have a value between 1 and 255."
> This however is not enforced in code, which should be fixed either in documentation that we remove the restriction of the range 1-255 or in code we enforce such constraint.
>  Discussion thread:
>  [http://zookeeper-user.578899.n2.nabble.com/Is-myid-actually-limited-to-1-255-td7581270.html]
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)