You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Leonard Cuff <lc...@valueclick.com> on 2009/10/09 06:28:54 UTC

Struggling with a simple configuration file.

I¹ve been developing for ZooKeeper for a couple months now, recently running
in a test configuration with 3 ZooKeeper servers. I¹m running 3.2.1 with no
problems. Recently I tried to move to a single server configuration for the
development team environment, but couldn¹t get the configuration to work. I
get the error java.lang.RuntimeException: My id 0 not in the peer list

This would seem to imply that the myid file is set to zero. But ...it¹s set
to 1. 

What¹s puzzling to me is my original configuration of servers was this:

server.1=ind104.an.dev.fastclick.net:2182:2183   <--- The machine I¹m trying
to run standalone on.
server.2=build101.an.dev.fastclick.net:2182:2183
server.3=cmedia101.an.dev.fastclick.net:2182:2183

I just removed the last two lines, and ran zkServer.sh start.  It fails with
the described log message. (Full log given below).
When I put the server.2 and server.3 lines back in, it works fine, and is
following the build101 machine.

I decided to try changing the server.1 to server.0, also changed the myid
file contents from 1 to zero.  I get a very different error scenario: A
continuously-occurring Null Pointer exception:

2009-10-09 04:22:36,284 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
Unexpected exception
java.lang.NullPointerException
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
stLeaderElection.java:466)
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
erElection.java:635)
        at 
org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)

I¹m at a loss to know where I¹ve gone astray.

Thanks in advance for any and all help.

Leonard

--- the first log

2009-10-09 04:08:58,769 - INFO  [main:QuorumPeerConfig@80] - Reading
configuration from:
/vcm/home/sandbox/ticket_161758-1/vcm/component/zookeeper/conf/zoo.cfg.dev
2009-10-09 04:08:58,795 - INFO  [main:QuorumPeerMain@118] - Starting quorum
peer
2009-10-09 04:08:58,845 - FATAL [main:QuorumPeerMain@86] - Unexpected
exception, exiting abnormally
java.lang.RuntimeException: My id 0 not in the peer list
    at 
org.apache.zookeeper.server.quorum.QuorumPeer.startLeaderElection(QuorumPeer
.java:333)
    at 
org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:314)
    at 
org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMa
in.java:137)
    at 
org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPee
rMain.java:102)
    at 
org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:7
5)

-- the second log

2009-10-09 04:22:36,284 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
Unexpected exception
java.lang.NullPointerException
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
stLeaderElection.java:466)
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
erElection.java:635)
        at 
org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
2009-10-09 04:22:36,285 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
LOOKING
2009-10-09 04:22:36,285 - INFO
[QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
2009-10-09 04:22:36,285 - INFO
[QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
43050, 0, LOOKING, LOOKING, 0
2009-10-09 04:22:36,285 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
Unexpected exception
java.lang.NullPointerException
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
stLeaderElection.java:466)
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
erElection.java:635)
        at 
org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
2009-10-09 04:22:36,286 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
LOOKING
2009-10-09 04:22:36,286 - INFO
[QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
2009-10-09 04:22:36,286 - INFO
[QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
43051, 0, LOOKING, LOOKING, 0
2009-10-09 04:22:36,286 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
Unexpected exception
java.lang.NullPointerException
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
stLeaderElection.java:466)
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
erElection.java:635)
        at 
org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
2009-10-09 04:22:36,286 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
LOOKING
2009-10-09 04:22:36,287 - INFO
[QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
2009-10-09 04:22:36,287 - INFO
[QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
43052, 0, LOOKING, LOOKING, 0
2009-10-09 04:22:36,287 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
Unexpected exception
java.lang.NullPointerException
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
stLeaderElection.java:466)
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
erElection.java:635)
        at 
