Monday, July 23, 2012

Resolving "./zookeeper.out: Permission denied" error

When starting zookeeper, using the following command



sudo -u zookeeper $ZOOKEEPER_HOME/bin/zkServer.sh start


I saw this error:



Starting zookeeper ... /usr/local/zookeeper/bin/zkServer.sh: line 105: ./zookeeper.out: Permission denied


I resolved this error by telling zookeeper where I wanted the log file to be placed. Simply edit $ZOOKEEPER_HOME/zkEnv.sh, then add this assignment at the top of the file:



ZOO_LOG_DIR=/var/log/zookeeper


Then create that directory:



sudo mkdir /var/log/zookeeper
sudo chown zookeeper /var/log/zookeeper

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Here is resolved the problems occurred as: test@test-VirtualBox ~/zookeeper-3.4.10 $ ./bin/zkServer.sh start
    ZooKeeper JMX enabled by default
    Using config: /home/test/zookeeper-3.4.10/bin/../conf/zoo.cfg
    Starting zookeeper ... ./bin/zkServer.sh: line 140: ./zookeeper.out: Permission denied
    STARTED
    ============================================================
    Here is fixed: Change the file name below $ZOOKEEPER_HOME/conf/zoo_sample.cfg file to zoo.cfg
    sudo rm zoo_sample.cfg zoo.cfg
    start the Zookeeper:
    ./bin/zkServer.sh start

    result displayed:

    test@test-VirtualBox ~ $ sudo -u root $ZOOKEEPER_HOME/bin/zkServer.sh start
    ZooKeeper JMX enabled by default
    Using config: /home/test/zookeeper-3.4.10/bin/../conf/zoo.cfg
    Starting zookeeper ... STARTED

    now you can run the client Zookeeper.


    ReplyDelete