Language/NoSQL&JDBC

zookeeper 설치하기

아르비스 2011. 8. 17. 16:21

zookeeper 설치하기

$ wget http://ftp.daum.net/apache//zookeeper/zookeeper-3.3.3/zookeeper-3.3.3.tar.gz

($ wget http://apache.tt.co.kr//zookeeper/zookeeper-3.3.3/zookeeper-3.3.3.tar.gz)

#tar zxvf zookeeper-3.3.3.tar.gz

#mv zookeeper-3.3.3 /usr/share/zookeeper

 

zookeeper를 user/share에 놓아두기로 했다.

그리고는 /usr/share/zookeeper/conf/zoo_sample.cfg파일의 이름을 zoo.cfg파일로 변경한다.

#cd /usr/share/zookeeper/conf

#mv zoo_sample.cfg zoo.cfg

 

 # The number of milliseconds of each tick

tickTime=2000

# The number of ticks that the initial

# synchronization phase can take

initLimit=10

# The number of ticks that can pass between

# sending a request and getting an acknowledgement

syncLimit=5

# the directory where the snapshot is stored.

dataDir=/home/hadoop/zk_data

# the port at which the clients will connect

clientPort=2181

# ZooKeeper Servers

server.1=zookeeper1:2888:3888

server.2=zookeeper2:2888:3888

server.3=zookeeper3:2888:3888

server.4=zookeeper4:2888:3888


ZooKeeper의 IP 목록을 추가할 때에는 server.x=unique_name:port:port 방식으로 기술해야 하는데 저의 경우는server.x에서 x를 호스트의 IP로 지정하였고 unique_name을 호스트명으로 하였습니다. 나머지 두 개의 포트는 ZooKeeper가 동작하기 위해서 필요한 포트이므로 기본값을 그대로 사용하는 것이 좋을 것 같습니다. 잘 동작하면 적절하게 변경하시기 바랍니다.

/home/hadoop/zk_data/myid 파일을 생성하고 각 노드에 대해서 myId를 지정합니다. 파일명에 특히 주의하시기 바랍니다. myid 파일에는 server.x 형식에서 x의 값을 넣어줍니다. 위 경우 1,2,3,4 등의 값이 되겠습니다. 각 호스트별로 주어진 번호를 파일에 기록하기만 하면 됩니다. zookeeper1 호스트의 경우 1을 할당했으므로 myid 파일에도 당연히 1이 기록되어 있으면 됩니다.

6. 지금까지의 작업을 모두 동일하게 모든 ZooKeeper 노드에 적용하도록 합니다.

7. ZooKeeper를 구동하기 위해서 각각의 장비에서 #/bin/zkServer.sh start 스크립트를 실행합니다. 

Hbase download
$ wget http://ftp.daum.net/apache//habse/habse-0.90.4/hbase-0.90.4.tar.gz