Re: Struggling with a simple configuration file.

2009-10-09 Thread Benjamin Reed
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:quorump...@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:quorumpeercon...@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:quorumpeerm...@118] - Starting quorum
peer
2009-10-09 04:08:58,845 - FATAL [main:quorumpeerm...@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:quorump...@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:quorump...@487] -
LOOKING
2009-10-09 04:22:36,285 - INFO
[QuorumPeer:/0.0.0.0:2181:fastleaderelect...@579] - New election: 12
2009-10-09 04:22:36,285 - INFO
[QuorumPeer:/0.0.0.0:2181:fastleaderelect...@618] - Notification: 0, 12,
43050, 0, LOOKING, LOOKING, 0
2009-10-09 04:22:36,285 - WARN  [QuorumPeer:/0.0.0.0:2181:quorump...@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:quorump...@487] -
LOOKING
2009-10-09 04:22:36,286 - INFO
[QuorumPeer:/0.0.0.0:2181:fastleaderelect...@579] - New election: 12
2009-10-09 04:22:36,286 - INFO
[QuorumPeer:/0.0.0.0:2181:fastleaderelect...@618] - Notification: 0, 12,
43051, 0, LOOKING, LOOKING, 0
2009-10-09 04:22:36,286 - WARN  [QuorumPeer:/0.0.0.0:2181:quorump...@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:quorump...@487] -
LOOKING
2009-10-09 04:22:36,287 - INFO

Re: Struggling with a simple configuration file.

2009-10-08 Thread Patrick Hunt
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:quorump...@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:quorumpeercon...@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:quorumpeerm...@118] - Starting quorum
peer
2009-10-09 04:08:58,845 - FATAL [main:quorumpeerm...@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:quorump...@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:quorump...@487] -
LOOKING
2009-10-09 04:22:36,285 - INFO
[QuorumPeer:/0.0.0.0:2181:fastleaderelect...@579] - New election: 12
2009-10-09 04:22:36,285 - INFO
[QuorumPeer:/0.0.0.0:2181:fastleaderelect...@618] - Notification: 0, 12,
43050, 0, LOOKING, LOOKING, 0
2009-10-09 04:22:36,285 - WARN  [QuorumPeer:/0.0.0.0:2181:quorump...@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:quorump...@487] -
LOOKING
2009-10-09 04:22:36,286 - INFO
[QuorumPeer:/0.0.0.0:2181:fastleaderelect...@579] - New election: 12
2009-10-09 04:22:36,286 - INFO
[QuorumPeer:/0.0.0.0:2181:fastleaderelect...@618] - Notification: 0, 12,
43051, 0, LOOKING, LOOKING, 0
2009-10-09 04:22:36,286 - WARN  [QuorumPeer:/0.0.0.0:2181:quorump...@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