hadoop启动时datanode报错问题解决方案汇总

来源:互联网 发布:获取手机号码软件下载 编辑:程序博客网 时间:2024/06/10 08:19


20170426搜集解决方案:


1.解决方案(关闭安全模式):
  bin/hadoop dfsadmin -safemode leave
  bin/hadoop dfs -chmod -R 777 /tmp
 
hadoop dfsadmin -report看看datanode是否运行
 
2.hdfs-site.xml 配置name路径 
  <configuration>
<property>
  <name>dfs.name.dir</name>
  <value>file:/home/hadoop/dfs/name</value>
</property>
<property>
  <name>dfs.data.dir</name>
  <value>file:/home/hadoop/dfs/data</value>
</property>
  </configuration>


3.hadoop各种xml配置文件中ip地址都用hosts文件中对应的别名设置。
4.删除hosts文件中localhost等配置,自己明确定义每个ip对应的别名。






20170427新搜集解决方案:


一。保持master节点上namespaceid和子节点上的一致:
0.20.2版本解决方式:
1、查看名称节点上(即在配置文件中配置的hadoop.tmp.dir参数路径)/usr/hadoop0.20.2/hadoop-huanghz/dfs/name/current/文件夹中VERSION文件中的namespaceid;
2、在两个数据节点修改上dfs.data.dir配置的路径下current文件夹中的VERSION文件namespaceid与名称节点保持一致
 
2.20版本解决
/data/hadoop/dfs/name/current/VERSION
用name下面的clusterID,修改datanode的/data/hadoop/dfs/data/current/VERSION 里面的clusterID
每次格式化,name下面的VERSION的clusterID会产生一个新的ID,要去修改各个节点的VERSION的clusterID






二。hdfs-site.xml文件的配置问题,置的路径*/dfs/name注意权限的问题,前面需要加file://(不是hdfs?),否则格式化失败
<property>
<name>dfs.name.dir</name> 
<value>file:///home/grid/hadoop-2.5.2/dfs/name</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>file:///home/grid/hadoop-2.5.2/dfs/data</value>
</property>


三。关闭防火墙:***********非常重要*********** 
# systemctl status firewalld.service  --查看防火墙状态
# systemctl stop firewalld.service    --关闭防火墙
# systemctl disable firewalld.service --永久关闭防火墙
 
    关闭防火墙:
systemctl status firewalld  
systemctl disable firewalld  
    systemctl stop firewalld
 
    关闭SELinux:
sestatus
vi /etc/sysconfig/selinu
#下面为selinux文件中需要修改的元素  
    SELINUX=disabled  
   
chkconfig  iptables  off
    /etc/init.d/iptables  stop


 
 http://www.xdowns.com/soft/softdown.asp?softid=121508
0 0
原创粉丝点击