Failed to connect to Sentry service Config key

INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Executing command(queryId=hadoop_20180713115353_a988c429-17a0-4b95-abce-458a9ffcc004): drop table if exists tmp.fbi_loan_detail_yrd_tmp01
INFO  : Starting task [null:DDL] in serial mode
ERROR : FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.SentryFilterDDLTask. MetaException(message:Failed to connect to Sentry service Config key sentry.service.client.server.rpc-address is required)
INFO  : Completed executing command(queryId=hadoop_20180713115353_a988c429-17a0-4b95-abce-458a9ffcc004); Time taken: 0.404 seconds
Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.SentryFilterDDLTask. MetaException(message:Failed to connect to Sentry service Config key sentry.service.client.server.rpc-address is required) (state=08S01,code=1)

报错如上

前提sentry 配置的是file 权限而不是server 为什么还会去链接server 呢?

版本:1.5.1 cdh 5.7.0

在 SentryMetastorePostEventListener 内发现此方法

/**
   * Drop the privileges on the database. Note that child tables will be
   * dropped individually by client, so we just need to handle the removing
   * the db privileges. The table drop should cleanup the table privileges.
   */
  @Override
  public void onDropDatabase(DropDatabaseEvent dbEvent) throws MetaException {

    // don't sync paths/privileges if the operation has failed
    if (!dbEvent.getStatus()) {
      LOGGER.debug("Skip syncing paths/privileges with Sentry server for onDropDatabase event," +
        " since the operation failed. \n");
      return;
    }

    String authzObj = dbEvent.getDatabase().getName();
    for (SentryMetastoreListenerPlugin plugin : sentryPlugins) {
      List<String> tNames = dbEvent.getHandler().get_all_tables(authzObj);
      plugin.removeAllPaths(authzObj, tNames);
    }
    if (!syncWithPolicyStore(AuthzConfVars.AUTHZ_SYNC_DROP_WITH_POLICY_STORE)) {
      return;
    }

    dropSentryDbPrivileges(dbEvent.getDatabase().getName());
  }
也就是说当您droptable 的时候他会去默认drop权限 ,drop权限时就会链接 sentry server 也就是走到这个代码时 
dropSentryDbPrivileges(dbEvent.getDatabase().getName());

发现前一条代码:

if (!syncWithPolicyStore(AuthzConfVars.AUTHZ_SYNC_DROP_WITH_POLICY_STORE)) {
  return;
}
AUTHZ_SYNC_DROP_WITH_POLICY_STORE("sentry.hive.sync.drop", "true"),

 

也就是说在sentry-site里sentry.hive.sync.drop 设置为false 即可;

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值