sqoop import hbase by kerberos安全认证下

2020-07-15 16:30:47,365 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Can't get Master Kerberos principal for use as renewer
        at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:116)
        at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:100)
        at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodes(TokenCache.java:80)
        at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:142)
        at org.apache.hadoop.mapreduce.JobSubmitter.checkSpecs(JobSubmitter.java:266)
        at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:139)
        at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1290)
        at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1287)
        at java.security.AccessController.doPrivileged(Native Method
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
如果你的Hive环境启用了LDAP认证,那么在使用Sqoop导入数据时,需要在Sqoop命令中指定Kerberos认证相关参数。 以下是一个示例命令: ``` sqoop import \ --connect jdbc:mysql://hostname:port/dbname \ --username hive \ --password hive_password \ --table table_name \ --hive-import \ --hive-table hive_table_name \ --create-hive-table \ --hive-overwrite \ --hiveconf hive.metastore.uris=thrift://hive-metastore-hostname:9083 \ --hiveconf hive.server2.authentication.kerberos.principal=hive/[email protected] \ --hiveconf hive.server2.authentication.kerberos.keytab=/path/to/hive.keytab \ --hiveconf hive.server2.authentication.ldap.url=ldap://ldap-server-hostname:389 \ --hiveconf hive.server2.authentication.ldap.baseDN=dc=ldap,dc=example,dc=com \ --hiveconf hive.server2.authentication.ldap.Domain=ldap.example.com \ --hiveconf hive.server2.authentication.ldap.Group=ldap_group_name \ --hiveconf hive.server2.authentication.ldap.UserDNPattern=uid={0},ou=users,dc=ldap,dc=example,dc=com ``` 其中,需要注意以下几点: 1. `hive.metastore.uris` 参数需要指定Hive metastore的地址,这里使用了thrift协议; 2. `hive.server2.authentication.kerberos.principal` 参数需要指定Hive服务的Kerberos principal名称; 3. `hive.server2.authentication.kerberos.keytab` 参数需要指定Hive服务的Kerberos keytab路径; 4. `hive.server2.authentication.ldap.url` 参数需要指定LDAP服务器的地址和端口号; 5. `hive.server2.authentication.ldap.baseDN` 参数需要指定LDAP根目录的DN; 6. `hive.server2.authentication.ldap.Domain` 参数需要指定LDAP域名; 7. `hive.server2.authentication.ldap.Group` 参数需要指定LDAP中的用户组名称; 8. `hive.server2.authentication.ldap.UserDNPattern` 参数需要指定LDAP中用户的DN格式。 根据实际情况,你需要替换上述命令中的一些参数的值。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值