ZooKeeper 는 분산환경의 상호 조정이 필요한 다양한 서비스를 제공하는
동기화가 보장되는 아파치 오픈소스이다.
분산 환경에서 락, 네이빙 서비스, 클러스터 멤버십 등을 쉽게 구현할 수 있는
분산 코디네이터 서비스를 쉽게 만들 수 있다.
일단 이번에는 설치 법을 소개 한다.
설치하는 환경은 다음과 같다
- OS : 우분투
- H/W : AWS EC2 t2.micro
※ Java 6 이상이 설치되어 있어야 한다.
자바 설치법은 다음을 참고
http://sarghis.com/blog/1050/
1. ZooKeeper Download
   ZooKeeper는 http://apache.mirror.cdnetworks.com/zookeeper/ 에서 stable을 들어가서
   다운 받습니다.
2. 파일 이동
    filezilla 또는 FTP 파일을 이용해서 AWS의 OS로 이동 시켜 줍니다.
3. 압축 풀기 및 파일 이동
    1) #wget http://apache.mirror.cdnetworks.com/zookeeper/stable/zookeeper-3.4.8.tar.gz
     ※ 끝의 파일 release는 바뀔 수 있습니다.
      
   2) #tar zxvf zookeeper-3.4.8.tar.gz
   3) #mv zookeeper-3.4.8.tar.gz /usr/local/zookeeper
   4) #cd /usr/local/zookeeper/zookeeper-3.4.8
4. 설정파일 복사 및 수정
    1) #cp conf/zoo_sample.cfg conf/zoo.cfg
    2) zoo.cfg 수정
       i) #cd conf/
       ii) #vi 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.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/usr/local/zookeeper/data
# the port at which the clients will connect
clientPort=2181
============================================
dataDir 부분만 본인에 맞게 수정해주세요 스냅샷 데이터가 쌓이는 장소 입니다.
          iii) 저장하고 나오면 됩니다.
5. 서버 구동  
     ※ 4번까지 진행하시면 현재 위치는 /usr/local/zookeeper/zookeeper-3.4.8/conf
      입니다.  
     # cd ..  
     # cd bin/  
     # ./zkServer.sh start  
     --> 서버가 구동 됩니다.
6. 클라이언트 접속하기
   # ./zkCli.sh -server 127.0.0.1:2181
 
댓글 없음:
댓글 쓰기