2015-01-19 25 views
5

Sto provando a connettere il mio HBase a HDFS. Ho il mio namenode hdf (bin/hdfs namenode) e datnode (/ bin/hdfs datanode) in esecuzione. Posso anche avviare il mio Hbase (sudo ./bin/start-hbase.sh) e i server delle regioni locali (sudo ./bin/local-regionservers.sh start 1 2). Ma quando provo ad eseguire un comando da shell HBase dà il seguente errore:Connessione rifiutata in Hbase Shell durante il collegamento di HBase a HDFS

[email protected]:/teaching/14f-cis655/proj-dtracing/hbase/hbase-0.99.0-SNAPSHOT$ ./bin/hbase shell 
HBase Shell; enter 'help<RETURN>' for list of supported commands. 
Type "exit<RETURN>" to leave the HBase Shell 
Version 0.99.0-SNAPSHOT, rUnknown, Sat Aug 9 08:59:57 EDT 2014 

hbase(main):001:0> list 
TABLE                          
SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/teaching/14f-cis655/proj-dtracing/hbase/hbase-0.99.0-SNAPSHOT/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/teaching/14f-cis655/proj-dtracing/hadoop-2.6.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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] 
2015-01-19 13:33:07,179 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 

ERROR: Connection refused 

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:.*' 

Qui di seguito sono i miei file di configurazione per HBase e Hadoop:

HBase-site.xml

<configuration> 
<property> 
<name>hbase.rootdir</name> 
<value>hdfs://localhost:9000/hbase</value> 
</property> 

    <!--for psuedo-distributed execution--> 
    <property> 
     <name>hbase.cluster.distributed</name> 
     <value>true</value> 
    </property> 
    <property> 
     <name>hbase.master.wait.on.regionservers.mintostart</name> 
     <value>1</value> 
    </property> 
     <property> 
     <name>hbase.zookeeper.property.dataDir</name> 
     <value>/teaching/14f-cis655/tmp/zk-deploy</value> 
     </property> 

    <!--for enabling collection of traces 
    --> 
    <property> 
     <name>hbase.trace.spanreceiver.classes</name> 
     <value>org.htrace.impl.LocalFileSpanReceiver</value> 
    </property> 
    <property> 
     <name>hbase.local-file-span-receiver.path</name> 
     <value>/teaching/14f-cis655/tmp/server-htrace.out</value> 
    </property> 
    </configuration> 

HDFS-site.xml

<configuration> 
<property> 
    <name>dfs.replication</name> 
    <value>1</value> 
</property> 
<property> 
    <name>dfs.namenode.name.dir</name> 
    <value>file:/teaching/14f-cis655/proj-dtracing/hadoop-2.6.0/yarn/yarn_data/hdfs/namenode</value> 
</property> 
<property> 
    <name>dfs.datanode.data.dir</name> 
    <value>file:/teaching/14f-cis655/proj-dtracing/hadoop-2.6.0/yarn/yarn_data/hdfs/datanode</value> 
</property> 
<property> 
    <name>hadoop.trace.spanreceiver.classes</name> 
    <value>org.htrace.impl.LocalFileSpanReceiver</value> 
    </property> 
    <property> 
    <name>hadoop.local-file-span-receiver.path</name> 
    <value>/teaching/14f-cis655/proj-dtracing/hadoop-2.6.0/logs/htrace.out</value> 
    </property> 
</configuration> 

core-site.xml

012.351.641,061 mila
<configuration> 
<property> 
    <name>fs.default.name</name> 
    <value>hdfs://localhost:9000</value> 
</property> 
</configuration> 
+0

avete risolto questa edizione? Se sì, potresti condividere la soluzione per favore. – Shash

+0

Prova a eliminare la directory in cui il gestore dello spazio scrive i suoi dati. Quindi riavvia il tuo HBase –

+0

Nel mio caso la directory è/teaching/14f-cis655/tmp/zk-deploy –

risposta

3

Si prega di verificare che si fa HDFS è disponibile da shell:

$ hdfs dfs -ls /hbase 

Assicurarsi inoltre che hai tutte le variabili d'ambiente in hdfs-env.sh di file:

HADOOP_CONF_LIB_NATIVE_DIR="/hadoop/lib/native" 
HADOOP_OPTS="-Djava.library.path=/hadoop/lib" 
HADOOP_HOME=/hadoop 
YARN_HOME=/hadoop 
HBASE_HOME=/hbase 
HADOOP_HDFS_HOME=/hadoop 
HBASE_MANAGES_ZK=true 

Esegui Hadoop e HBase usando lo stesso utente del sistema operativo? Se si utilizzano utenti separati, verificare se l'utente HBase è autorizzato ad accedere a HDFS.

Assicurarsi che si dispone di una copia dei file HDFS-site.xml e core-stie.xml (o link simbolico) in $ {} HBASE_HOME/conf directory.

anche fs.default.name opzione è deprecata per filati (ma deve ancora lavorare), è necessario considerare l'utilizzo di fs.defaultFS invece.

Usi Zookeeper? Perché hai specificato l'opzione hbase.zookeeper.property.dataDir, ma non c'è lo hbase.zookeeper.quorum e altre opzioni importanti. Si prega di leggere http://hbase.apache.org/book.html#zookeeper per ulteriori informazioni.

Si prega di aggiungere l'opzione accanto al HDFS-site.xml per rendere HBase funzionare correttamente (sostituire $ HBASE_USER variabile per l'utente del sistema, che viene utilizzato per eseguire HBase):

<property> 
    <name>hadoop.proxyuser.$HBASE_USER.groups</name> 
    <value>*</value> 
</property> 
<property> 
    <name>hadoop.proxyuser.$HBASE_USER.hosts</name> 
    <value>*</value> 
</property> 
<property> 
    <name>dfs.support.append</name> 
    <value>true</value> 
</property> 
+1

Sì, quindi il problema era che il processo di quorum zookeeper non era in esecuzione. È stato risolto dopo che ho eliminato la directory in cui HBase detiene i suoi dati temporanei. Funziona bene ora. –