本文主要是介绍运行hadoop fs -ls 命令显示本地目录问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
环境CentOS6.4 CDH5.2
安装完成后发生如下问题
[hdfs@hadoop01 ~]$ hadoop fs -ls /
Found 25 items
-rw-r--r-- 1 root root 0 2016-08-17 10:47 /.autofsck
dr-xr-xr-x - root root 4096 2016-08-01 17:21 /bin
dr-xr-xr-x - root root 1024 2016-07-05 09:08 /boot
drwxr-xr-x - root root 4096 2016-07-06 23:49 /data
drwxr-xr-x - root root 3640 2016-08-17 10:47 /dev
drwxr-xr-x - root root 4096 2016-08-15 20:30 /dfs
drwxr-xr-x - root root 4096 2016-08-17 10:50 /etc
drwxr-xr-x - hadoop root 4096 2016-08-15 16:25 /hadoop
drwxr-xr-x - root root 4096 2016-07-17 15:29 /home
dr-xr-xr-x - root root 4096 2016-07-17 15:18 /lib
dr-xr-xr-x - root root 12288 2016-07-17 15:18 /lib64
drwx------ - root root 16384 2016-07-05 09:05 /lost+found
drwxr-xr-x - root root 4096 2011-09-23 19:50 /media
drwxr-xr-x - root root 4096 2011-09-23 19:50 /mnt
drwxr-xr-x - 1106 4001 4096 2015-08-22 05:34 /opt
dr-xr-xr-x - root root 0 2016-08-17 10:47 /proc
dr-xr-x--- - root root 4096 2016-08-17 10:49 /root
dr-xr-xr-x - root root 4096 2016-08-01 15:29 /sbin
drwxr-xr-x - root root 0 2016-08-17 10:47 /selinux
drwxr-xr-x - root root 4096 2011-09-23 19:50 /srv
drwxr-xr-x - root root 0 2016-08-17 10:47 /sys
drwxrwxrwt - root root 12288 2016-08-17 10:57 /tmp
drwxr-xr-x - root oinstall 4096 2016-07-24 14:54 /u01
drwxr-xr-x - root root 4096 2016-08-01 10:53 /usr
drwxr-xr-x - root root 4096 2016-07-05 09:06 /var
解决方案:
[root@hadoop01 ~]# cat /opt/cloudera/parcels/CDH-5.2.6-1.cdh5.2.6.p0.2/etc/hadoop/conf.empty/core-site.xml
<?xml version="1.0"?>
<!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements. See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
-->
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://hadoop01:8020</value>
</property>
</configuration>
配置客户端,添加defaultFS参数
这篇关于运行hadoop fs -ls 命令显示本地目录问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!