尝试在 Ubuntu 16.04 中创建从 sql server 2017 到 Hadoop 的外部表时,会引发以下错误
消息 105019,级别 16,状态 1,行 1 外部表访问因内部错误而失败:'调用 HdfsBridge_IsDirExist 时引发 Java 异常。Java 异常消息:从 DESKTOP-VE8KNAG/xxx.xxx.x.xxx 调用到 xxx.xxx.xx:54310 连接异常失败:java.net.ConnectException:连接被拒绝:没有更多信息;有关更多详细信息,请参阅: http ://wiki.apache.org/hadoop/ConnectionRefused:错误 [从 DESKTOP-VE8KNAG/1xxx.xxx.x.xxx 调用到 xxx.xxx.xx:54310 连接异常失败:java.net .ConnectException:连接被拒绝:没有更多信息;有关更多详细信息,请参阅: http://wiki.apache.org/hadoop/ConnectionRefused]在访问外部文件时发生。
- 从 core-site.xml 获取外部源位置
- tmp 文件夹被创建并添加了权限给用户并添加到 core-site.xml
- 所有节点都在 Hadoop 中运行 10625 DataNode 10869 SecondaryNameNode 17113 ResourceManager 17434 NodeManager 10490 NameNode 21566 Jps
sql查询
create EXTERNAL DATA SOURCE [HDP2]
WITH (TYPE = HADOOP,
LOCATION = N'hdfs://xxx.xxx.x.x:54310',
CREDENTIAL = [HDPUser])
GO
create EXTERNAL TABLE [dbo].CLASS_DIM_EXP (
[CLASS_ID] [varchar](8) NOT NULL,
[CLASS_DESC] [varchar](100) NULL,
[INSERT_DATE] [datetime2](7) NOT NULL,
[LAST_UPDATE_DATETIME] [datetime2](7) NOT NULL)
WITH (LOCATION='/user/pdw_user',
DATA_SOURCE = HDP2,
FILE_FORMAT = TSV,
REJECT_TYPE = VALUE,
REJECT_VALUE = 0);
核心站点.xml
<property>
<name>hadoop.tmp.dir</name>
<value>/app/hadoop/tmp</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:54310</value>
<description>The name of the default file system. A URI whose
scheme and authority determine the FileSystem implementation. The
uri's scheme determines the config property (fs.SCHEME.impl) naming
the FileSystem implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.</description>
</property>
有什么需要改变的吗?