Polybase EXTERNAL TABLE访问失败 - 权限被拒绝

时间:2016-06-13 07:56:44

标签: sql sql-server

我想在sql server 2016中通过polybase连接到hadoop。 我的代码是:

 CREATE EXTERNAL DATA SOURCE MyHadoopCluster WITH (  
      TYPE = HADOOP,   
       LOCATION ='hdfs://192.168.114.20:8020', 
       credential= HadoopUser1  
      );  


CREATE EXTERNAL FILE FORMAT TextFileFormat WITH (  
        FORMAT_TYPE = DELIMITEDTEXT,   
     FORMAT_OPTIONS (FIELD_TERMINATOR ='\001',   
             USE_TYPE_DEFAULT = TRUE)
);


CREATE EXTERNAL TABLE [dbo].[test_hadoop] (  
        [Market_Name] int NOT NULL,   
        [Claim_GID] int NOT NULL,   
        [Completion_Flag] int NULL,   
        [Diag_CDE] float NOT NULL,   
        [Patient_GID] int NOT NULL, 
        [Record_ID] int NOT NULL, 
        [SRVC_FROM_DTE] int NOT NULL  
)  
WITH (LOCATION='/applications/gidr/processing/lnd/sha/clm/cf/claim_diagnosis',   
        DATA_SOURCE = MyHadoopCluster,  
        FILE_FORMAT = TextFileFormat

);  

我收到了这个错误:

  

由于内部错误,EXTERNAL TABLE访问失败:'Java异常   在调用HdfsBridge_GetDirectoryFiles时引发:错误[Permission   否认:user = pdw_user,access = READ_EXECUTE,   索引节点= “/应用/ gidr /处理/ LND / SHA / CLM / CF / claim_diagnosis”:根:超组:drwxrwxr--     在   org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkFsPermission(DefaultAuthorizationProvider.java:281)     在   org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.check(DefaultAuthorizationProvider.java:262)     在   org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkPermission(DefaultAuthorizationProvider.java:175)     在   org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:152)     在   org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission(FSNamesystem.java:6590)     在   org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission(FSNamesystem.java:6572)     在   org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPathAccess(FSNamesystem.java:6497)     在   org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getListingInt(FSNamesystem.java:5034)     在   org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getListing(FSNamesystem.java:4995)     在   org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.getListing(NameNodeRpcServer.java:882)     在   org.apache.hadoop.hdfs.server.namenode.AuthorizationProviderProxyClientProtocol.getListing(AuthorizationProviderProxyClientProtocol.java:335)     在   org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.getListing(ClientNamenodeProtocolServerSideTranslatorPB.java:615)     在   org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos $ ClientNamenodeProtocol $ 2.callBlockingMethod(ClientNamenodeProtocolProtos.java)     在   org.apache.hadoop.ipc.ProtobufRpcEngine $服务器$ ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:617)     在org.apache.hadoop.ipc.RPC $ Server.call(RPC.java:1073)at at   org.apache.hadoop.ipc.Server $ Handler $ 1.run(Server.java:2086)at at   org.apache.hadoop.ipc.Server $ Handler $ 1.run(Server.java:2082)at at   java.security.AccessController.doPrivileged(Native Method)at   javax.security.auth.Subject.doAs(Subject.java:415)at   org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1693)     在org.apache.hadoop.ipc.Server $ Handler.run(Server.java:2080)]   访问外部文件时发生。'

问题是,在最新版本的polybase中没有配置文件,您可以在其中指定hadoop默认登录名和密码。所以即使在我创建范围凭证时,polybase仍然使用默认的pdw_user。我甚至尝试在hadoop上创建pdw_user,但仍然遇到此错误。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

如果您拥有Kerberos安全Hadoop集群,请确保按照https://docs.microsoft.com/en-us/sql/relational-databases/polybase/polybase-configuration所述更改xml文件

如果它不是Kerberos安全的Hadoop集群,请确保默认用户pdw_user具有对hdfs的读访问权限并对Hive执行权限。