2017-01-03 2 views
1

HBase v1.1.2 (Hadoop v2.7.2 포함)를 독립 실행 형 모드로 설치하려고 시도하고 있으며 최대한 근접한 Apache HBase docs을 따라야합니다. 그러나 구성은 약간 까다로워 보입니다. HBase를 미러 사이트 중 하나를 통해 직접 다운로드하는 것과는 대조적으로 홈베이스와 함께 설치한다는 사실과 관련이 있는지 확실하지 않습니다. 내 목표는 테이블 만들기, 기존 테이블 나열 등의 작업을 수행 할 수있는 지점에 도달하는 것입니다.Hbase 셸에서 명령을 실행할 때 노드/hbase가 ZooKeeper에 없습니다.

Java 1.7.0이 설치되어 있고 hbase를 설치하기 위해 "brew install hbase"를 실행했습니다. 브루의 HBase를 디렉토리에서, 나는 /libexec/conf/hbase-env.sh 연 나는 선 (27)에 다음을 참조 : I 명령 줄에서 /usr/libexec/java_home을 실행하면

export JAVA_HOME="$(/usr/libexec/java_home)" 

, 그것은 /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home를 출력합니다. 그래서 유효한 $ JAVA_HOME 환경 변수가 설정되어있는 것으로 보입니다. 내 /libexec/conf/hbase-site.xml 구성 파일에서

, 나는 다음과 같은 키/값 쌍 설정 한 : 즉

<configuration> 
    <property> 
    <name>hbase.rootdir</name> 
    <value>file:///home/richiethomas/hbase</value> 
    </property> 
    <property> 
    <name>hbase.zookeeper.property.dataDir</name> 
    <value>/home/richiethomas/zookeeper</value> 
    </property> 
</configuration> 

을, 나는 HBase를 워드 프로세서에 표시된 구성의 정확한 복사본 만 교체했습니다 'testuser'와 'richiethomas'는 내 커맨드 라인에서 사용하고있는 사용자 이름입니다.