org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
2009-10-09 04:22:36,287 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
LOOKING
2009-10-09 04:22:36,287 - INFO
[QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
2009-10-09 04:22:36,287 - INFO
[QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
43053, 0, LOOKING, LOOKING, 0
2009-10-09 04:22:36,288 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
Unexpected exception
ja
-- 

Leonard Cuff
lcuff@valueclick.com

³This email and any files included with it may contain privileged,
proprietary and/or confidential information that is for the sole use of the
intended recipient(s).  Any disclosure, copying, distribution, posting, or
use of the information contained in or attached to this email is prohibited
unless permitted by the sender.  If you have received this email in error,
please immediately notify the sender via return e-mail, telephone, or fax
and destroy this original transmission and its included files without
reading or saving it in any manner. Thank you.²






This email and any files included with it may contain privileged,
proprietary and/or confidential information that is for the sole use
of the intended recipient(s).  Any disclosure, copying, distribution,
posting, or use of the information contained in or attached to this
email is prohibited unless permitted by the sender.  If you have
received this email in error, please immediately notify the sender
via return email, telephone, or fax and destroy this original transmission
and its included files without reading or saving it in any manner.
Thank you.

Re: Struggling with a simple configuration file.

Posted by Leonard Cuff <lc...@valueclick.com>.
Thank you both - Ben and Patrick  - for your helpful replies.

Leonard


On 10/9/09 7:26 AM, "Benjamin Reed" <br...@yahoo-inc.com> wrote:

> right at the beginning of
> http://hadoop.apache.org/zookeeper/docs/r3.2.1/zookeeperStarted.html it
> shows you the minimum standalone configuration.
> 
> that doesn't explain the 0 id. i'd like to try an reproduce it. do you
> have an empty data directory with a single file, myid, set to 1?
> 
> ben
> 
> Leonard Cuff wrote:
>> I¹ve been developing for ZooKeeper for a couple months now, recently running
>> in a test configuration with 3 ZooKeeper servers. I¹m running 3.2.1 with no
>> problems. Recently I tried to move to a single server configuration for the
>> development team environment, but couldn¹t get the configuration to work. I
>> get the error java.lang.RuntimeException: My id 0 not in the peer list
>> 
>> This would seem to imply that the myid file is set to zero. But ...it¹s set
>> to 1. 
>> 
>> What¹s puzzling to me is my original configuration of servers was this:
>> 
>> server.1=ind104.an.dev.fastclick.net:2182:2183   <--- The machine I¹m trying
>> to run standalone on.
>> server.2=build101.an.dev.fastclick.net:2182:2183
>> server.3=cmedia101.an.dev.fastclick.net:2182:2183
>> 
>> I just removed the last two lines, and ran zkServer.sh start.  It fails with
>> the described log message. (Full log given below).
>> When I put the server.2 and server.3 lines back in, it works fine, and is
>> following the build101 machine.
>> 
>> I decided to try changing the server.1 to server.0, also changed the myid
>> file contents from 1 to zero.  I get a very different error scenario: A
>> continuously-occurring Null Pointer exception:
>> 
>> 2009-10-09 04:22:36,284 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
>> Unexpected exception
>> java.lang.NullPointerException
>>         at 
>> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
>> stLeaderElection.java:466)
>>         at 
>> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
>> erElection.java:635)
>>         at 
>> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
>> 
>> I¹m at a loss to know where I¹ve gone astray.
>> 
>> Thanks in advance for any and all help.
>> 
>> Leonard
>> 
>> --- the first log
>> 
>> 2009-10-09 04:08:58,769 - INFO  [main:QuorumPeerConfig@80] - Reading
>> configuration from:
>> /vcm/home/sandbox/ticket_161758-1/vcm/component/zookeeper/conf/zoo.cfg.dev
>> 2009-10-09 04:08:58,795 - INFO  [main:QuorumPeerMain@118] - Starting quorum
>> peer
>> 2009-10-09 04:08:58,845 - FATAL [main:QuorumPeerMain@86] - Unexpected
>> exception, exiting abnormally
>> java.lang.RuntimeException: My id 0 not in the peer list
>>     at 
>> org.apache.zookeeper.server.quorum.QuorumPeer.startLeaderElection(QuorumPeer
>> .java:333)
>>     at 
>> org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:314)
>>     at 
>> org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMa
>> in.java:137)
>>     at 
>> org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPee
>> rMain.java:102)
>>     at 
>> org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:7
>> 5)
>> 
>> -- the second log
>> 
>> 2009-10-09 04:22:36,284 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
>> Unexpected exception
>> java.lang.NullPointerException
>>         at 
>> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
>> stLeaderElection.java:466)
>>         at 
>> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
>> erElection.java:635)
>>         at 
>> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
>> 2009-10-09 04:22:36,285 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
>> LOOKING
>> 2009-10-09 04:22:36,285 - INFO
>> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
>> 2009-10-09 04:22:36,285 - INFO
>> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
>> 43050, 0, LOOKING, LOOKING, 0
>> 2009-10-09 04:22:36,285 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
>> Unexpected exception
>> java.lang.NullPointerException
>>         at 
>> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
>> stLeaderElection.java:466)
>>         at 
>> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
>> erElection.java:635)
>>         at 
>> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
>> 2009-10-09 04:22:36,286 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
>> LOOKING
>> 2009-10-09 04:22:36,286 - INFO
>> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
>> 2009-10-09 04:22:36,286 - INFO
>> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
>> 43051, 0, LOOKING, LOOKING, 0
>> 2009-10-09 04:22:36,286 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
>> Unexpected exception
>> java.lang.NullPointerException
>>         at 
>> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
>> stLeaderElection.java:466)
>>         at 
>> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
>> erElection.java:635)
>>         at 
>> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
>> 2009-10-09 04:22:36,286 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
>> LOOKING
>> 2009-10-09 04:22:36,287 - INFO
>> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
>> 2009-10-09 04:22:36,287 - INFO
>> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
>> 43052, 0, LOOKING, LOOKING, 0
>> 2009-10-09 04:22:36,287 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
>> Unexpected exception
>> java.lang.NullPointerException
>>         at 
>> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
>> stLeaderElection.java:466)
>>         at 
>> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
>> erElection.java:635)
>>         at 
>> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
>> 2009-10-09 04:22:36,287 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
>> LOOKING
>> 2009-10-09 04:22:36,287 - INFO
>> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
>> 2009-10-09 04:22:36,287 - INFO
>> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
>> 43053, 0, LOOKING, LOOKING, 0
>> 2009-10-09 04:22:36,288 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
>> Unexpected exception
>> ja
>>   
> 

