Indra Vikas
Indra Vikas

Reputation: 59

hbase error related to zookeeper

i have just started using hbase. I tried to execute following java program. This code creates a table and adding some value to table but i am getting following mentioned error.

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);
}
}

Error:

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 [email protected]
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)

Anyone please help.

Upvotes: 3

Views: 6135

Answers (2)

David
David

Reputation: 3261

You need to be sure that you have the HBase configuration scripts in your path (e.g. the $HBASE_CONF dir that contains hbase-site.xml) and that your configuration contains information to access zookeeper correctly

Upvotes: 1

sbridges
sbridges

Reputation: 25140

org.apache.hadoop.ipc.RemoteException: Authentication is required

Looks like your client does not have the write credentials to write to the cluster. Check out the docs.

Upvotes: 2

Related Questions