简体   繁体   English

尝试使用Java HBase客户端连接到AWS EC2 Hbase

[英]Try to connect to aws ec2 Hbase using java hbase client

when I try to use java hbase client to create a table on my aws hbase , it gives me exceptions: 当我尝试使用java hbase客户端在aws hbase上创建表时,它给了我一个例外:

org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:

Sun Dec 13 08:26:29 EST 2015, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=69130: row 'wujintao,,00000000000000' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=Slave1,60020,1449708947932, seqNum=0

And my java code is like this: 我的java代码是这样的:

public static Configuration configuration; 
static { 
    configuration = HBaseConfiguration.create(); 
    configuration.set("hbase.zookeeper.property.clientPort", "2181"); 
    configuration.set("hbase.zookeeper.quorum","ec2-52-2-133-43.compute-1.amazonaws.com,ec2-52-70-140-152.compute-1.amazonaws.com,ec2-52-70-195-91.compute-1.amazonaws.com"); 
//  configuration.set("hbase.zookeeper.property.clientPort","2181"); 

    configuration.set("hbase.master", "*ec2-52-2-133-43.compute-1.amazonaws.com:9000"); 
}

does it means it has connected to the master but failed on the slaves? 这是否意味着它已连接到主机但在从机上发生了故障? why fail? 为什么失败?

Does hostname=Slave1,60020 defined in /etc/hosts file or Slave1 hostname is accessible from your client machine and master ? 是否可以从客户端计算机和主机访问/ etc / hosts文件中定义的hostname=Slave1,60020或Slave1主机名? Hbase and others works with hostnames, even if you attemp to connect with ip, it will return hostname and try to use in it next call. Hbase和其他主机名都可以使用主机名,即使您尝试使用ip连接,它也会返回主机名并尝试在下一次调用中使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM