【Kerberos】开启了kerberos的ambari中组件shell访问( 二 )


所以开启了后的服务,就要使用证明我们这个客户端有权限
[root@host-10-211-55-60 keytabs]# kinit -kt hbase.headless.keytab hbase-testcluster@HONEY.COM[root@host-10-211-55-60 keytabs]# klistTicket cache: FILE:/tmp/krb5cc_0Default principal: hbase-testcluster@HONEY.COMValid startingExpiresService principal03/03/2020 10:36:2403/04/2020 10:36:24krbtgt/HONEY.COM@HONEY.COM[root@host-10-211-55-60 keytabs]# hbase shellhbase(main):002:0> create 'hb_test','base_info'Created table hb_testTook 4.5764 seconds=> Hbase::Table - hb_testhbase(main):003:0> listTABLEhb_test1 row(s)Took 0.0303 seconds=> ["hb_test"]
比如我要继续访问hdfs,当前hbase的就有权限访问hdfs,不需要切换
[hdfs@host-10-211-55-60 honey]$ hdfs dfs -put /home/hdfs/word.txt /dataDir/ww.txt[hdfs@host-10-211-55-60 honey]$ kdestroy [hdfs@host-10-211-55-60 honey]$ hdfs dfs -put /home/hdfs/word.txt /dataDir/wx.txt20/03/03 11:14:33 WARN ipc.Client: Exception encountered while connecting to the server : org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]put: DestHost:destPort host-10-211-55-60:8020 , LocalHost:localPort host-10-211-55-60/10.211.55.60:0. Failed on local exception: java.io.IOException: org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]
这样不同组件不同来回切换,当然很麻烦,所以直接kinit admin/admin@REALM就好了 。
【【Kerberos】开启了kerberos的ambari中组件shell访问】参考链接