IllegalArgumentException: /tmp/zookeeper/myid file is missing

12,021

When the server starts up, it knows which server it is by looking for the file myid in the data directory.

Create a file named myid under the dataDir i.e., /tmp/zookeeper for every Zookeeper server.

The myid file should contain the corresponding server number, in ASCII (For ex: 1), as the only entry in it.

Share:
12,021

Related videos on Youtube

dsa
Author by

dsa

ML enthusiast.

Updated on June 04, 2022

Comments

  • dsa
    dsa almost 2 years

    I am trying to configure Kafka on multiple instances of EC2 by following this gist , but I am getting following error:

    I am running this command:

    $ bin/zookeeper-server-start.sh config/zookeeper.properties &
    

    1 13308

    Error:

    [2017-03-22 08:21:00,314] ERROR Invalid config, exiting abnormally (org.apache.zookeeper.server.quorum.QuorumPeerMain)
    org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing config/zookeeper.properties
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:123)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:101)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
    Caused by: java.lang.IllegalArgumentException: /tmp/zookeeper/myid file is missing
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:350)
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:119)
        ... 2 more
    

    My zookeeper.conf is as shown below:

    dataDir=/tmp/zookeeper
    # the port at which the clients will connect
    #clientPort=2181
    clientPort=2080
    # disable the per-ip limit on the number of connections since this is a non-production config
    maxClientCnxns=0
    
    
    server.1=ec2-<GLOBAL_IP_1>.amazonaws.com:2888:3888
    server.2=ec2-<GLOBAL_IP_2>.amazonaws.com:2888:3888
    #add here more servers if you want
    initLimit=5
    syncLimit=2
    tickTime=2000
    
  • dsa
    dsa about 7 years
    What should be the entry in my case ??
  • franklinsijo
    franklinsijo about 7 years
    For host ec2-<GLOBAL_IP_1>.amazonaws.com, it is 1 and for ec2-<GLOBAL_IP_2>.amazonaws.com it is 2.