hadoop2.5.1搭建(二)
第一篇主要是整体的步骤,其实中间遇到很多问题,第二篇将遇到的问题全部列举下来:
1.1包不能加载警告
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
hadoop2.5.1官网上提供的已经是64位操作系统版本,但是仍然报这个错误
1.1.1测试本地库
[root@cluster3 ~]# export HADOOP_ROOT_LOGGER=DEBUG,console
[root@cluster3 script]# hadoop fs -text /usr/local/script/hdfile1.txt
// :: DEBUG util.NativeCodeLoader: Failed to load native-hadoop with error:
java.lang.UnsatisfiedLinkError: /usr/local/hadoop/hadoop-2.5./lib/native/libhadoop.so.1.0.: /lib64/libc.so.:
version `GLIBC_2.' not found (required by /usr/local/hadoop/hadoop-2.5.1/lib/native/libhadoop.so.1.0.0)
// :: DEBUG util.NativeCodeLoader: java.library.path=/usr/local/hadoop/hadoop-2.5./lib/native
// :: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
// :: DEBUG security.JniBasedUnixGroupsMappingWithFallback: Falling back to shell based [root@cluster1 lib64]# ll /lib64/libc.so.
lrwxrwxrwx root root Oct : /lib64/libc.so. -> libc-2.5.so
可以看到上边要求的是glibc_2.12,所以需要升级glibc(对hadoop重新编译即可,不需要升级glibc)
编译hadoop源码
2、配置本地yum源
修改yum的配置文件,使用本地ISO做yum源
创建目录
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom 复制到本地
cp -avf /mnt/cdrom /yum 创建文件:
vi /etc/yum.repos.d/CentOS-Local.repo [Local]
name=Local Yum
baseurl=file:///yum/
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=
# cd /etc/yum.repos.d/ # mv CentOS-Base.repo CentOS-Base.repo.bak 禁用默认的yum 网络源 # cp CentOS-Media.repo CentOS-Media.repo.bak 是yum 本地源的配置文件 修改配置文件
# vi CentOS-Media.repo
baseurl=file:///media/CentOS_6.3_Final/
enabled= #启用yum [root@cluster3 yum.repos.d]# yum -y install gcc
3、clone虚拟机后,修改主机名
修改主机名
修改/etc/sysconfig/network中的hostname为【修改后的主机名】
修改/etc/hosts文件中的 【原来主机名】为【修改后的主机名】
reboot,重启系统。
查看hostname ,是否修改成功
4测试程序
[root@cluster3 input]# hadoop dfs -mkdir /hadoop
[root@cluster3 input]# hadoop dfs -mkdir /hadoop/input [root@cluster3 hadoop-2.5.]# hadoop dfs -put /usr/local/hadoop/hadoop-2.5./test/text1.txt /hadoop/input
[root@cluster3 hadoop-2.5.]# hadoop dfs -put /usr/local/hadoop/hadoop-2.5./test/text2.txt /hadoop/input
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it. [root@cluster3 hadoop-2.5.]# hadoop jar /usr/local/hadoop/hadoop-2.5./share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5..jar wordcount /hadoop/input/* /hadoop/output
14/11/06 15:44:51 INFO client.RMProxy: Connecting to ResourceManager at cluster3/192.168.220.63:8032
14/11/06 15:44:52 INFO input.FileInputFormat: Total input paths to process : 2
14/11/06 15:44:52 INFO mapreduce.JobSubmitter: number of splits:2
14/11/06 15:44:52 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1415259711375_0001
14/11/06 15:44:53 INFO impl.YarnClientImpl: Submitted application application_1415259711375_0001
14/11/06 15:44:53 INFO mapreduce.Job: The url to track the job: http://cluster3:8088/proxy/application_1415259711375_0001/
14/11/06 15:44:53 INFO mapreduce.Job: Running job: job_1415259711375_0001
14/11/06 15:45:04 INFO mapreduce.Job: Job job_1415259711375_0001 running in uber mode : false
14/11/06 15:45:04 INFO mapreduce.Job: map 0% reduce 0%
14/11/06 15:45:57 INFO mapreduce.Job: map 100% reduce 0%
14/11/06 15:46:17 INFO mapreduce.Job: map 100% reduce 100%
14/11/06 15:46:18 INFO mapreduce.Job: Job job_1415259711375_0001 completed successfully
14/11/06 15:46:18 INFO mapreduce.Job: Counters: 49
File System Counters
FILE: Number of bytes read=55
FILE: Number of bytes written=291499
FILE: Number of read operations=0
FILE: Number of large read operations=0
FILE: Number of write operations=0
HDFS: Number of bytes read=241
HDFS: Number of bytes written=25
HDFS: Number of read operations=9
HDFS: Number of large read operations=0
HDFS: Number of write operations=2
Job Counters
Launched map tasks=2
Launched reduce tasks=1
Data-local map tasks=2
Total time spent by all maps in occupied slots (ms)=106968
Total time spent by all reduces in occupied slots (ms)=9679
Total time spent by all map tasks (ms)=106968
Total time spent by all reduce tasks (ms)=9679
Total vcore-seconds taken by all map tasks=106968
Total vcore-seconds taken by all reduce tasks=9679
Total megabyte-seconds taken by all map tasks=109535232
Total megabyte-seconds taken by all reduce tasks=9911296
Map-Reduce Framework
Map input records=2
Map output records=4
Map output bytes=41
Map output materialized bytes=61
Input split bytes=216
Combine input records=4
Combine output records=4
Reduce input groups=3
Reduce shuffle bytes=61
Reduce input records=4
Reduce output records=3
Spilled Records=8
Shuffled Maps =2
Failed Shuffles=0
Merged Map outputs=2
GC time elapsed (ms)=1085
CPU time spent (ms)=3400
Physical memory (bytes) snapshot=502984704
Virtual memory (bytes) snapshot=2204106752
Total committed heap usage (bytes)=257171456
Shuffle Errors
BAD_ID=0
CONNECTION=0
IO_ERROR=0
WRONG_LENGTH=0
WRONG_MAP=0
WRONG_REDUCE=0
File Input Format Counters
Bytes Read=25
File Output Format Counters
Bytes Written=25 [root@cluster3 hadoop-2.5.1]# hadoop dfs -ls /hadoop/
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it. Found 2 items
drwxr-xr-x - root supergroup 0 2014-11-06 15:44 /hadoop/input
drwxr-xr-x - root supergroup 0 2014-11-06 15:46 /hadoop/output [root@cluster3 hadoop-2.5.1]# hadoop dfs -cat /hadoop/output/part-r-00000
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it. hadoop 1
hello 2
world 1
5.连接失败
[root@cluster3 hadoop-2.5.]# hadoop jar /usr/local/hadoop/hadoop-2.5./share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5..jar wordcount /hadoop/input/* /hadoop/output
14/11/06 11:28:15 INFO client.RMProxy: Connecting to ResourceManager at cluster3/192.168.220.63:8032
java.net.ConnectException: Call From cluster3/192.168.220.63 to cluster3:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
解决办法:
namenode未启动
6.没有datanode
// :: WARN hdfs.DFSClient: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hadoop/input/text1.txt._COPYING_ could only be replicated to nodes instead of minReplication (=). There are datanode(s) running and no node(s) are excluded in this operation.
at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:)
解决办法:
由于执行了多次hdfs namenode -format 需要手动清除下name和data数据
7.数据丢失危险
-- ::, WARN org.apache.hadoop.hdfs.server.namenode.FSNamesystem: Only one image storage directory (dfs.namenode.name.dir) configured. Beware of data loss due to lack of redundant storage directories!
-- ::, WARN org.apache.hadoop.hdfs.server.namenode.FSNamesystem: Only one namespace edits storage directory (dfs.namenode.edits.dir) configured. Beware of data loss due to lack of redundant storage directories!
通过在dfs.namenode.name.dir和dfs.datanode.data.dir设置多个挂载在不同物理硬盘或者NFS挂载的目录即可
8.http://192.168.220.63:50070访问不了,NodeManager启动一下,过一会就没了。
关闭防火墙服务
[root@cluster3 hadoop]# service iptables stop
关闭开机自动启动
[root@cluster3 hadoop]# chkconfig iptables off
hadoop2.5.1搭建(二)的更多相关文章
- 原生态hadoop2.6平台搭建
hadoop2.6平台搭建 一.条件准备 软件条件: Ubuntu14.04 64位操作系统,jdk1.7 64位,Hadoop 2.6.0 硬件条件: 1台主节点机器,配置:cpu 8个,内存32 ...
- 用IntelliJ IDEA 开发Spring+SpringMVC+Mybatis框架 分步搭建二:配置MyBatis 并测试(2 配置spring-dao和测试)
用IntelliJ IDEA 开发Spring+SpringMVC+Mybatis框架 分步搭建二:配置MyBatis 并测试(1 搭建目录环境和依赖) 四:在\resources\spring 下面 ...
- 用IntelliJ IDEA 开发Spring+SpringMVC+Mybatis框架 分步搭建二:配置MyBatis 并测试(1 构建目录环境和依赖)
引言:在用IntelliJ IDEA 开发Spring+SpringMVC+Mybatis框架 分步搭建一 的基础上 继续进行项目搭建 该部分的主要目的是测通MyBatis 及Spring-dao ...
- odoo开发环境搭建(二):安装Ubuntu 17虚拟机
odoo开发环境搭建(二):安装Ubuntu 17虚拟机 下载镜像文件: 配置网络: 安装vmware tools: 配置共享文件夹: 选中虚拟机,右键编辑设置里边配置共享文件夹,指定windows本 ...
- 嵌入式框架Zorb Framework搭建二:环形缓冲区的实现
我是卓波,我是一名嵌入式工程师,我万万没想到我会在这里跟大家吹牛皮. 嵌入式框架Zorb Framework搭建过程 嵌入式框架Zorb Framework搭建一:嵌入式环境搭建.调试输出和建立时间系 ...
- IPFS系列 多节点搭建 二
IPFS系列 多节点搭建 二 上一篇介绍了IPFS的分布式点对点超媒体传输协议的背景和安装介绍,本篇将继续指导搭建多节点的IPFS私有网络 文件服务.如果没还没开始搭建IPFS节点的小伙伴, 请戳此链 ...
- BBS项目分布搭建二(个人站点相关)
BBS项目分布搭建二 1. 首页详情补充 # 在home.html文件中 body标签内补充: <div class="container-fluid"> <di ...
- Hadoop学习笔记—22.Hadoop2.x环境搭建与配置
自从2015年花了2个多月时间把Hadoop1.x的学习教程学习了一遍,对Hadoop这个神奇的小象有了一个初步的了解,还对每次学习的内容进行了总结,也形成了我的一个博文系列<Hadoop学习笔 ...
- Kafka:ZK+Kafka+Spark Streaming集群环境搭建(十)安装hadoop2.9.0搭建HA
如何搭建配置centos虚拟机请参考<Kafka:ZK+Kafka+Spark Streaming集群环境搭建(一)VMW安装四台CentOS,并实现本机与它们能交互,虚拟机内部实现可以上网.& ...
随机推荐
- 简单实例讲解linux的module模块编译步骤
注:原博文地址http://blog.sina.com.cn/s/blog_4ba5b45e0102v25h.html ---------------------------------------- ...
- Linux xargs命令
xargs是给命令传递参数的一个过滤器,也是组合多个命令的一个工具.它把一个数据流分割为一些足够小的块,以方便过滤器和命令进行处理.通常情况下,xargs从管道或者stdin中读取数据,但是它也能够从 ...
- 黄聪:WordPress 的 Hook 机制与原理(add_action、add_filter)
稍有接触过 WordPress 主题或插件制作修改的朋友,对 WordPress 的Hook机制应该不陌生,但通常刚接触WordPress Hook 的新手,对其运作原理可能会有点混乱或模糊.本文针对 ...
- IGS_学习笔记06_IREP发布客户化集成接口为Web Service(案例)
2015-01-03 Created By BaoXinjian
- POJ 3311 Hie with the Pie(Floyd+状态压缩DP)
题是看了这位的博客之后理解的,只不过我是又加了点简单的注释. 链接:http://blog.csdn.net/chinaczy/article/details/5890768 我还加了一些注释代码,对 ...
- Imread函数不好使的替用方法
Mat img = imread("pp.jpg"); || IplImage*iplImg = cvLoadImage("pp.jpg");//由于imrea ...
- Apache2 CGI demo
1. 修改 httpd.conf 配置 <IfModule alias_module> ScriptAlias /cgi-bin/ "/usr/local/apache2/cg ...
- 外中断之swi软件中断:
在stm32的标准库的外中断库文件中有void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line);原来一直不知道有什么用,现总结一下: 作用:软件模拟产生中断能 ...
- Java线程专栏文章汇总(转)
原文:http://blog.csdn.net/ghsau/article/details/17609747 JDK5.0之前传统线程 Java线程(一):线程安全与不安全 Java线程 ...
- 配置webstorm使用supervisor时出现 /usr/bin/env: node: 没有那个文件或目录 解决方法
配置好supervisor路径后 出现了 启动时出现了 /usr/bin/env: node: 没有那个文件或目录 需要讲.nvm下的node链接到, /usr/bin/目录下 sudo ln -s ...