1.描述
在cdh集群中zookeeper开启了kerberos认证。然后通过zookeeper-client登陆zookeeper命令行操作,删除节点的时候报错
删除命令:rmr /hbase
报错:Authentication is not valid : /hbase/splitWAl
说是 没有权限删除/hbase/splitWAL这个节点。我们运行zookeeper-client已经进行了zookeeper的主体认证了。
2.解决方式
1) 先使用命令查看该节点的权限
getAcl /hbase 返回结果如下图所示
可以看到sasl用户是hbase

2)编写jaas-zk-keytab.conf文件
Client {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
keyTab="/root/hbasenew.keytab"
storeKey=true
useTicketCache=false
principal="[email protected]";
};
3.在执行zookeeper-client前将jaas-zk-keytab.conf加载到环境变量
export CLIENT_JVMFLAGS="-Djava.security.auth.login.config=jaas-zk-keytab.conf"
4.登陆zookeeper
zookeeper-client -server master:2181
5.删除节点
成功删除。