gpt4 book ai didi

hadoop - 由于 HDP 2.5 中的 Solr 异常,Hbase java 代码在表创建时卡住 - SolrServers 可用于处理此请求

转载 作者:可可西里 更新时间:2023-11-01 15:56:40 27 4
gpt4 key购买 nike

我正在尝试使用 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

如您所见,它卡住了,“获得的表”没有打印出来。因此没有得到表。

我正在使用以下 jar :
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 并尝试直接在集群上运行它。它仍然没有运行。

最佳答案

您的错误与 HDP 2.5 中 HBase 工作所需的 Solr 引擎有关。尝试启动Infra服务和阿特拉斯服务。关注this文章来做到这一点。在此之后,您的 HBase 操作应该可以正常工作。

关于hadoop - 由于 HDP 2.5 中的 Solr 异常,Hbase java 代码在表创建时卡住 - SolrServers 可用于处理此请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42922668/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com