hadoop core-site.xml语法错误

时间:2015-01-02 17:45:11

标签: xml macos hadoop

为了安装hadoop,我使用这个: http://blog.tundramonkey.com/2013/02/24/setting-up-hadoop-on-osx-mountain-lion

陷入core-site.xml步骤。建议更新后,我的core-site.xml文件是:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
  <property>
    <name>fs.default.name</name>
    <value>hdfs://localhost:9000</value>
  </property>
 <property>
<name>hadoop.tmp.dir</name>
<value>/tmp/hadoop-${user.name}</value>
<description>A base for other temporary directories.</description>
 </property>
</configuration>

其终端运行返回错误:

第1行:意外令牌newline' line 1:附近的语法错误

任何* .xml文件中都会弹出此错误。

1 个答案:

答案 0 :(得分:0)

创建目录并设置所需的所有权和权限:

$ sudo mkdir -p /app/hadoop/tmp
$ sudo chown hduser:hadoop /app/hadoop/tmp
# ...and if you want to tighten up security, chmod from 755 to 750...
$ sudo chmod 750 /app/hadoop/tmp

设置core-site.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>
</property>