2012-07-16 1 views
15

세 개의 사육사 노드가 있습니다. 모든 포트가 열려 있습니다. IP 주소가 정확합니다. 아래는 나의 설정 파일입니다. 주방장이 부팅 한 모든 노드에 모두 동일한 설치 및 구성 파일이 있습니다.사육사 - 세 개의 노드와 오류가 있습니다.

# The number of milliseconds of each tick 
tickTime=3000 
# 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=/var/lib/zookeeper 
# Place the dataLogDir to a separate physical disc for better performance 
# dataLogDir=/disk2/zookeeper 

# the port at which the clients will connect 
clientPort=2181 

server.1=111.111.111:2888:3888 
server.2=111.111.112:2888:3888 
server.3=111.111.113:2888:3888 

노드 중 하나에 오류가 있습니다. 그래서 ... 설정이 오히려 바닐라 이후 오류가 발생할 수있는 방법에 대해 혼란스러워합니다. 세 노드 모두 똑같은 일을합니다.

2012-07-16 05:16:57,558 - INFO [main:[email protected]] - Reading configuration from: /etc/zookeeper/conf/zoo.cfg 
2012-07-16 05:16:57,567 - INFO [main:[email protected]] - Defaulting to majority quorums 
2012-07-16 05:16:57,572 - FATAL [main:[email protected]] - Invalid config, exiting abnormally 
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /etc/zookeeper/conf/zoo.cfg 
    at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:110) 
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:99) 
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:76) 
Caused by: java.lang.IllegalArgumentException: serverid replace this text with the cluster-unique zookeeper's instance id (1-255) is not a number 
    at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:333) 
    at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:106) 
    ... 2 more 

답변

34

당신은 그 기계의 ID 만 텍스트를 포함하는 하나의 라인으로 구성, 대한 myid라는 이름의 파일을 만들 필요 사육사의 var 디렉토리, 각 서버에 대해 하나에 넣어. 따라서 서버 1의 myid에는 "1"이라는 텍스트가 포함될 것입니다. ID는 앙상블 내에서 고유해야하고

더에서 http://zookeeper.apache.org/doc/r3.3.3/zookeeperAdmin.html#sc_zkMulitServerSetup

+0

오 ... 알아요. tat 파일은 어디에 두 시나요?/etc/zookeeper/conf? – Tampa

+0

예 ... 훌륭하게 ... 고맙습니다 !!!!!!!!! – Tampa

+0

zookeeper.properties의 "dataDir"속성 (ZooKeeper 시작시 인수로 전달한 파일)에 지정된 파일 위치에 파일을 저장합니다. 위의 설정 파일에서 dataDir은/var/lib/zookeeper이므로 파일은/var/lib/zookeeper/myid 여야합니다. – JakeRobb

4
server.1=111.111.111:2888:3888 
server.2=111.111.112:2888:3888 
server.3=111.111.113:2888:3888 

이 서버 있습니까 볼 1에서 255 사이의 값을 가지고 있어야하고 IP의

그런 다음 각각에 대한 myid 파일을 생성 111.111.111에 값 1, 111.111.111.112에 2, 111.111.111.113에 3을 갖는 노드 (dataDir =/var/lib/zookeeper)

값 "1"myid 파일을두면 노드 형식 예외 및 "잘못된 구성, exiti ng 비정상적으로 "myid 파일이 확장자로 작성된 경우.

따라서 확장자없이 myid 파일을 만들고 큰 따옴표없이 해당 서버에 정수 값 1,2,3을 넣으십시오.