【Apache Hadoop系列】hadoop伪分布式配置问题集锦

问题1:could only be replicated to 0 nodes, instead of 1

2013-06-24 11:39:32,383 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:zqgame cause:java.io.IOException: File /data/zqhadoop/data/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2013-06-24 11:39:32,384 INFO org.apache.hadoop.ipc.Server: IPC Server handler 1 on 9000, call addBlock(/data/zqhadoop/data/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_-344066732_1, null) from 192.168.216.133:59866: error: java.io.IOException: File /data/zqhadoop/data/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
java.io.IOException: File /data/zqhadoop/data/mapred/system/jobtracker.info <span style="color:#FF0000;">could only be replicated to 0 nodes, instead of 1</span>
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
这里hadoop去查找可用的节点,但是结果找不到。

问题处在/etc/hosts和$HADOOP_HOME/conf/mapred-site.xml和core-site.xml。

解决方法:

1、修改$HADOOP_HOME/conf/mapred-site.xml和core-site.xml,把host修改为IP地址

core-site.xml

zqgame@master:~/hadoop-1.2.0/bin$ more ../conf/core-site.xml 
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
        <property>
         <name>fs.default.name</name>
         <value>hdfs://192.168.216.133:9000</value>
     </property>
        <property>
                <name>hadoop.tmp.dir</name>
                <value>/data/zqhadoop/data</value>
        </property>
</configuration>
mapred-site.xml

zqgame@master:~/hadoop-1.2.0/bin$ more ../conf/mapred-site.xml 
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
        <property>
         <name>mapred.job.tracker</name>
         <value>192.168.216.133:9001</value>
     </property>
</configuration>

2、修改/etc/hosts配置,添加本机IP绑定

zqgame@master:~/hadoop-1.2.0/bin$ more /etc/hosts
127.0.0.1       localhost
127.0.1.1       master
<span style="color:#FF0000;">192.168.216.133 localhost.localdomain localhost</span>

3、关闭防火墙


转账请注明:http://blog.csdn.net/weijonathan/article/details/9162619


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值