我正在阅读最终的hadoop书。在那里,作者描述了如何通过定义hadoop.job.ugi
来覆盖whoAmI机制。好吧,我没有随处可见......
我正在使用hduser @ ubuntu(我的盒子名称)。
我创建了一个localhost.conf来覆盖默认的conf:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>Default block replication.
The actual number of replications can be specified when the file is created.
The default is used if replication is not specified in create time.
</description>
</property>
<property>
<name>mapred.job.tracker</name>
<value>localhost:54311</value>
<description>The host and port that the MapReduce job tracker runs
at. If "local", then jobs are run in-process as a single map
and reduce task.
</description>
</property>
<property>
<name>hadoop.job.ugi</name>
<value>user, supergroup</value>
</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>
</configuration>
但是当我运行hadoop fs -conf localhost.conf -mkdir newDir
后跟hadoop fs -conf localhost.conf -ls .
时,我看到目录newDir是由 hduser 创建的,而不是由用户
我一定错过了一个设置......
提前致谢。