您好,登錄后才能下訂單哦!
zookeeper配置了kerberos之后,zkCli.sh 連接認(rèn)證死活不通過
連接命令: zkCli.sh
報(bào)錯(cuò)如下:
WatchedEvent state:SyncConnected type:None path:null 2017-08-21 10:11:42,054 [myid:] - ERROR [main-SendThread(localhost:2181):ZooKeeperSaslClient@308] - An error: (java.security.PrivilegedActionException: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7) - LOOKING_UP_SERVER)]) occurred when evaluating Zookeeper Quorum Member's received SASL token. Zookeeper Client will go to AUTH_FAILED state. 2017-08-21 10:11:42,054 [myid:] - ERROR [main-SendThread(localhost:2181):ClientCnxn$SendThread@1072] - SASL authentication with Zookeeper Quorum member failed: javax.security.sasl.SaslException: An error: (java.security.PrivilegedActionException: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7) - LOOKING_UP_SERVER)]) occurred when evaluating Zookeeper Quorum Member's received SASL token. Zookeeper Client will go to AUTH_FAILED state.
查了很久,終于在kdc的日志中找到了蛛絲馬跡,如下
Aug 21 10:11:42 master krb5kdc[21935](info): TGS_REQ (6 etypes {18 17 16 23 1 3}) 192.168.100.144: LOOKING_UP_SERVER: authtime 0, zkcli@NETEASE.COM for zookeeper/localhost@NETEASE.COM, Server not found in Kerberos database
原因分析:1、在zookeeper的認(rèn)證請(qǐng)求中,zookeeper端的默認(rèn)principall應(yīng)該是zookeeper/<hostname>@<realm>
2、當(dāng)采用zkCli.sh 的方式請(qǐng)求中,默認(rèn)的host應(yīng)該是localhost
因此在kdc中才會(huì)發(fā)現(xiàn)客戶端的請(qǐng)求和 zookeeper/localhost@NETEASE.COM 這個(gè)principal進(jìn)行認(rèn)證,但是在kerberos的database中卻沒有這個(gè)principal。
解決方法: 使用zkCli.sh -server host:port 訪問。 同時(shí)zookeeper配置文件中sever部分的principal必須為zookeeper/<hostname>@<your realm>
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。