Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

zkcli client unable to fetch data

avatar
Rising Star

Trying to access the access zookeeper from the client. Throws up a Auth error. Executing as

./zkcli.sh -zkhost  localhost:2181 -cmd list

from the folder

/usr/lib/ambari-infra-solr/server/scripts/cloud-scripts

Gived the exception

Exception in thread "main" org.apache.zookeeper.KeeperException$NoAuthException: KeeperErrorCode = NoAuth for /hive
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:113)
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
        at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1155)
        at org.apache.solr.common.cloud.SolrZkClient$7.execute(SolrZkClient.java:345)
        at org.apache.solr.common.cloud.SolrZkClient$7.execute(SolrZkClient.java:342)
        at org.apache.solr.common.cloud.ZkCmdExecutor.retryOperation(ZkCmdExecutor.java:60)
        at org.apache.solr.common.cloud.SolrZkClient.getData(SolrZkClient.java:342)
        at org.apache.solr.common.cloud.SolrZkClient.printLayout(SolrZkClient.java:583)
        at org.apache.solr.common.cloud.SolrZkClient.printLayout(SolrZkClient.java:608)
        at org.apache.solr.common.cloud.SolrZkClient.printLayoutToStdOut(SolrZkClient.java:624)
        at org.apache.solr.cloud.ZkCLI.main(ZkCLI.java:244)

The kerberos ticket is initialized using kinit and have the permissions to access zk. Any pointers? Can some one let me know what Auth that is needed here?

5 REPLIES 5

avatar

@J Koppole, Since you are using kerberos, replace localhost with FQDN and re-run the command.

avatar
Rising Star

I was using FQDN just replaced with local host as I didnt want to post the hostname there. Tried both with FQDN and localhost

avatar
Contributor

Hi @J Koppole

you can do this before using zkcli.sh of infra-solr

sudo -u infra-solr -i

kinit -kt /etc/security/keytabs/ambari-infra-solr.service.keytab $(whoami)/$(hostname -f)

source /etc/ambari-infra-solr/conf/infra-solr-env.sh export SOLR_ZK_CREDS_AND_ACLS="${SOLR_AUTHENTICATION_OPTS}"

avatar
Rising Star

@Olivér Szabó

Its exactly the same error again

Exception in thread "main" org.apache.zookeeper.KeeperException$NoAuthException: KeeperErrorCode = NoAuth for /hive
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:113)
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
        at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1155)
        at org.apache.solr.common.cloud.SolrZkClient$7.execute(SolrZkClient.java:345)
        at org.apache.solr.common.cloud.SolrZkClient$7.execute(SolrZkClient.java:342)
        at org.apache.solr.common.cloud.ZkCmdExecutor.retryOperation(ZkCmdExecutor.java:60)
        at org.apache.solr.common.cloud.SolrZkClient.getData(SolrZkClient.java:342)
        at org.apache.solr.common.cloud.SolrZkClient.printLayout(SolrZkClient.java:583)
        at org.apache.solr.common.cloud.SolrZkClient.printLayout(SolrZkClient.java:608)
        at org.apache.solr.common.cloud.SolrZkClient.printLayoutToStdOut(SolrZkClient.java:624)
        at org.apache.solr.cloud.ZkCLI.main(ZkCLI.java:244)


avatar
Contributor

Sudo to infra-solr user

su - infra-solr

kinit -kt <solr-keytab>

and run

source /etc/ambari-infra-solr/conf/infra-solr-env.sh

/usr/lib/ambari-infra-solr/server/scripts/cloud-scripts/zkcli.sh --zkhost "${ZK_HOST}" -cmd list