-- 

Leonard Cuff
lcuff@valueclick.com

³This email and any files included with it may contain privileged,
proprietary and/or confidential information that is for the sole use of the
intended recipient(s).  Any disclosure, copying, distribution, posting, or
use of the information contained in or attached to this email is prohibited
unless permitted by the sender.  If you have received this email in error,
please immediately notify the sender via return e-mail, telephone, or fax
and destroy this original transmission and its included files without
reading or saving it in any manner. Thank you.²






This email and any files included with it may contain privileged,
proprietary and/or confidential information that is for the sole use
of the intended recipient(s).  Any disclosure, copying, distribution,
posting, or use of the information contained in or attached to this
email is prohibited unless permitted by the sender.  If you have
received this email in error, please immediately notify the sender
via return email, telephone, or fax and destroy this original transmission
and its included files without reading or saving it in any manner.
Thank you.


Re: Struggling with a simple configuration file.

Posted by Benjamin Reed <br...@yahoo-inc.com>.
right at the beginning of 
http://hadoop.apache.org/zookeeper/docs/r3.2.1/zookeeperStarted.html it 
shows you the minimum standalone configuration.

that doesn't explain the 0 id. i'd like to try an reproduce it. do you 
have an empty data directory with a single file, myid, set to 1?

ben

Leonard Cuff wrote:
> I¹ve been developing for ZooKeeper for a couple months now, recently running
> in a test configuration with 3 ZooKeeper servers. I¹m running 3.2.1 with no
> problems. Recently I tried to move to a single server configuration for the
> development team environment, but couldn¹t get the configuration to work. I
> get the error java.lang.RuntimeException: My id 0 not in the peer list
>
> This would seem to imply that the myid file is set to zero. But ...it¹s set
> to 1. 
>
> What¹s puzzling to me is my original configuration of servers was this:
>
> server.1=ind104.an.dev.fastclick.net:2182:2183   <--- The machine I¹m trying
> to run standalone on.
> server.2=build101.an.dev.fastclick.net:2182:2183
> server.3=cmedia101.an.dev.fastclick.net:2182:2183
>
> I just removed the last two lines, and ran zkServer.sh start.  It fails with
> the described log message. (Full log given below).
> When I put the server.2 and server.3 lines back in, it works fine, and is
> following the build101 machine.
>
> I decided to try changing the server.1 to server.0, also changed the myid
> file contents from 1 to zero.  I get a very different error scenario: A
> continuously-occurring Null Pointer exception:
>
> 2009-10-09 04:22:36,284 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> java.lang.NullPointerException
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
> stLeaderElection.java:466)
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
> erElection.java:635)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
>
> I¹m at a loss to know where I¹ve gone astray.
>
> Thanks in advance for any and all help.
>
> Leonard
>
> --- the first log
>
> 2009-10-09 04:08:58,769 - INFO  [main:QuorumPeerConfig@80] - Reading
> configuration from:
> /vcm/home/sandbox/ticket_161758-1/vcm/component/zookeeper/conf/zoo.cfg.dev
> 2009-10-09 04:08:58,795 - INFO  [main:QuorumPeerMain@118] - Starting quorum
> peer
> 2009-10-09 04:08:58,845 - FATAL [main:QuorumPeerMain@86] - Unexpected
> exception, exiting abnormally
> java.lang.RuntimeException: My id 0 not in the peer list
>     at 
> org.apache.zookeeper.server.quorum.QuorumPeer.startLeaderElection(QuorumPeer
> .java:333)
>     at 
> org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:314)
>     at 
> org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMa
> in.java:137)
>     at 
> org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPee
> rMain.java:102)
>     at 
> org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:7
> 5)
>
> -- the second log
>
> 2009-10-09 04:22:36,284 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> java.lang.NullPointerException
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
> stLeaderElection.java:466)
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
> erElection.java:635)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
> 2009-10-09 04:22:36,285 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
> LOOKING
> 2009-10-09 04:22:36,285 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
> 2009-10-09 04:22:36,285 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
> 43050, 0, LOOKING, LOOKING, 0
> 2009-10-09 04:22:36,285 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> java.lang.NullPointerException
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
> stLeaderElection.java:466)
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
> erElection.java:635)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
> 2009-10-09 04:22:36,286 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
> LOOKING
> 2009-10-09 04:22:36,286 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
> 2009-10-09 04:22:36,286 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
> 43051, 0, LOOKING, LOOKING, 0
> 2009-10-09 04:22:36,286 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> java.lang.NullPointerException
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
> stLeaderElection.java:466)
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
> erElection.java:635)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
> 2009-10-09 04:22:36,286 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
> LOOKING
> 2009-10-09 04:22:36,287 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
> 2009-10-09 04:22:36,287 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
> 43052, 0, LOOKING, LOOKING, 0
> 2009-10-09 04:22:36,287 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> java.lang.NullPointerException
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
> stLeaderElection.java:466)
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
> erElection.java:635)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
> 2009-10-09 04:22:36,287 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
> LOOKING
> 2009-10-09 04:22:36,287 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
> 2009-10-09 04:22:36,287 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
> 43053, 0, LOOKING, LOOKING, 0
> 2009-10-09 04:22:36,288 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> ja
>   


