我在独立的cloudera vm上运行Hbase
。我只是尝试从我的java代码连接到hbase,但始终获得此异常。我没有在hbase-site.xml
中输入任何内容。我也有Hbase和zookeper启动并运行。以下是我得到的例外情况:
明2.6.0-cdh5.7.0.jar:/ usr / lib中/ Hadoop的映射精简/.// Hadoop的MapReduce的客户端 - HS-plugins.jar:/ usr / lib中/ Hadoop的映射精简/./ /hadoop-mapreduce-client-jobclient-tests.jar
16/08/03 23:04:33 INFO zookeeper.ZooKeeper:客户端环境:java.library.path = / usr / lib / hadoop / lib / native
16/08/03 23:04:33 INFO zookeeper.ZooKeeper:客户端环境:java.io.tmpdir = / tmp
16/08/03 23:04:33 INFO zookeeper.ZooKeeper:客户端环境:java.compiler =
16/08/03 23:04:33 INFO zookeeper.ZooKeeper:客户端环境:os.name = Linux
16/08/03 23:04:33 INFO zookeeper.ZooKeeper:客户环境:os.arch = amd64
16/08/03 23:04:33 INFO zookeeper.ZooKeeper:客户环境:os.version = 2.6.32-573.el6.x86_64
16/08/03 23:04:33 INFO zookeeper.ZooKeeper:客户环境:user.name = cloudera
16/08/03 23:04:33 INFO zookeeper.ZooKeeper:客户环境:user.home = / home / cloudera
16/08/03 23:04:33 INFO zookeeper.ZooKeeper:客户环境:user.dir = / home / cloudera
16/08/03 23:04:33 INFO zookeeper.ZooKeeper:启动客户端连接,connectString = localhost:2181 sessionTimeout = 90000 watcher = hconnection-0x2da61880x0,quorum = localhost:2181,baseZNode = / hbase
16/08/03 23:04:33 INFO zookeeper.ClientCnxn:打开与服务器的套接字连接quickstart.cloudera / 127.0.0.1:2181。不会尝试使用SASL进行身份验证(未知错误)
16/08/03 23:04:33 INFO zookeeper.ClientCnxn:已建立套接字连接,启动会话,客户端:/127.0.0.1:56535,server:quickstart.cloudera / 127.0.0.1:2181
16/08/03 23:04:33 INFO zookeeper.ClientCnxn:服务器上的会话建立完成quickstart.cloudera / 127.0.0.1:2181,sessionid = 0x1562b869790000e,协商超时= 40000
16/08/03 23:04:33 INFO mapreduce.HFileOutputFormat:查找表用户的当前区域; hconnection-0x2da6188 org.apache.hadoop.hbase.client.RetriesExhaustedException:尝试次数= 36后失败,例外:
Wed Aug 03 23:05:21 PDT 2016,null,java.net.SocketTimeoutException:callTimeout = 60000,callDuration = 68660:row' user ,, 00000000000000'在桌子上' hbase:meta' at region = hbase:meta ,, 1.1588230740,hostname = quickstart.cloudera,60020,1469171048401,seqNum = 0
这是我的java代码。
public int run(String[] args) throws Exception {
int result=0;
String outputPath = args[1];
Configuration configuration = getConf();
configuration.set("data.seperator", DATA_SEPERATOR);
configuration.set("hbase.table.name",TABLE_NAME);
configuration.set("COLUMN_FAMILY_1",COLUMN_FAMILY_1);
configuration.set("COLUMN_FAMILY_2",COLUMN_FAMILY_2);
Job job = new Job(configuration);
job.setJarByClass(HBaseBulkLoadDriver.class);
job.setJobName("Bulk Loading HBase Table::"+TABLE_NAME);
job.setInputFormatClass(TextInputFormat.class);
job.setMapOutputKeyClass(ImmutableBytesWritable.class);
job.setMapperClass(HBaseBulkLoadMapper.class);
FileInputFormat.addInputPaths(job, args[0]);
FileSystem.getLocal(getConf()).delete(new Path(outputPath), true);
FileOutputFormat.setOutputPath(job, new Path(outputPath));
job.setMapOutputValueClass(Put.class);
HFileOutputFormat.configureIncrementalLoad(job, new HTable(configuration,TABLE_NAME));
job.waitForCompletion(true);
if (job.isSuccessful()) {
HBaseBulkLoad.doBulkLoad(outputPath, TABLE_NAME);
} else {
result = -1;
}
return result;
}
答案 0 :(得分:0)
Zookeeper正在通过localhost解决并连接正常。你能解决quickstart.cloudera吗?我猜这是一个DNS问题,因为调用超时到quickstart.cloudera。那有意义吗?