通過查閱,得知UserGroupInformation這個類JAAS 框架上封裝了Hadoop的使用者資訊
有兩種方法:loginUserFromKeytab:呼叫checkTGTAndReloginFromKeytab來更新憑證,直接使用 keytab檔案以及principal呼叫實現。 getLoginUser:需要自己實現憑證,並起另一個執行緒實現週期性憑證更新,麻煩 所以使用loginUserFromKeytab來實現認證 這裡報了:Can't get Kerberos realm 跟著 UserGroupInformation.setConfiguration(configuration)方法走,一步一步看原始碼就行,這裡說兩個關鍵點吧

