Linux 搭建Hadoop集群错误锦集
一、Hadoop集群配置好后,执行start-dfs.sh后报错,一堆permission denied
zf sbin $ ./start-dfs.sh
Starting namenodes on [master]
master: chown: changing ownership of '/home/zf/hadoop/hadoop-2.9.1/logs': Operation not permitted
master: starting namenode, logging to /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-namenode-master.out
master: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 159: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-namenode-master.out: Permission denied
master: head: cannot open '/home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-namenode-master.out' for reading: No such file or directory
master: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 177: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-namenode-master.out: Permission denied
master: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 178: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-namenode-master.out: Permission denied
slave-1: chown: changing ownership of '/home/zf/hadoop/hadoop-2.9.1/logs': Operation not permitted
slave-1: starting datanode, logging to /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-datanode-slave-1.out
slave-1: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 159: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-datanode-slave-1.out: Permission denied
slave-2: chown: changing ownership of '/home/zf/hadoop/hadoop-2.9.1/logs': Operation not permitted
slave-2: starting datanode, logging to /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-datanode-slave-2.out
slave-2: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 159: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-datanode-slave-2.out: Permission denied
slave-1: head: cannot open '/home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-datanode-slave-1.out' for reading: No such file or directory
slave-1: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 177: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-datanode-slave-1.out: Permission denied
slave-1: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 178: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-datanode-slave-1.out: Permission denied
slave-2: head: cannot open '/home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-datanode-slave-2.out' for reading: No such file or directory
slave-2: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 177: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-datanode-slave-2.out: Permission denied
slave-2: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 178: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-datanode-slave-2.out: Permission denied
Starting secondary namenodes [slave-1]
slave-1: chown: changing ownership of '/home/zf/hadoop/hadoop-2.9.1/logs': Operation not permitted
slave-1: starting secondarynamenode, logging to /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-secondarynamenode-slave-1.out
slave-1: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 159: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-secondarynamenode-slave-1.out: Permission denied
slave-1: head: cannot open '/home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-secondarynamenode-slave-1.out' for reading: No such file or directory
slave-1: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 177: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-secondarynamenode-slave-1.out: Permission denied
slave-1: /home/zf/hadoop/hadoop-2.9.1/sbin/hadoop-daemon.sh: line 178: /home/zf/hadoop/hadoop-2.9.1/logs/hadoop-zf-secondarynamenode-slave-1.out: Permission denied
解决方案:对hadoop安装目录执行命令:sudo chmod a+w *
对文件敞开权限
二、执行./start-dfs.sh 和 ./start-yarn.sh 后master主机上jps 无法启动NameNode和ResourceManager,但slave-1 和slave-2 DataNode启动正常。
查看logs,错误如下:
**************namenode.log**************************** -- ::, ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: Failed to start namenode.
java.net.BindException: Port in use: master:
at org.apache.hadoop.http.HttpServer2.constructBindException(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.bindForSinglePort(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNodeHttpServer.start(NameNodeHttpServer.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.startHttpServer(NameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:)
Caused by: java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:)
at sun.nio.ch.Net.bind(Net.java:)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:)
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:)
at org.apache.hadoop.http.HttpServer2.bindListener(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.bindForSinglePort(HttpServer2.java:)
... more
-- ::, INFO org.apache.hadoop.util.ExitUtil: Exiting with status : java.net.BindException: Port in use: master:
-- ::, INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at master/182.61.39.233
************************************************************/
*************secondnamemode.log****************************
-- ::, INFO org.apache.hadoop.http.HttpServer2: HttpServer.start() threw a non Bind IOException
java.net.BindException: Port in use: master:
at org.apache.hadoop.http.HttpServer2.constructBindException(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.bindForSinglePort(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:)
at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.startInfoServer(SecondaryNameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.main(SecondaryNameNode.java:)
Caused by: java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:)
at sun.nio.ch.Net.bind(Net.java:)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:)
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:)
at org.apache.hadoop.http.HttpServer2.bindListener(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.bindForSinglePort(HttpServer2.java:)
... more
-- ::, FATAL org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Failed to start secondary namenode
java.net.BindException: Port in use: master:
at org.apache.hadoop.http.HttpServer2.constructBindException(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.bindForSinglePort(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:)
at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.startInfoServer(SecondaryNameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.main(SecondaryNameNode.java:)
Caused by: java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:)
at sun.nio.ch.Net.bind(Net.java:)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:)
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:)
at org.apache.hadoop.http.HttpServer2.bindListener(HttpServer2.java:)
at org.apache.hadoop.http.HttpServer2.bindForSinglePort(HttpServer2.java:)
... more
可见主要原因就是:
1、 java.net.BindException: Port in use: master:50070/9001
2、Caused by: java.net.BindException: Cannot assign requested address
端口被占用是直接原因,但起因是不能分配所需的地址,跟地址有关的就联想到 /etc/hosts文件
原来我的是:
127.0.0.1 localhost localhost.localdomain
182.xx.xx.33 master (外网IP, 主机名)
106.xx.xx.72 slave-
106.xx.xx.73 slave-
后来把外网IP全部换成内网IP后就可以了
127.0.0.1 localhost localhost.localdomain
172.xx.x.2 master
172.xx.x.5 slave-
172.xx.x.6 slave-
原因我也不明,我三台主机都是使用百度云服务器。
三、Hadoop 配置好后,发现DataNode没有启动,很大原因是因为NameNode 格式化时与上次的残留有冲突,所以要先删除上次的残留。或者每次使用完后及时Hadoop关闭,重新开启后不要重新格式化NameNode。
Linux 搭建Hadoop集群错误锦集的更多相关文章
- Linux 搭建Hadoop集群 成功
内容基于(自己的真是操作步骤编写) Linux 搭建Hadoop集群---Jdk配置 Linux 搭建Hadoop集群 ---SSH免密登陆 一:下载安装 Hadoop 1.1:下载指定的Hadoop ...
- Hadoop(五)搭建Hadoop与Java访问HDFS集群
前言 上一篇详细介绍了HDFS集群,还有操作HDFS集群的一些命令,常用的命令: hdfs dfs -ls xxx hdfs dfs -mkdir -p /xxx/xxx hdfs dfs -cat ...
- redis在Windows下以后台服务一键搭建集群(单机--伪集群)
redis在Windows下以后台服务一键搭建集群(单机--伪集群) 一.概述 此教程介绍如何在windows系统中同一台机器上布置redis伪集群,同时要以后台服务的模式运行.布置以脚本的形式,一键 ...
- hadoop 集群及hbase集群的pid文件存放位置
一.当hbase集群和hadoop集群停了做一些配置调整,结果执行stop-all.sh的时候无法停止集群, 提示no datanode,no namenode等等之类的信息, 查看stop-all. ...
- Redis集群(五):集群搭建
一.本文目的 演示在一台机器上搭建3主3从的redis集群,通过演示了解redis集群的搭建,使用和注意事项 二.搭建说明 1.同一台机器搭建3主3从的伪集群 ...
- 搭建mongodb集群(副本集+分片)
搭建mongodb集群(副本集+分片) 转载自:http://blog.csdn.net/bluejoe2000/article/details/41323051 完整的搭建mongodb集群(副本集 ...
- 基于Hadoop集群的HBase集群的配置
一 Hadoop集群部署 hadoop配置 二 Zookeeper集群部署 zookeeper配置 三 Hbase集群部署 1.配置hbase-env.sh HBASE_MANAGES_ZK:用来 ...
- elasticsearch系列八:ES 集群管理(集群规划、集群搭建、集群管理)
一.集群规划 搭建一个集群我们需要考虑如下几个问题: 1. 我们需要多大规模的集群? 2. 集群中的节点角色如何分配? 3. 如何避免脑裂问题? 4. 索引应该设置多少个分片? 5. 分片应该设置几个 ...
- Centos7上搭建activemq集群和zookeeper集群
Zookeeper集群的搭建 1.环境准备 Zookeeper版本:3.4.10. 三台服务器: IP 端口 通信端口 10.233.17.6 2181 2888,3888 10.233.17.7 2 ...
随机推荐
- 快速学会在JSP中使用EL表达式
在没有学会EL表达式之前,我们想在JSP文件中获取servlet或者其他JSP页面传来的值,通常都是在JSP页面中编写java代码来实现.而在jsp页面编写Java 代码,这种做法时不规范的,将会产生 ...
- 关于单例的DCL方式分析
public class Singleton { /** * 单例对象实例 */ private volatile static Singleton instance = null; public s ...
- Tomcat监听443端口的方法
当我们需要更安全的访问网站的时候就会选择使用https协议,而https协议默认的端口号为443端口,这就是我们为什么向让Tomcat监听在443端口的原因,因为监控在非80端口和443端口的web服 ...
- Linq to Object 的简单使用示例
语言集成查询 (LINQ) 是 Visual Studio 2008 中引入的一组功能,可为 C# 和 Visual Basic 语言语法提供强大的查询功能. LINQ 引入了标准易学的数据查询和更新 ...
- PLSQL(PL/SQL)集成Team Foundation Server (TFS),实现数据库代码的版本管理
PL/SQL是面向Oralcle数据库的集成开发环境,是众多Oracle数据库开发人员的主要工具.由于PL/SQL(百度百科)不仅是一种SQL语言,更是一种过程编程语言,在项目实施过程中,会积累大量除 ...
- vs 2015 结合新配置的IIS 发布网站过程中遇到的问题及解决办法?
1.由于扩展配置问题而无法提供您请求的页面.如果该页面是脚本,请添加处理程序 错误: HTTP 错误 404.3 - Not Found 由于扩展配置问题而无法提供您请求的页面.如果该页面是脚本,请添 ...
- ABP框架中微服务跨域调用其它服务接口
AjaxResponse为ABP自动包装的JSON格式 /// <summary> /// 通过地址和参数取得返回OutPut数据 /// </summary> /// < ...
- 理解go语言 协程之间的通讯
go已经越来越被重视了,特别适合大型互联网公司基础服务的编写,高效,高并发,可以同时允许多个明星出轨,多个明星结婚 都不在话下,下面介绍下GO协程通讯的过程 直接上代码 package main im ...
- 解决win10不显示coreldraw x4/5/6菜单栏
1.下载插件 https://pan.baidu.com/s/1nQ1kgUNSD7-9sjUbv5M6XA 复制链接下载插件 2.导入插件到工作区 3.设置工具栏显示 4.把工具栏拖动到菜单栏位置, ...
- [Xamarin]我的Xamarin填坑之旅(二)
上一篇交代了我Xamarin填坑的背景,大概聊了聊第一步环境配置,第二步创建项目和开发框架选择.如果有一个可用的梯子,这部分基本不会出错. 接下来就具体聊一聊写代码的过程中遇到的一些事儿. 第三步是码 ...