Re: Struggling with a simple configuration file.

Posted by Patrick Hunt <ph...@apache.org>.
Take all of the server.# lines out, including server.1 (no other change 
necessary). For standalone you don't need/want this.

Alternately you could use

org.apache.zookeeper.server.ZooKeeperServerMain

(I don't think you even need to change the config file if you do that). 
for example:

java -cp build/zookeeper-3.3.0.jar:build/lib/log4j-1.2.15.jar:conf 
org.apache.zookeeper.server.ZooKeeperServerMain zoo_q1.cfg

works for me with the scenario you describe.

Patrick

Leonard Cuff wrote:
> I¹ve been developing for ZooKeeper for a couple months now, recently running
> in a test configuration with 3 ZooKeeper servers. I¹m running 3.2.1 with no
> problems. Recently I tried to move to a single server configuration for the
> development team environment, but couldn¹t get the configuration to work. I
> get the error java.lang.RuntimeException: My id 0 not in the peer list
> 
> This would seem to imply that the myid file is set to zero. But ...it¹s set
> to 1. 
> 
> What¹s puzzling to me is my original configuration of servers was this:
> 
> server.1=ind104.an.dev.fastclick.net:2182:2183   <--- The machine I¹m trying
> to run standalone on.
> server.2=build101.an.dev.fastclick.net:2182:2183
> server.3=cmedia101.an.dev.fastclick.net:2182:2183
> 
> I just removed the last two lines, and ran zkServer.sh start.  It fails with
> the described log message. (Full log given below).
> When I put the server.2 and server.3 lines back in, it works fine, and is
> following the build101 machine.
> 
> I decided to try changing the server.1 to server.0, also changed the myid
> file contents from 1 to zero.  I get a very different error scenario: A
> continuously-occurring Null Pointer exception:
> 
> 2009-10-09 04:22:36,284 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> java.lang.NullPointerException
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
> stLeaderElection.java:466)
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
> erElection.java:635)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
> 
> I¹m at a loss to know where I¹ve gone astray.
> 
> Thanks in advance for any and all help.
> 
> Leonard
> 
> --- the first log
> 
> 2009-10-09 04:08:58,769 - INFO  [main:QuorumPeerConfig@80] - Reading
> configuration from:
> /vcm/home/sandbox/ticket_161758-1/vcm/component/zookeeper/conf/zoo.cfg.dev
> 2009-10-09 04:08:58,795 - INFO  [main:QuorumPeerMain@118] - Starting quorum
> peer
> 2009-10-09 04:08:58,845 - FATAL [main:QuorumPeerMain@86] - Unexpected
> exception, exiting abnormally
> java.lang.RuntimeException: My id 0 not in the peer list
>     at 
> org.apache.zookeeper.server.quorum.QuorumPeer.startLeaderElection(QuorumPeer
> .java:333)
>     at 
> org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:314)
>     at 
> org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMa
> in.java:137)
>     at 
> org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPee
> rMain.java:102)
>     at 
> org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:7
> 5)
> 
> -- the second log
> 
> 2009-10-09 04:22:36,284 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> java.lang.NullPointerException
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
> stLeaderElection.java:466)
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
> erElection.java:635)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
> 2009-10-09 04:22:36,285 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
> LOOKING
> 2009-10-09 04:22:36,285 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
> 2009-10-09 04:22:36,285 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
> 43050, 0, LOOKING, LOOKING, 0
> 2009-10-09 04:22:36,285 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> java.lang.NullPointerException
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
> stLeaderElection.java:466)
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
> erElection.java:635)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
> 2009-10-09 04:22:36,286 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
> LOOKING
> 2009-10-09 04:22:36,286 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
> 2009-10-09 04:22:36,286 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
> 43051, 0, LOOKING, LOOKING, 0
> 2009-10-09 04:22:36,286 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> java.lang.NullPointerException
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
> stLeaderElection.java:466)
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
> erElection.java:635)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
> 2009-10-09 04:22:36,286 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
> LOOKING
> 2009-10-09 04:22:36,287 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
> 2009-10-09 04:22:36,287 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
> 43052, 0, LOOKING, LOOKING, 0
> 2009-10-09 04:22:36,287 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> java.lang.NullPointerException
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.totalOrderPredicate(Fa
> stLeaderElection.java:466)
>         at 
> org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLead
> erElection.java:635)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:488)
> 2009-10-09 04:22:36,287 - INFO  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@487] -
> LOOKING
> 2009-10-09 04:22:36,287 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@579] - New election: 12
> 2009-10-09 04:22:36,287 - INFO
> [QuorumPeer:/0.0.0.0:2181:FastLeaderElection@618] - Notification: 0, 12,
> 43053, 0, LOOKING, LOOKING, 0
> 2009-10-09 04:22:36,288 - WARN  [QuorumPeer:/0.0.0.0:2181:QuorumPeer@490] -
> Unexpected exception
> ja