【问题标题】:hbase error related to zookeeper与 zookeeper 相关的 hbase 错误
【发布时间】:2012-06-24 13:22:40
【问题描述】:

我刚刚开始使用 hbase。我试图执行以下java程序。这段代码创建了一个表并向表中添加了一些值,但我得到了以下提到的错误。

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;
import java.io.IOException;
public class PutExample {
public static void main(String[] args) throws IOException {
Configuration conf = HBaseConfiguration.create();
HTable table = new HTable(conf, "testtable");
Put put = new Put(Bytes.toBytes("row1"));
put.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"),
Bytes.toBytes("val1"));
put.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual2"),
Bytes.toBytes("val2"));
table.put(put);
}
}

错误:

12/06/24 13:11:24 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/home/y/lib
12/06/24 13:11:24 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
12/06/24 13:11:24 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
12/06/24 13:11:24 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
12/06/24 13:11:24 INFO zookeeper.ZooKeeper: Client environment:os.arch=i386
12/06/24 13:11:24 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.18-238.1.1.el5.YAHOO.20110221
12/06/24 13:11:24 INFO zookeeper.ZooKeeper: Client environment:user.name=indirav
12/06/24 13:11:24 INFO zookeeper.ZooKeeper: Client environment:user.home=/homes/indirav
12/06/24 13:11:24 INFO zookeeper.ZooKeeper: Client environment:user.dir=/homes/indirav
12/06/24 13:11:24 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=zkp201.gold.ygrid.yahoo.com:2181,zkp200.gold.ygrid.yahoo.com:2181,zkp202.gold.ygrid.yahoo.com:2181 sessionTimeout=180000 watcher=hconnection
12/06/24 13:11:24 INFO zookeeper.ClientCnxn: Opening socket connection to server /67.195.222.180:2181
12/06/24 13:11:24 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 23935@inngw1003.gold.ygrid.yahoo.com
12/06/24 13:11:24 WARN client.ZooKeeperSaslClient: SecurityException: java.lang.SecurityException: /config/jaas.config (No such file or directory) occurred when trying to find JAAS configuration.
12/06/24 13:11:24 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.
12/06/24 13:11:24 WARN zookeeper.ClientCnxn: SASL authentication failed: javax.security.auth.login.LoginException: Zookeeper client cannot authenticate using the 'Client' section of the supplied JAAS configuration: '/config/jaas.config' because of a SecurityException: java.lang.SecurityException: /config/jaas.config (No such file or directory) Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it.
12/06/24 13:11:24 INFO zookeeper.ClientCnxn: Socket connection established to zkp201.gold.ygrid.yahoo.com/67.195.222.180:2181, initiating session
12/06/24 13:11:24 WARN zookeeper.ClientCnxnSocket: Connected to an old server; r-o mode will be unavailable
12/06/24 13:11:24 INFO zookeeper.ClientCnxn: Session establishment complete on server zkp201.gold.ygrid.yahoo.com/67.195.222.180:2181, sessionid = 0x2349e7f54fbbd87, negotiated timeout = 40000
12/06/24 13:11:25 WARN client.HConnectionManager$HConnectionImplementation: RemoteException connecting to RS
org.apache.hadoop.ipc.RemoteException: Authentication is required
        at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:918)
        at org.apache.hadoop.hbase.ipc.SecureRpcEngine$Invoker.invoke(SecureRpcEngine.java:164)
        at $Proxy5.getProtocolVersion(Unknown Source)
        at org.apache.hadoop.hbase.ipc.SecureRpcEngine.getProxy(SecureRpcEngine.java:208)
        at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:303)
        at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:280)
        at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:332)
        at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:236)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHRegionConnection(HConnectionManager.java:1278)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHRegionConnection(HConnectionManager.java:1235)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHRegionConnection(HConnectionManager.java:1222)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:918)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:814)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:782)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:915)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:818)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:782)
        at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:249)
        at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:213)
        at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:171)
        at PutExample.main(PutExample.java:12)

请大家帮忙。

【问题讨论】:

    标签: hbase apache-zookeeper


    【解决方案1】:

    org.apache.hadoop.ipc.RemoteException:需要身份验证

    您的客户端似乎没有写入集群的写入凭据。查看the docs

    【讨论】:

    • 我可以从 shell 中做到这一点。
    • 如何给客户权限?我只是将 mod 777 更改为 Hbase 将数据写入 HDFS 的目录
    【解决方案2】:

    您需要确保您的路径中有 HBase 配置脚本(例如,包含 hbase-site.xml 的 $HBASE_CONF 目录)并且您的配置包含正确访问 zookeeper 的信息

    【讨论】:

      猜你喜欢
      • 2014-12-18
      • 1970-01-01
      • 1970-01-01
      • 2012-03-02
      • 2016-04-08
      • 2011-07-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多