[英]Hbase java code getting stuck at Table Creation due to Solr exception in HDP 2.5 - SolrServers available to handle this reques
我正在嘗試使用java API將其與hbase連接。
我在192.168.56.101本地運行Hortonworks Sandbox(HDP 2.5)。
以下是我的java代碼
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;
public class InsertData{
public static void main(String[] args) throws IOException {
// Instantiating Configuration class
System.out.println("Trying to connect...");
Configuration configuration = HBaseConfiguration.create();
configuration.set("hbase.zookeeper.property.clientPort", "2181");
configuration.set("hbase.zookeeper.quorum", "192.168.56.101");
configuration.set("zookeeper.znode.parent", "/hbase-unsecure");
System.out.println("HBase is running!");
// creating a new table
HTable table = new HTable(configuration, "emp");
System.out.println("Table obtained ");
}
}
以下是輸出
Trying to connect...
HBase is running!
2017-03-21 14:32:37.974 java[12263:1255672] Unable to load realm mapping info from SCDynamicStore
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.3-1240972, built on 02/06/2012 10:48 GMT
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:host.name=lm-bng-00668684.paypalcorp.com
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0_45
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:java.home=/Applications/corona-java-1.1.0/jdk-7u45-macosx-x64/Contents/Home/jre
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:java.class.path=/Users/aditsharma/Documents/hbase/Trial_Hbase_run/bin:/Users/aditsharma/Downloads/zookeeper-3.4.3.jar:/Users/aditsharma/Downloads/slf4j-log4j12-1.5.8.jar:/Users/aditsharma/Downloads/slf4j-api-1.5.8.jar:/Users/aditsharma/Downloads/log4j-1.2.16.jar:/Users/aditsharma/Downloads/hbase-0.92.1.jar:/Users/aditsharma/Downloads/hadoop-core-1.0.0.jar:/Users/aditsharma/Downloads/commons-logging-1.1.1.jar:/Users/aditsharma/Downloads/commons-lang-2.6.jar:/Users/aditsharma/Downloads/commons-configuration-1.8.jar
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/Users/aditsharma/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/var/folders/_p/73y8zhkj7mvfzxk123s6l3_m3kg68v/T/
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:os.name=Mac OS X
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:os.arch=x86_64
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:os.version=10.11.6
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:user.name=aditsharma
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:user.home=/Users/aditsharma
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Client environment:user.dir=/Users/aditsharma/Documents/hbase/Trial_Hbase_run
17/03/21 14:32:38 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=192.168.56.101:2181 sessionTimeout=90000 watcher=hconnection
17/03/21 14:32:38 INFO zookeeper.ClientCnxn: Opening socket connection to server /192.168.56.101:2181
17/03/21 14:32:38 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 12263@LM-BNG-00668684
17/03/21 14:32:38 INFO client.ZooKeeperSaslClient: Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration.
17/03/21 14:32:38 INFO zookeeper.ClientCnxn: Socket connection established to 192.168.56.101/192.168.56.101:2181, initiating session
17/03/21 14:32:38 INFO zookeeper.ClientCnxn: Session establishment complete on server 192.168.56.101/192.168.56.101:2181, sessionid = 0x15aeff6fa460020, negotiated timeout = 40000
正如你所看到它被卡住了,“獲得的桌子”沒有被打印出來。 因此沒有獲得表格。
我正在使用以下罐子:
1)commons-configuration-1.8.jar
2)commons-lang-2.6.jar
3)commons-logging-1.1.1.jar
4)hadoop-core-1.0.0.jar
5)hbase-0.92.1.jar
6)log4j-1.2.16.jar
7)slf4j-api-1.5.8.jar
8)slf4j-log4j12-1.5.8.jar
9)zookeeper-3.4.3.jar
更新我還創建了一個可運行的jar並嘗試直接在集群上運行它。 它還沒有運行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.