zookeeper 윈도 우즈 에 설치

2262 단어
최전선: 최근 에 회사 에서 한 프로젝트 는 dubbo 와 zookeeper 를 사 용 했 습 니 다. 테스트 할 때마다 제 로 컬 서 비 스 는 테스트 기 에 등록 되 고 테스트 기의 서 비 스 를 중단 해 야 하기 때문에 현지에서 zookeeper 를 만 들 려 고 합 니 다.
설치 과정
     2.1  http://mirrors.hust.edu.cn/apache/zookeeper/  다운로드 3.3.6
     2.2  E: \ zookeeper - 3.3.6 으로 압축 풀기 
     3.3  디 렉 터 리 conf 에서 만 들 기 zoo. cfg 파일, 기본 값 은 이 파일 을 불 러 오 는 것 입 니 다. 파일 내용 은 제 가 직접 copy 한 sample 에 있 습 니 다.
          
자바 코드  
  • # The number of milliseconds of each tick         
    tickTime=2000
    # The number of ticks that the initial 
    # synchronization phase can take      ,            ,   10*2=20 
    initLimit=10
    # The number of ticks that can pass between 
    # sending a request and getting an acknowledgement  ZK leader   follower        ,    5*2=10 
    syncLimit=5
    # the directory where the snapshot is stored.
    # do not use /tmp for storage, /tmp here is just 
    # example sakes. #              ,       ,               。 
    dataDir=E:\\zk\\tmp\\zookeeper
    #               
    dataLogDir=E:\\zk\\logs\\zookeeper
    # the port at which the clients will connect ZK          
    clientPort=2181
    # the maximum number of client connections.
    # increase this if you need to handle more clients
    #maxClientCnxns=60
    #
    # Be sure to read the maintenance section of the 
    # administrator guide before turning on autopurge.
    #
    # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
    #
    # The number of snapshots to retain in dataDir
    #autopurge.snapRetainCount=3
    # Purge task interval in hours
    # Set to "0" to disable auto purge feature
    #autopurge.purgeInterval=1

  •  
       위의 설명 소개:http://zookeeper.apache.org/doc/current/zookeeperStarted.html
       그리고 cd 는 빈 디 렉 터 리 에 가서 zkServer. cmd 를 실행 하면 시작 합 니 다.
       메모: dataDir 화해시키다 dataLogDir 디 렉 터 리 는 자동 으로 생 성 되 지 않 습 니 다. 수 동 으로 만들어 야 시작 할 수 있 습 니 다.
       netstat - ano | findstr "2181" 으로 OK 여 부 를 볼 수 있 습 니 다.
       시작 하 는 JAVA 프로 세 스 의 상황 을 JPS 로 볼 수도 있 습 니 다.
       
    자바 코드 
    C:\windows\system32>jps  
    8068  
    10040 QuorumPeerMain  //     zk   ,       
    10556 Jps
                   :  zkCli.cmd -server 127.0.0.1:2181

       JPS 에 관 한 것 은 혼자 JAVAHOME \ bin 디 렉 터 리 를 내 려 다 보면 명령 이 많 습 니 다.
    계속

    좋은 웹페이지 즐겨찾기