$ cat etc/hadoop/hdfs-site.xml
(hadoop-coc-1和hadoop-coc-2)。两个HDFS都在使用WebHDFS正常运行。但是,使用此配置,defaultFS服务未运行。也许这是我无法将数据从本地磁盘复制到HDFS的原因。
我尝试使用以下命令复制数据:
$ hdfs dfs -copyFromLocal ~/input1 webhdfs://hadoop-coc-1/
Java HotSpot(TM) Client VM warning: You have loaded library /home/xubuntu/Programs/hadoop-2.6.0/lib/native/libhadoop.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
15/03/02 12:32:47 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
copyFromLocal: Connection refused
$ curl -i -X PUT -T ~/input1 "http://hadoop-coc-1:8080/?op=CREATE"
HTTP/1.1 100 Continue
HTTP/1.1 405 HTTP method PUT is not supported by this URL
Date: Mon, 02 Mar 2015 17:34:35 GMT
Pragma: no-cache
Date: Mon, 02 Mar 2015 17:34:35 GMT
Pragma: no-cache
Content-Length: 0
Server: Jetty(6.1.26)
我不明白为什么我无法将数据从本地磁盘复制到使用WebHDfS协议的HDFS。有什么帮助来理解这个错误?为什么我无法将数据从本地磁盘复制到HDFS?我是否配置好hdfs-site.xml?
hadoop-coc-1和hadoop-coc-2主机中的hdfs-site.xml。
<configuration>
<property>
<name>dfs.nameservices</name>
<value>ns1,ns2</value>
</property>
<property>
<name>fs.defaultFS.ns1</name>
<value>hdfs://hadoop-coc-1:9000</value>
</property>
<property>
<name>fs.defaultFS.ns2</name>
<value>hdfs://hadoop-coc-2:9000</value>
</property>
<property>
<name>dfs.namenode.rpc-address.ns1</name>
<value>hadoop-coc-1:6600</value>
</property>
<property>
<name>dfs.namenode.http-address.ns1</name>
<value>hadoop-coc-1:8080</value>
</property>
<property>
<name>dfs.namenode.secondaryhttp-address.ns1</name>
<value>hadoop-coc-1:8080</value>
</property>
<property>
<name>dfs.namenode.rpc-address.ns2</name>
<value>hadoop-coc-2:6600</value>
</property>
<property>
<name>dfs.namenode.http-address.ns2</name>
<value>hadoop-coc-2:8080</value>
</property>
<property>
<name>dfs.namenode.secondaryhttp-address.ns2</name>
<value>hadoop-coc-2:8080</value>
</property>
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
<property>
<name>dfs.support.append</name>
<value>true</value>
</property>
</configuration>
答案 0 :(得分:1)
默认Web服务器端口为50070,数据由端口 50075 上的Web服务器从数据节点流式传输。你在某个地方改变了这个配置吗?
此外,当您尝试将数据复制到webdfs时,您指定了无端口