다음 Homebrew hbase 디렉토리에서`./bin/start-hbase.sh '를 실행합니다. 나는 다음을 참조 :

starting master, logging to /usr/local/Cellar/hbase/1.1.2/libexec/bin/../logs/hbase-richiethomas-master-MacBook-Pro-5.local.out

을 다음, 나는 hbase shell 실행하고 난 다음을 참조 :이 작업을 수행 한 후

SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/usr/local/Cellar/hbase/1.1.2/libexec/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/usr/local/Cellar/hadoop/2.7.2/libexec/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 
2017-01-03 17:27:52,056 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 
HBase Shell; enter 'help<RETURN>' for list of supported commands. 
Type "exit<RETURN>" to leave the HBase Shell 
Version 1.1.2, rcc2b70cf03e3378800661ec5cab11eb43fafe0fc, Wed Aug 26 20:11:27 PDT 2015 

>> 

새 CLI 탭에 나는 경로에서 로그를 cat I 위의 (/usr/local/Cellar/hbase/1.1.2/libexec/bin/../logs/hbase-richiethomas-master-MacBook-Pro-5.local.out)을보고, 나는 다음을 참조 :

SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/usr/local/Cellar/hbase/1.1.2/libexec/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/usr/local/Cellar/hadoop/2.7.2/libexec/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 

그런 다음, 다시 내 HBase를 쉘에서, 나는 다음을 실행

>> list 
TABLE                                            
2017-01-03 17:28:05,108 ERROR [main] client.ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master. 
2017-01-03 17:28:05,320 ERROR [main] client.ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master. 
2017-01-03 17:28:05,625 ERROR [main] client.ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master. 
2017-01-03 17:28:06,128 ERROR [main] client.ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master. 
2017-01-03 17:28:07,134 ERROR [main] client.ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master. 
2017-01-03 17:28:09,144 ERROR [main] client.ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master. 
2017-01-03 17:28:13,158 ERROR [main] client.ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master. 

ERROR: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master. 

Here is some help for this command: 
List all tables in hbase. Optional regular expression parameter could 
be used to filter the output. Examples: 

    hbase> list 
    hbase> list 'abc.*' 
    hbase> list 'ns:abc.*' 
    hbase> list 'ns:.*' 

아파치 문서에 따르면 다음 모든 일을하는지, 나는보고

You do not need to create the HBase data directory. HBase will do this for you. If you create the directory, HBase will attempt to do a migration, which is not what you want.

나는 이것이 내가 hbase-site.xml에 다음과 같은 속성을 설정할 필요가 없음을 의미하는 것으로 해석,

012 :

<property> 
    <name>zookeeper.znode.parent</name> 
    <value>/hbase</value> 
</property> 

jps의 출력은 다음과 같다 : expecially에 'HBase를'이후 'zookeeper.znode.parent'의 기본이다 내가 해봤

# 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/var/run/zookeeper/data 
# the port at which the clients will connect 
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 

솔루션 :

I.을 3,516,

32146 ZooKeeperMain 1364 QuorumPeerMain 83568 34120 Jps 

은 내 zoo.cfg 파일은 /usr/local/etc/zookeeper/zoo.cfg에 위치하고 있으며,이처럼 보이는

hbase-site.xml 파일의 zookeeper.property.dataDir 값을 /usr/local/var/run/zookeeper/data으로 바꾸려고 시도했지만 문제가 해결되지 않았습니다.

II.

내가 명령 줄에서 zkcli을 실행하고 ls /을 실행하면, 난 단지 zookeeper, 아니 hbase 디렉토리를 참조하십시오.

create /hbase my_data

내가 다음을 참조하십시오 : 나는 사육사 쉘 내부에서 다음 명령을 실행하려고 내가 종료하고 다시 실행 HBase를 쉘, 그리고 list을하려고 할 때,

[zk: localhost:2181(CONNECTED) 4] ls/
[hbase, zookeeper] 

을 그럼 다음을 참조하십시오.

>> list 
TABLE                                            

ERROR: Can't get master address from ZooKeeper; znode data == null 

III. this Quora article에 따르면

은 HBase를 1.1.2은 버전 2.5.x의 최대 하둡을 지원, 그래서 나는 HBase를 스크립트를 brew install hadoop25 다음 brew uninstall hadoop를 실행 정지를 실행하고 시작하고 HBase를 쉘을 다시 시작했다. 아직도 운이 없다.

IV.

Homebrew 버전을 제거하고 Apache 미러 사이트에서 HBase를 다운로드하고 hbase-site.xml에서 구성 프로세스를 반복했지만 동일한 오류 (The node /hbase is not in ZooKeeper. It should have been written by the master.)가 발생했습니다.

V. 내가 제거

/를 "주의 사항"섹션의 지침에 브루 통해 HBase를 다시 설치하고, 다음 : 내가 발견

==> Caveats 
To have launchd start hbase now and restart at login: 
    brew services start hbase 
Or, if you don't want/need a background service you can just run: 
    /usr/local/opt/hbase/bin/start-hbase.sh 

위의 명령을 실행 한 후 hbase-site.xml 파일이 hbase.rootdirhbase.zookeeper.property.dataDir (구체적으로 각각 file:///usr/local/var/hbase/usr/local/var/zookeeper)에 대한 그럴듯하게 보이는 값으로 채워졌습니다. 또한 brew services start hbase을 실행했을 때 jps을 실행했을 때 'HMaster'프로세스가 실행되는 것을 볼 수 없었지만 /usr/local/opt/hbase/bin/start-hbase.sh을 실행했을 때 HMaster를 보았습니다. 그러나 나는 hbase shell을 시작하고 status을 입력하려고 시도했으며 이전과 같은 오류가 발생했습니다 (The node /hbase is not in ZooKeeper.).

vi. 내 HBase를 구성에 문제가

MacBook-Pro-5:2.5.2 richiethomas$ hadoop jar /usr/local/Cellar/hadoop25/2.5.2/libexec/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.2.jar pi 2 5 
Number of Maps = 2 
Samples per Map = 5 
17/01/03 20:09:33 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 
Wrote input for Map #0 
Wrote input for Map #1 
Starting Job 
... 
Job Finished in 2.156 seconds 
Estimated value of Pi is 3.60000000000000000000 

이 나타납니다,하지만 난 여기 시도 할 다른 모르겠어요 :

나는 나의 하둡 설치 확인을 실행 확인했습니다.

답변

2

hbase을 설정하려면 hdfs 또는 zk을 만들 필요가 없습니다.

문제의 이유는 hbase은 내부 zk 서비스를 시작하려고 것이라고하지만, 이미 존재하는 한 자바 과정 QuorumPeerMain2181, hbase이 시작되지 않습니다 포트를 차지한다. hbase이 성공적으로 시작되면 HMaster이라는 Java 프로세스가 있습니다.

Could not start ZK at requested port of 2181. ZK was started at port: 2182. Aborting as clients (e.g. shell) will not be able to find this ZK quorum. 

그래서,이 솔루션은 다음과 같습니다 :이를 확인하려면

가, 로그 hbase-richiethomas-master-MacBook-Pro-5.local.out의 마지막 줄을 확인, 당신은 같은 오류 메시지가 표시 될 수 있습니다 죽일

  1. 을 기존 QuorumPeerMain
  2. start-hbase.sh을 다시 실행하십시오.
+0

com 홈 브루어 "경고"섹션의 2 번 항목 (예 : '/ usr/local/opt/hbase/bin/start-hbase.sh'), HMaster와 QuorumPeerMain이 모두 실행되는 것을 볼 수 있습니다. 그러나 쉘에서'hbase shell'과'status'를 실행하려고하면'Node/hbase가 ZooKeeper에 없습니다. '라는 동일한 오류가 발생합니다. –

+0

나는 고쳐졌으며 이것은 결국 올바른 대답이다. HMaster 작업과 QuorumPeerMain 작업 (동시에 사육사의 자식 작업 임)을 동시에 실행 해 보았습니다. 작동하지 않았습니다. QuorumPeerMain 작업을 죽이려고했지만 다른 프로세스의 자식 프로세스 였으므로 다시 생성되었습니다. 사육사를 제거하는 것이 안전한지 확신 할 수 없기 때문에 수동으로 이름을 변경하고 컴퓨터를 다시 시작한 다음'jps'를 다시 실행하여 QuorumPeerMain 작업을 확인하지 않았습니다. 그런 다음'start-hbase.sh'와'hbase shell'을 다시 실행했는데 예상대로 작동했습니다. 감사! –