罗列开发过程中遇到的问题,异常提示有unable to obtain password,也有failed to find any kerberos tgt等,与问题相关性不大,因此就不列出异常了。记录当时的排查思路可能更有价值。
keytab未上传,导致读取不到
排查思路
// 在sparkSession构建后,方可使用SparkFiles#get
if (null == SparkFiles.get("xxx.keytab")) throw new RuntimeExceptiion("keytab未上传")
解决方案
- 要么通过spark-submit --files xxx.keytab上传
- 要么在代码中通过sparkContext.addFile(“xxx.keytab”)上传
没有配置使用kerberos认证,实质kerberos认证不成功
排查思路
本地调试,断点打在UserGroupInfomation#loginUserFromKeytab:
public synchronized
static void loginUserFromKeytab(String user, String path) throws IOException {
// 断点打在下一行
if (!isSecurityEnabled
最低0.47元/天 解锁文章
4843

被折叠的 条评论
为什么被折叠?



