CDH5.3.x用のQuickStartVMを使用しています
この春のHadoopサンプルをhbaseに実装しようとしています
ホストコンピューターからのサンプルは、VM内のHbaseに接続して、テーブルの作成、データの追加、データの読み取りを行います。
私のpomで私は使用します
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.0.5.RELEASE</spring.version>
<spring.hadoop.version>2.1.2.RELEASE-cdh5</spring.hadoop.version>
<hadoop.version>2.5.0-cdh5.3.0</hadoop.version>
<hbase.version>0.98.6-cdh5.3.0</hbase.version>
</properties>
私のhbase.propertiseファイル:
hbase.zk.host=172.30.119.25
hbase.zk.port=2181
私のapplication-context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:hdp="http://www.springframework.org/schema/hadoop"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd">
<context:property-placeholder location="hbase.properties"/>
<context:component-scan base-package="org.springframework.samples.hadoop.hbase"/>
<hdp:configuration id="hadoopConfiguration">
fs.defaultFS=hdfs://172.30.119.25:8020
</hdp:configuration>
<hdp:hbase-configuration id="hbaseConfiguration" configuration-ref="hadoopConfiguration" zk-quorum="${hbase.zk.host}" zk-port="${hbase.zk.port}"/>
<bean id="hbaseTemplate" class="org.springframework.data.hadoop.hbase.HbaseTemplate">
<property name="configuration" ref="hbaseConfiguration"/>
</bean>
</beans>
サンプルを実行すると、次の例外が発生しました。
Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=35, exceptions:
Wed Jul 15 16:01:24 ICT 2015, org.apache.hadoop.hbase.client.RpcRetryingCaller@35988e16, java.net.UnknownHostException: unknown host: quickstart.cloudera
誰かが私がこの例外を解決するのを手伝ってもらえますか?
vmの外部でクライアントを実行している場合は、quickstart.cloudera
とその外部vmIPをに追加してみてください/etc/hosts
。
これらのVMは通常、外部から使用するようには設計されていませんが、clouderaのvmは、hortonworkのvmに比べて少し使いやすいです。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加