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 即可;