Java-код Hbase застревает при создании таблицы из-за исключения Solr в HDP 2.5 - доступны SolrServer для обработки этого запроса
Я пытаюсь использовать Java API для соединения с hbase.
Я использую Hortonworks Sandbox(HDP 2.5) локально 192.168.56.101.
Ниже мой код 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 и попытался запустить его непосредственно на кластере. Тем не менее это не работает.