본문 바로가기

Programming/Tip&Informaion

[zookeeper] standalon 설치 시, FAILED TO START 에러

standalone 설치

mirror.cc.columbia.edu/pub/software/apache/zookeeper/zookeeper-3.6.2/

 

Index of /pub/software/apache/zookeeper/zookeeper-3.6.2

 

mirror.cc.columbia.edu

에서

apache-zookeeper-3.6.2-bin.tar.gz 다운로드 후,

압축해제: tar -zxf apache-zookeeper-3.6.2-bin.tar.gz

적당한 위치로 이동: mv apache-zookeeper-3.6.2-bin/ /usr/local/zookeeper

데이터 디렉토리 생성: mkdir -p /var/lib/zookeeper

config 설정:

cd /usr/local/zookeepr/conf/

cp zoo_sample.cfg zoo.cfg

vim zoo.cfg

해당 라인 변경: dataDir=/var/lib/zookeeper

실행: /usr/local/zookeeper/bin/zkServer.sh start

 

개인적으로는 아래와 같은 에러가 발생했었는데, 위의 bin 파일이 아닌 apache-zookeeper-3.6.2.tar.gz 다운 받아서 생긴 문제

 

/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... ./zkServer.sh: line 169: /var/lib/zookeeper/zookeeper_server.pid: Permission denied
FAILED TO WRITE PID
[himchan@himchan bin]$ sudo ./zkServer.sh start
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... FAILED TO START

원래 설치: Kafka The Definitive Guide 책 참고