- 浏览: 125328 次
- 性别:
- 来自: 杭州
文章分类
最新评论
转 http://blog.csdn.net/hguisu/article/details/7237395
感谢这位兄弟 ,郁闷了一天终于搞定,不过有些概念 参数的配置要细看
下一部 写一个应用看看
Hadoop集群配置(最全面总结)
分类: 云计算hadoop 2012-02-06 17:15 6711人阅读 评论(9) 收藏 举报
目录(?)[+]
Hadoop集群配置(最全面总结) huangguisu
通常,集群里的一台机器被指定为 NameNode,另一台不同的机器被指定为JobTracker。这些机器是masters。余下的机器即作为DataNode也作为TaskTracker。这些机器是slaves\
官方地址:(http://hadoop.apache.org/common/docs/r0.19.2/cn/cluster_setup.html)
1 先决条件
确保在你集群中的每个节点上都安装了所有必需软件:sun-JDK ,ssh,Hadoop
JavaTM1.5.x,必须安装,建议选择Sun公司发行的Java版本。
ssh 必须安装并且保证 sshd一直运行,以便用Hadoop 脚本管理远端Hadoop守护进程。
2 实验环境搭建
2.1 准备工作
操作系统:Ubuntu
部署:Vmvare
在vmvare安装好一台Ubuntu虚拟机后,可以导出或者克隆出另外两台虚拟机。
说明:
保证虚拟机的ip和主机的ip在同一个ip段,这样几个虚拟机和主机之间可以相互通信。
为了保证虚拟机的ip和主机的ip在同一个ip段,虚拟机连接设置为桥连。
准备机器:一台master,若干台slave,配置每台机器的/etc/hosts保证各台机器之间通过机器名可以互访,例如:
10.64.56.76 node1(master)
10.64.56.77 node2 (slave1)
10.64.56.78 node3 (slave2)
主机信息:
机器名 IP地址 作用
Node1 10.64.56.76 NameNode、JobTracker
Node2 10.64.56.77 DataNode、TaskTracker
Node3 10.64.56.78 DataNode、TaskTracker 为保证环境一致先安装好JDK和ssh:
2.2 安装JDK
#安装JDK
$ sudo apt-get install sun-java6-jdk1.2.3
这个安装,java执行文件自动添加到/usr/bin/目录。
验证 shell命令 :java -version 看是否与你的版本号一致。
2.3下载、创建用户
$ useradd hadoop
$ cd /home/hadoop
在所有的机器上都建立相同的目录,也可以就建立相同的用户,最好是以该用户的home路径来做hadoop的安装路径。
例如在所有的机器上的安装路径都是:/home/hadoop/hadoop-0.20.203,这个不需要mkdir,在/home/hadoop/下解压hadoop包的时候,会自动生成)
(当然可以安装/usr/local/目录下,例如/usr/local/hadoop-0.20.203/
chown -R hadoop /usr/local/hadoop-0.20.203/
chgrp -R hadoop /usr/local/hadoop-0.20.203/
)
(最好不要使用root安装,因为不推荐各个机器之间使用root访问 )
2.4 安装ssh和配置
1) 安装:sudo apt-get install ssh
这个安装完后,可以直接使用ssh命令 了。
执行$ netstat -nat 查看22端口是否开启了。
测试:ssh localhost。
输入当前用户的密码,回车就ok了。说明安装成功,同时ssh登录需要密码。
(这种默认安装方式完后,默认配置文件是在/etc/ssh/目录下。sshd配置文件是:/etc/ssh/sshd_config):
注意:在所有机子都需要安装ssh。
2) 配置:
在Hadoop启动以后,Namenode是通过SSH(Secure Shell)来启动和停止各个datanode上的各种守护进程的,这就须要在节点之间执行指令的时候是不须要输入密码的形式,故我们须要配置SSH运用无密码公钥认证的形式。
以本文中的三台机器为例,现在node1是主节点,他须要连接node2和node3。须要确定每台机器上都安装了ssh,并且datanode机器上sshd服务已经启动。
( 说明:hadoop@hadoop~]$ssh-keygen -t rsa
这个命令将为hadoop上的用户hadoop生成其密钥对,询问其保存路径时直接回车采用默认路径,当提示要为生成的密钥输入passphrase的时候,直接回车,也就是将其设定为空密码。生成的密钥对id_rsa,id_rsa.pub,默认存储在/home/hadoop/.ssh目录下然后将id_rsa.pub的内容复制到每个机器(也包括本机)的/home/dbrg/.ssh/authorized_keys文件中,如果机器上已经有authorized_keys这个文件了,就在文件末尾加上id_rsa.pub中的内容,如果没有authorized_keys这个文件,直接复制过去就行.)
3) 首先设置namenode的ssh为无需密码的、自动登录。
切换到hadoop用户( 保证用户hadoop可以无需密码登录,因为我们后面安装的hadoop属主是hadoop用户。)
$ su hadoop
cd /home/hadoop
$ ssh-keygen -t rsa
然后一直按回车
完成后,在home跟目录下会产生隐藏文件夹.ssh
$ cd .ssh
之后ls 查看文件
cp id_rsa.pub authorized_keys
测试:
$ssh localhost
或者:
$ ssh node1
第一次ssh会有提示信息:
The authenticity of host ‘node1 (10.64.56.76)’ can’t be established.
RSA key fingerprint is 03:e0:30:cb:6e:13:a8:70:c9:7e:cf:ff:33:2a:67:30.
Are you sure you want to continue connecting (yes/no)?
输入 yes 来继续。这会把该服务器添加到你的已知主机的列表中
发现链接成功,并且无需密码。
4 ) 复制authorized_keys到node2 和node3 上
为了保证node1可以无需密码自动登录到node2和node3,先在node2和node3上执行
$ su hadoop
cd /home/hadoop
$ ssh-keygen -t rsa
一路按回车.
然后回到node1,复制authorized_keys到node2 和node3
[hadoop@hadoop .ssh]$ scp authorized_keys node2:/home/hadoop/.ssh/
[hadoop@hadoop .ssh]$ scp authorized_keys node3:/home/hadoop/.ssh/
这里会提示输入密码,输入hadoop账号密码就可以了。
改动你的 authorized_keys 文件的许可权限
[hadoop@hadoop .ssh]$chmod 644 authorized_keys
测试:ssh node2或者ssh node3(第一次需要输入yes)。
如果不须要输入密码则配置成功,如果还须要请检查上面的配置能不能正确。
2.5 安装Hadoop
#切换为hadoop用户
su hadoop
wgethttp://apache.mirrors.tds.net//hadoop/common/hadoop-0.20.203.0/hadoop-0.20.203.0rc1.tar.gz
下载安装包后,直接解压安装即可:
$ tar -zxvfhadoop-0.20.203.0rc1.tar.gz
1 ) 安装Hadoop集群通常要将安装软件解压到集群内的所有机器上。并且安装路径要一致,如果我们用HADOOP_HOME指代安装的根路径,通常,集群里的所有机器的
HADOOP_HOME路径相同。
2 ) 如果集群内机器的环境完全一样,可以在一台机器上配置好,然后把配置好的软件即hadoop-0.20.203整个文件夹拷贝到其他机器的相同位置即可。
3 ) 可以将Master上的Hadoop通过scp拷贝到每一个Slave相同的目录下,同时根据每一个Slave的Java_HOME 的不同修改其hadoop-env.sh 。
4) 为了方便,使用hadoop命令或者start-all.sh等命令,修改Master上/etc/profile 新增以下内容:
export HADOOP_HOME=/home/hadoop/hadoop-0.20.203
exportPATH=$PATH:$HADOOP_HOME/bin
修改完毕后,执行source /etc/profile 来使其生效。
6)配置conf/hadoop-env.sh文件
配置conf/hadoop-env.sh文件
#添加
export JAVA_HOME=/usr/lib/jvm/java-6-sun/
这里修改为你的jdk的安装位置。
测试hadoop安装:
Bin/hadoop jar hadoop-0.20.2-examples.jarwordcount conf/ /tmp/out
3. 集群配置(所有节点相同)
3.1配置文件:conf/core-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://node1:49000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/hadoop_home/var</value>
</property>
</configuration>
1)fs.default.name是NameNode的URI。hdfs://主机名:端口/
2)hadoop.tmp.dir :Hadoop的默认临时路径,这个最好配置,如果在新增节点或者其他情况下莫名其妙的DataNode启动不了,就删除此文件中的tmp目录即可。不过如果删除了NameNode机器的此目录,那么就需要重新执行NameNode格式化的命令。
3.2配置文件:conf/mapred-site.xml
<?xmlversion="1.0"?>
<?xml-stylesheettype="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>node1:49001</value>
</property>
<property>
<name>mapred.local.dir</name>
<value>/home/hadoop/hadoop_home/var</value>
</property>
</configuration>
1)mapred.job.tracker是JobTracker的主机(或者IP)和端口。主机:端口。
3.3配置文件:conf/hdfs-site.xml
<?xmlversion="1.0"?>
<?xml-stylesheettype="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.name.dir</name>
<value>/home/hadoop/name1, /home/hadoop/name2</value> #hadoop的name目录路径
<description> </description>
</property>
<property>
<name>dfs.data.dir</name>
<value>/home/hadoop/data1, /home/hadoop/data2</value>
<description> </description>
</property>
<property>
<name>dfs.replication</name>
<!-- 我们的集群又两个结点,所以rep两份 -->
<value>2</vaue>
</property>
</configuration>
1) dfs.name.dir是NameNode持久存储名字空间及事务日志的本地文件系统路径。 当这个值是一个逗号分割的目录列表时,nametable数据将会被复制到所有目录中做冗余备份。
2) dfs.data.dir是DataNode存放块数据的本地文件系统路径,逗号分割的列表。 当这个值是逗号分割的目录列表时,数据将被存储在所有目录下,通常分布在不同设备上。
3)dfs.replication是数据需要备份的数量,默认是3,如果此数大于集群的机器数会出错。
注意:此处的name1、name2、data1、data2目录不能预先创建,hadoop格式化时会自动创建,如果预先创建反而会有问题。
3.4配置masters和slaves主从结点
配置conf/masters和conf/slaves来设置主从结点,注意最好使用主机名,并且保证机器之间通过主机名可以互相访问,每个主机名一行。
vi masters:
输入:
node1
vi slaves:
输入:
node2
node3
配置结束,把配置好的hadoop文件夹拷贝到其他集群的机器中,并且保证上面的配置对于其他机器而言正确,例如:如果其他机器的Java安装路径不一样,要修改conf/hadoop-env.sh
$ scp -r /home/hadoop/hadoop-0.20.203 root@node2: /home/hadoop/
4 hadoop启动
4.1 格式化一个新的分布式文件系统
先格式化一个新的分布式文件系统
$ cd hadoop-0.20.203
$ bin/hadoop namenode -format
成功情况下系统输出:
12/02/06 00:46:50 INFO namenode.NameNode:STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = ubuntu/127.0.1.1
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 0.20.203.0
STARTUP_MSG: build =http://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-203-r 1099333; compiled by 'oom' on Wed May 4 07:57:50 PDT 2011
************************************************************/
12/02/0600:46:50 INFO namenode.FSNamesystem: fsOwner=root,root
12/02/06 00:46:50 INFO namenode.FSNamesystem:supergroup=supergroup
12/02/06 00:46:50 INFO namenode.FSNamesystem:isPermissionEnabled=true
12/02/06 00:46:50 INFO common.Storage: Imagefile of size 94 saved in 0 seconds.
12/02/06 00:46:50 INFO common.Storage: Storagedirectory /opt/hadoop/hadoopfs/name1 has been successfully formatted.
12/02/06 00:46:50 INFO common.Storage: Imagefile of size 94 saved in 0 seconds.
12/02/06 00:46:50 INFO common.Storage: Storagedirectory /opt/hadoop/hadoopfs/name2 has been successfully formatted.
12/02/06 00:46:50 INFO namenode.NameNode:SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode atv-jiwan-ubuntu-0/127.0.0.1
************************************************************/
查看输出保证分布式文件系统格式化成功
执行完后可以到master机器上看到/home/hadoop//name1和/home/hadoop//name2两个目录。在主节点master上面启动hadoop,主节点会启动所有从节点的hadoop。
4.2 启动所有节点
启动方式1:
$ bin/start-all.sh (同时启动HDFS和Map/Reduce)
系统输出:
starting namenode, logging to /usr/local/hadoop/logs/hadoop-hadoop-namenode-ubuntu.out
node2: starting datanode, loggingto /usr/local/hadoop/logs/hadoop-hadoop-datanode-ubuntu.out
node3: starting datanode, loggingto /usr/local/hadoop/logs/hadoop-hadoop-datanode-ubuntu.out
node1: starting secondarynamenode,logging to /usr/local/hadoop/logs/hadoop-hadoop-secondarynamenode-ubuntu.out
starting jobtracker, logging to/usr/local/hadoop/logs/hadoop-hadoop-jobtracker-ubuntu.out
node2: starting tasktracker,logging to /usr/local/hadoop/logs/hadoop-hadoop-tasktracker-ubuntu.out
node3: starting tasktracker,logging to /usr/local/hadoop/logs/hadoop-hadoop-tasktracker-ubuntu.out
As you can see in slave's output above, it will automatically format it's storage directory(specified by dfs.data.dir) if it is not formattedalready. It will also create the directory if it does not exist yet.
执行完后可以到master(node1)和slave(node1,node2)机器上看到/home/hadoop/hadoopfs/data1和/home/hadoop/data2两个目录。
启动方式2:
启动Hadoop集群需要启动HDFS集群和Map/Reduce集群。
在分配的NameNode上,运行下面的命令启动HDFS:
$ bin/start-dfs.sh(单独启动HDFS集群)
bin/start-dfs.sh脚本会参照NameNode上${HADOOP_CONF_DIR}/slaves文件的内容,在所有列出的slave上启动DataNode守护进程。
在分配的JobTracker上,运行下面的命令启动Map/Reduce:
$bin/start-mapred.sh (单独启动Map/Reduce)
bin/start-mapred.sh脚本会参照JobTracker上${HADOOP_CONF_DIR}/slaves文件的内容,在所有列出的slave上启动TaskTracker守护进程。
4.3 关闭所有节点
从主节点master关闭hadoop,主节点会关闭所有从节点的hadoop。
$ bin/stop-all.sh
Hadoop守护进程的日志写入到 ${HADOOP_LOG_DIR} 目录 (默认是 ${HADOOP_HOME}/logs).
${HADOOP_HOME}就是安装路径.
5 .测试
1)浏览NameNode和JobTracker的网络接口,它们的地址默认为:
NameNode - http://node1:50070/
JobTracker - http://node2:50030/
3) 使用netstat –nat查看端口49000和49001是否正在使用。
4) 使用jps查看进程
要想检查守护进程是否正在运行,可以使用 jps 命令(这是用于 JVM 进程的ps 实用程序)。这个命令列出 5 个守护进程及其进程标识符。
5)将输入文件拷贝到分布式文件系统:
$ bin/hadoop fs -mkdir input
$ bin/hadoop fs -put conf/core-site.xml input
运行发行版提供的示例程序:
$ bin/hadoop jar hadoop-0.20.2-examples.jar grep input output 'dfs[a-z.]+'
6.补充
Q: bin/hadoop jar hadoop-0.20.2-examples.jar grep input output 'dfs[a-z.]+' 什么意思啊?
A: bin/hadoop jar(使用hadoop运行jar包) hadoop-0.20.2_examples.jar(jar包的名字) grep (要使用的类,后边的是参数)input output 'dfs[a-z.]+'
整个就是运行hadoop示例程序中的grep,对应的hdfs上的输入目录为input、输出目录为output。
Q: 什么是grep?
A: A map/reduce program that counts the matches of a regex in the input.
查看输出文件:
将输出文件从分布式文件系统拷贝到本地文件系统查看:
$ bin/hadoop fs -get output output
$ cat output/*
或者
在分布式文件系统上查看输出文件:
$ bin/hadoop fs -cat output/*
统计结果:
root@v-jiwan-ubuntu-0:~/hadoop/hadoop-0.20.2-bak/hadoop-0.20.2#bin/hadoop fs -cat output/part-00000
3 dfs.class
2 dfs.period
1 dfs.file
1 dfs.replication
1 dfs.servers
1 dfsadmin
7. HDFS常用操作
hadoopdfs -ls 列出HDFS下的文件
hadoop dfs -ls in 列出HDFS下某个文档中的文件
hadoop dfs -put test1.txt test 上传文件到指定目录并且重新命名,只有所有的DataNode都接收完数据才算成功
hadoop dfs -get in getin 从HDFS获取文件并且重新命名为getin,同put一样可操作文件也可操作目录
hadoop dfs -rmr out 删除指定文件从HDFS上
hadoop dfs -cat in/* 查看HDFS上in目录的内容
hadoop dfsadmin -report 查看HDFS的基本统计信息,结果如下
hadoop dfsadmin -safemode leave 退出安全模式
hadoop dfsadmin -safemode enter 进入安全模式
8.添加节点
可扩展性是HDFS的一个重要特性,首先在新加的节点上安装hadoop,然后修改$HADOOP_HOME/conf/master文件,加入 NameNode主机名,然后在NameNode节点上修改$HADOOP_HOME/conf/slaves文件,加入新加节点主机名,再建立到新加节点无密码的SSH连接
运行启动命令:
start-all.sh
然后可以通过http://(Masternode的主机名):50070查看新添加的DataNode
9负载均衡
start-balancer.sh,可以使DataNode节点上选择策略重新平衡DataNode上的数据块的分布
结束语:遇到问题时,先查看logs,很有帮助。
机器间反问异常的处理
最近,要把原来基于Ubuntu下配置的Hadoop集群迁移到RHEL 5下,结果在启动的时候,出现了莫名其妙的问题:
Namenode进程启动起来了,但是在登录到Datanode上启动集群slaves的时候,出现了Datanode无法连接到Namenode的问题,根据Datanode日志,可以很容易地定位到问题,肯定是在集群启动之初,Datanode向Namenode注册的时候失败了,在Datanode端查看异常信息,如下所示:
[plain] view plaincopy
[shirdrn@slave-01 ~]$ tail -500f hadoop/storage/logs/hadoop-shirdrn-datanode-slave-01.log
2012-02-20 23:54:02,011 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting DataNode
STARTUP_MSG: host = slave-01/192.168.0.181
STARTUP_MSG: args = []
STARTUP_MSG: version = 0.22.0
STARTUP_MSG: classpath = /home/shirdrn/hadoop/hadoop-0.22.0/bin/../conf:/home/shirdrn/installation/jdk1.6.0_30/lib/tools.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/..:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-common-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-common-test-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-ant-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-mapred-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-mapred-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-mapred-examples-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-mapred-test-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-mapred-tools-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-launcher-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/asm-3.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjrt-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjtools-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-compiler-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-ipc-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-cli-1.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-codec-1.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-collections-3.2.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-daemon-1.0.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-el-1.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-httpclient-3.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-lang-2.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-1.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-api-1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-net-1.4.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/core-3.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ecj-3.5.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/guava-r09.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/hsqldb-1.8.0.10.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-core-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-mapper-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-compiler-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-runtime-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jdiff-1.0.9.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jets3t-0.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-util-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsch-0.1.42.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-api-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/junit-4.8.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/kfs-0.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/log4j-1.2.16.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/oro-2.0.8.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-ant-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-generator-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/qdox-1.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/servlet-api-2.5-20081211.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-api-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/snappy-java-1.0.3.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/velocity-1.6.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/xmlenc-0.52.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1/*.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/..:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../conf:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-ant-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-launcher-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/asm-3.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjrt-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjtools-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-compiler-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-ipc-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-cli-1.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-codec-1.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-collections-3.2.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-daemon-1.0.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-el-1.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-httpclient-3.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-lang-2.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-1.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-api-1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-net-1.4.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/core-3.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ecj-3.5.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/guava-r09.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/hsqldb-1.8.0.10.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-core-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-mapper-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-compiler-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-runtime-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jdiff-1.0.9.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jets3t-0.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-util-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsch-0.1.42.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-api-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/junit-4.8.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/kfs-0.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/log4j-1.2.16.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/oro-2.0.8.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-ant-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-generator-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/qdox-1.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/servlet-api-2.5-20081211.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-api-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/snappy-java-1.0.3.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/velocity-1.6.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/xmlenc-0.52.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/..:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-ant-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-launcher-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/asm-3.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjrt-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjtools-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-compiler-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-ipc-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-cli-1.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-codec-1.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-collections-3.2.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-daemon-1.0.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-el-1.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-httpclient-3.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-lang-2.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-1.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-api-1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-net-1.4.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/core-3.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ecj-3.5.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/guava-r09.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/hsqldb-1.8.0.10.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-core-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-mapper-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-compiler-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-runtime-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jdiff-1.0.9.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jets3t-0.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-util-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsch-0.1.42.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-api-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/junit-4.8.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/kfs-0.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/log4j-1.2.16.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/oro-2.0.8.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-ant-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-generator-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/qdox-1.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/servlet-api-2.5-20081211.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-api-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/snappy-java-1.0.3.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/velocity-1.6.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/xmlenc-0.52.jar
STARTUP_MSG: build = http://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22/common -r 1207774; compiled by 'jenkins' on Sun Dec 4 00:57:22 UTC 2011
************************************************************/
2012-02-20 23:54:02,416 WARN org.apache.hadoop.hdfs.server.common.Util: Path /home/shirdrn/hadoop/storage/data/a should be specified as a URI in configuration files. Please update hdfs configuration.
2012-02-20 23:54:02,417 WARN org.apache.hadoop.hdfs.server.common.Util: Path /home/shirdrn/hadoop/storage/data/b should be specified as a URI in configuration files. Please update hdfs configuration.
2012-02-20 23:54:02,417 WARN org.apache.hadoop.hdfs.server.common.Util: Path /home/shirdrn/hadoop/storage/data/c should be specified as a URI in configuration files. Please update hdfs configuration.
2012-02-20 23:54:03,128 WARN org.apache.hadoop.util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2012-02-20 23:54:04,373 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 0 time(s).
2012-02-20 23:54:05,376 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 1 time(s).
2012-02-20 23:54:06,379 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 2 time(s).
2012-02-20 23:54:07,382 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 3 time(s).
2012-02-20 23:54:08,384 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 4 time(s).
2012-02-20 23:54:09,385 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 5 time(s).
2012-02-20 23:54:10,387 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 6 time(s).
2012-02-20 23:54:11,389 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 7 time(s).
2012-02-20 23:54:12,426 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 8 time(s).
2012-02-20 23:54:13,432 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 9 time(s).
2012-02-20 23:54:13,445 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: java.io.IOException: Call to master/192.168.0.180:9000 failed on local exception: java.net.NoRouteToHostException: No route to host
at org.apache.hadoop.ipc.Client.wrapException(Client.java:1063)
at org.apache.hadoop.ipc.Client.call(Client.java:1031)
at org.apache.hadoop.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:198)
at $Proxy4.getProtocolVersion(Unknown Source)
at org.apache.hadoop.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:235)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:275)
at org.apache.hadoop.ipc.RPC.waitForProxy(RPC.java:206)
at org.apache.hadoop.ipc.RPC.waitForProxy(RPC.java:185)
at org.apache.hadoop.ipc.RPC.waitForProxy(RPC.java:169)
at org.apache.hadoop.hdfs.server.datanode.DataNode.<init>(DataNode.java:262)
at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:1567)
at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:1510)
at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:1533)
at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:1680)
at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:1690)
Caused by: java.net.NoRouteToHostException: No route to host
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:373)
at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:416)
at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:504)
at org.apache.hadoop.ipc.Client$Connection.access$2000(Client.java:206)
at org.apache.hadoop.ipc.Client.getConnection(Client.java:1164)
at org.apache.hadoop.ipc.Client.call(Client.java:1008)
... 13 more
2012-02-20 23:54:13,447 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down DataNode at slave-01/192.168.0.181
************************************************************/
首先确定,Namenode的9000端口是否在监听:
[plain] view plaincopy
[shirdrn@master ~]$ netstat -nap | grep 9000
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 192.168.0.180:9000 0.0.0.0:* LISTEN 5374/java
可见,Namenode启动没有问题。
在网上查了一下,有人说(http://hi.baidu.com/tdfrank/blog/item/a1b9e1d95e3b013f10df9b01.html)是,hostname和hosts中配置的虚拟域名不一致会导致出现No route to host异常,经过验证:
master结点:
[plain] view plaincopy
[shirdrn@master ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost
#::1 localhost6.localdomain6 localhost6
192.168.0.180 master master
192.168.0.181 slave-01 slave-01
192.168.0.182 slave-02 slave-02
192.168.0.183 slave-03 slave-03
[shirdrn@master ~]$ cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=master
slave-01结点:
[plain] view plaincopy
[shirdrn@slave-01 ~]$ cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=slave-01
[shirdrn@slave-01 ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost
#::1 localhost6.localdomain6 localhost6
192.168.0.180 master master
192.168.0.181 slave-01 slave-01
192.168.0.182 slave-02 slave-02
192.168.0.183 slave-03 slave-03
另外两个从结点也没有问题,此处略去。
经过对比验证,都没有问题。
其实,我已经想到可能是防火墙的问题,经过查证,终于找到了有人曾经遇到过该问题,可见文章http://samwalt.iteye.com/blog/1099348,需要关闭防火墙,在集群中每台机器上都执行如下命令:
[plain] view plaincopy
[shirdrn@master ~]$ su root
Password:
[root@master shirdrn]# service iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
需要切换到root用户才能执行关闭。
然后,再启动Hadoop集群,就没有问题了。
感谢这位兄弟 ,郁闷了一天终于搞定,不过有些概念 参数的配置要细看
下一部 写一个应用看看
Hadoop集群配置(最全面总结)
分类: 云计算hadoop 2012-02-06 17:15 6711人阅读 评论(9) 收藏 举报
目录(?)[+]
Hadoop集群配置(最全面总结) huangguisu
通常,集群里的一台机器被指定为 NameNode,另一台不同的机器被指定为JobTracker。这些机器是masters。余下的机器即作为DataNode也作为TaskTracker。这些机器是slaves\
官方地址:(http://hadoop.apache.org/common/docs/r0.19.2/cn/cluster_setup.html)
1 先决条件
确保在你集群中的每个节点上都安装了所有必需软件:sun-JDK ,ssh,Hadoop
JavaTM1.5.x,必须安装,建议选择Sun公司发行的Java版本。
ssh 必须安装并且保证 sshd一直运行,以便用Hadoop 脚本管理远端Hadoop守护进程。
2 实验环境搭建
2.1 准备工作
操作系统:Ubuntu
部署:Vmvare
在vmvare安装好一台Ubuntu虚拟机后,可以导出或者克隆出另外两台虚拟机。
说明:
保证虚拟机的ip和主机的ip在同一个ip段,这样几个虚拟机和主机之间可以相互通信。
为了保证虚拟机的ip和主机的ip在同一个ip段,虚拟机连接设置为桥连。
准备机器:一台master,若干台slave,配置每台机器的/etc/hosts保证各台机器之间通过机器名可以互访,例如:
10.64.56.76 node1(master)
10.64.56.77 node2 (slave1)
10.64.56.78 node3 (slave2)
主机信息:
机器名 IP地址 作用
Node1 10.64.56.76 NameNode、JobTracker
Node2 10.64.56.77 DataNode、TaskTracker
Node3 10.64.56.78 DataNode、TaskTracker 为保证环境一致先安装好JDK和ssh:
2.2 安装JDK
#安装JDK
$ sudo apt-get install sun-java6-jdk1.2.3
这个安装,java执行文件自动添加到/usr/bin/目录。
验证 shell命令 :java -version 看是否与你的版本号一致。
2.3下载、创建用户
$ useradd hadoop
$ cd /home/hadoop
在所有的机器上都建立相同的目录,也可以就建立相同的用户,最好是以该用户的home路径来做hadoop的安装路径。
例如在所有的机器上的安装路径都是:/home/hadoop/hadoop-0.20.203,这个不需要mkdir,在/home/hadoop/下解压hadoop包的时候,会自动生成)
(当然可以安装/usr/local/目录下,例如/usr/local/hadoop-0.20.203/
chown -R hadoop /usr/local/hadoop-0.20.203/
chgrp -R hadoop /usr/local/hadoop-0.20.203/
)
(最好不要使用root安装,因为不推荐各个机器之间使用root访问 )
2.4 安装ssh和配置
1) 安装:sudo apt-get install ssh
这个安装完后,可以直接使用ssh命令 了。
执行$ netstat -nat 查看22端口是否开启了。
测试:ssh localhost。
输入当前用户的密码,回车就ok了。说明安装成功,同时ssh登录需要密码。
(这种默认安装方式完后,默认配置文件是在/etc/ssh/目录下。sshd配置文件是:/etc/ssh/sshd_config):
注意:在所有机子都需要安装ssh。
2) 配置:
在Hadoop启动以后,Namenode是通过SSH(Secure Shell)来启动和停止各个datanode上的各种守护进程的,这就须要在节点之间执行指令的时候是不须要输入密码的形式,故我们须要配置SSH运用无密码公钥认证的形式。
以本文中的三台机器为例,现在node1是主节点,他须要连接node2和node3。须要确定每台机器上都安装了ssh,并且datanode机器上sshd服务已经启动。
( 说明:hadoop@hadoop~]$ssh-keygen -t rsa
这个命令将为hadoop上的用户hadoop生成其密钥对,询问其保存路径时直接回车采用默认路径,当提示要为生成的密钥输入passphrase的时候,直接回车,也就是将其设定为空密码。生成的密钥对id_rsa,id_rsa.pub,默认存储在/home/hadoop/.ssh目录下然后将id_rsa.pub的内容复制到每个机器(也包括本机)的/home/dbrg/.ssh/authorized_keys文件中,如果机器上已经有authorized_keys这个文件了,就在文件末尾加上id_rsa.pub中的内容,如果没有authorized_keys这个文件,直接复制过去就行.)
3) 首先设置namenode的ssh为无需密码的、自动登录。
切换到hadoop用户( 保证用户hadoop可以无需密码登录,因为我们后面安装的hadoop属主是hadoop用户。)
$ su hadoop
cd /home/hadoop
$ ssh-keygen -t rsa
然后一直按回车
完成后,在home跟目录下会产生隐藏文件夹.ssh
$ cd .ssh
之后ls 查看文件
cp id_rsa.pub authorized_keys
测试:
$ssh localhost
或者:
$ ssh node1
第一次ssh会有提示信息:
The authenticity of host ‘node1 (10.64.56.76)’ can’t be established.
RSA key fingerprint is 03:e0:30:cb:6e:13:a8:70:c9:7e:cf:ff:33:2a:67:30.
Are you sure you want to continue connecting (yes/no)?
输入 yes 来继续。这会把该服务器添加到你的已知主机的列表中
发现链接成功,并且无需密码。
4 ) 复制authorized_keys到node2 和node3 上
为了保证node1可以无需密码自动登录到node2和node3,先在node2和node3上执行
$ su hadoop
cd /home/hadoop
$ ssh-keygen -t rsa
一路按回车.
然后回到node1,复制authorized_keys到node2 和node3
[hadoop@hadoop .ssh]$ scp authorized_keys node2:/home/hadoop/.ssh/
[hadoop@hadoop .ssh]$ scp authorized_keys node3:/home/hadoop/.ssh/
这里会提示输入密码,输入hadoop账号密码就可以了。
改动你的 authorized_keys 文件的许可权限
[hadoop@hadoop .ssh]$chmod 644 authorized_keys
测试:ssh node2或者ssh node3(第一次需要输入yes)。
如果不须要输入密码则配置成功,如果还须要请检查上面的配置能不能正确。
2.5 安装Hadoop
#切换为hadoop用户
su hadoop
wgethttp://apache.mirrors.tds.net//hadoop/common/hadoop-0.20.203.0/hadoop-0.20.203.0rc1.tar.gz
下载安装包后,直接解压安装即可:
$ tar -zxvfhadoop-0.20.203.0rc1.tar.gz
1 ) 安装Hadoop集群通常要将安装软件解压到集群内的所有机器上。并且安装路径要一致,如果我们用HADOOP_HOME指代安装的根路径,通常,集群里的所有机器的
HADOOP_HOME路径相同。
2 ) 如果集群内机器的环境完全一样,可以在一台机器上配置好,然后把配置好的软件即hadoop-0.20.203整个文件夹拷贝到其他机器的相同位置即可。
3 ) 可以将Master上的Hadoop通过scp拷贝到每一个Slave相同的目录下,同时根据每一个Slave的Java_HOME 的不同修改其hadoop-env.sh 。
4) 为了方便,使用hadoop命令或者start-all.sh等命令,修改Master上/etc/profile 新增以下内容:
export HADOOP_HOME=/home/hadoop/hadoop-0.20.203
exportPATH=$PATH:$HADOOP_HOME/bin
修改完毕后,执行source /etc/profile 来使其生效。
6)配置conf/hadoop-env.sh文件
配置conf/hadoop-env.sh文件
#添加
export JAVA_HOME=/usr/lib/jvm/java-6-sun/
这里修改为你的jdk的安装位置。
测试hadoop安装:
Bin/hadoop jar hadoop-0.20.2-examples.jarwordcount conf/ /tmp/out
3. 集群配置(所有节点相同)
3.1配置文件:conf/core-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://node1:49000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/hadoop_home/var</value>
</property>
</configuration>
1)fs.default.name是NameNode的URI。hdfs://主机名:端口/
2)hadoop.tmp.dir :Hadoop的默认临时路径,这个最好配置,如果在新增节点或者其他情况下莫名其妙的DataNode启动不了,就删除此文件中的tmp目录即可。不过如果删除了NameNode机器的此目录,那么就需要重新执行NameNode格式化的命令。
3.2配置文件:conf/mapred-site.xml
<?xmlversion="1.0"?>
<?xml-stylesheettype="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>node1:49001</value>
</property>
<property>
<name>mapred.local.dir</name>
<value>/home/hadoop/hadoop_home/var</value>
</property>
</configuration>
1)mapred.job.tracker是JobTracker的主机(或者IP)和端口。主机:端口。
3.3配置文件:conf/hdfs-site.xml
<?xmlversion="1.0"?>
<?xml-stylesheettype="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.name.dir</name>
<value>/home/hadoop/name1, /home/hadoop/name2</value> #hadoop的name目录路径
<description> </description>
</property>
<property>
<name>dfs.data.dir</name>
<value>/home/hadoop/data1, /home/hadoop/data2</value>
<description> </description>
</property>
<property>
<name>dfs.replication</name>
<!-- 我们的集群又两个结点,所以rep两份 -->
<value>2</vaue>
</property>
</configuration>
1) dfs.name.dir是NameNode持久存储名字空间及事务日志的本地文件系统路径。 当这个值是一个逗号分割的目录列表时,nametable数据将会被复制到所有目录中做冗余备份。
2) dfs.data.dir是DataNode存放块数据的本地文件系统路径,逗号分割的列表。 当这个值是逗号分割的目录列表时,数据将被存储在所有目录下,通常分布在不同设备上。
3)dfs.replication是数据需要备份的数量,默认是3,如果此数大于集群的机器数会出错。
注意:此处的name1、name2、data1、data2目录不能预先创建,hadoop格式化时会自动创建,如果预先创建反而会有问题。
3.4配置masters和slaves主从结点
配置conf/masters和conf/slaves来设置主从结点,注意最好使用主机名,并且保证机器之间通过主机名可以互相访问,每个主机名一行。
vi masters:
输入:
node1
vi slaves:
输入:
node2
node3
配置结束,把配置好的hadoop文件夹拷贝到其他集群的机器中,并且保证上面的配置对于其他机器而言正确,例如:如果其他机器的Java安装路径不一样,要修改conf/hadoop-env.sh
$ scp -r /home/hadoop/hadoop-0.20.203 root@node2: /home/hadoop/
4 hadoop启动
4.1 格式化一个新的分布式文件系统
先格式化一个新的分布式文件系统
$ cd hadoop-0.20.203
$ bin/hadoop namenode -format
成功情况下系统输出:
12/02/06 00:46:50 INFO namenode.NameNode:STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = ubuntu/127.0.1.1
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 0.20.203.0
STARTUP_MSG: build =http://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-203-r 1099333; compiled by 'oom' on Wed May 4 07:57:50 PDT 2011
************************************************************/
12/02/0600:46:50 INFO namenode.FSNamesystem: fsOwner=root,root
12/02/06 00:46:50 INFO namenode.FSNamesystem:supergroup=supergroup
12/02/06 00:46:50 INFO namenode.FSNamesystem:isPermissionEnabled=true
12/02/06 00:46:50 INFO common.Storage: Imagefile of size 94 saved in 0 seconds.
12/02/06 00:46:50 INFO common.Storage: Storagedirectory /opt/hadoop/hadoopfs/name1 has been successfully formatted.
12/02/06 00:46:50 INFO common.Storage: Imagefile of size 94 saved in 0 seconds.
12/02/06 00:46:50 INFO common.Storage: Storagedirectory /opt/hadoop/hadoopfs/name2 has been successfully formatted.
12/02/06 00:46:50 INFO namenode.NameNode:SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode atv-jiwan-ubuntu-0/127.0.0.1
************************************************************/
查看输出保证分布式文件系统格式化成功
执行完后可以到master机器上看到/home/hadoop//name1和/home/hadoop//name2两个目录。在主节点master上面启动hadoop,主节点会启动所有从节点的hadoop。
4.2 启动所有节点
启动方式1:
$ bin/start-all.sh (同时启动HDFS和Map/Reduce)
系统输出:
starting namenode, logging to /usr/local/hadoop/logs/hadoop-hadoop-namenode-ubuntu.out
node2: starting datanode, loggingto /usr/local/hadoop/logs/hadoop-hadoop-datanode-ubuntu.out
node3: starting datanode, loggingto /usr/local/hadoop/logs/hadoop-hadoop-datanode-ubuntu.out
node1: starting secondarynamenode,logging to /usr/local/hadoop/logs/hadoop-hadoop-secondarynamenode-ubuntu.out
starting jobtracker, logging to/usr/local/hadoop/logs/hadoop-hadoop-jobtracker-ubuntu.out
node2: starting tasktracker,logging to /usr/local/hadoop/logs/hadoop-hadoop-tasktracker-ubuntu.out
node3: starting tasktracker,logging to /usr/local/hadoop/logs/hadoop-hadoop-tasktracker-ubuntu.out
As you can see in slave's output above, it will automatically format it's storage directory(specified by dfs.data.dir) if it is not formattedalready. It will also create the directory if it does not exist yet.
执行完后可以到master(node1)和slave(node1,node2)机器上看到/home/hadoop/hadoopfs/data1和/home/hadoop/data2两个目录。
启动方式2:
启动Hadoop集群需要启动HDFS集群和Map/Reduce集群。
在分配的NameNode上,运行下面的命令启动HDFS:
$ bin/start-dfs.sh(单独启动HDFS集群)
bin/start-dfs.sh脚本会参照NameNode上${HADOOP_CONF_DIR}/slaves文件的内容,在所有列出的slave上启动DataNode守护进程。
在分配的JobTracker上,运行下面的命令启动Map/Reduce:
$bin/start-mapred.sh (单独启动Map/Reduce)
bin/start-mapred.sh脚本会参照JobTracker上${HADOOP_CONF_DIR}/slaves文件的内容,在所有列出的slave上启动TaskTracker守护进程。
4.3 关闭所有节点
从主节点master关闭hadoop,主节点会关闭所有从节点的hadoop。
$ bin/stop-all.sh
Hadoop守护进程的日志写入到 ${HADOOP_LOG_DIR} 目录 (默认是 ${HADOOP_HOME}/logs).
${HADOOP_HOME}就是安装路径.
5 .测试
1)浏览NameNode和JobTracker的网络接口,它们的地址默认为:
NameNode - http://node1:50070/
JobTracker - http://node2:50030/
3) 使用netstat –nat查看端口49000和49001是否正在使用。
4) 使用jps查看进程
要想检查守护进程是否正在运行,可以使用 jps 命令(这是用于 JVM 进程的ps 实用程序)。这个命令列出 5 个守护进程及其进程标识符。
5)将输入文件拷贝到分布式文件系统:
$ bin/hadoop fs -mkdir input
$ bin/hadoop fs -put conf/core-site.xml input
运行发行版提供的示例程序:
$ bin/hadoop jar hadoop-0.20.2-examples.jar grep input output 'dfs[a-z.]+'
6.补充
Q: bin/hadoop jar hadoop-0.20.2-examples.jar grep input output 'dfs[a-z.]+' 什么意思啊?
A: bin/hadoop jar(使用hadoop运行jar包) hadoop-0.20.2_examples.jar(jar包的名字) grep (要使用的类,后边的是参数)input output 'dfs[a-z.]+'
整个就是运行hadoop示例程序中的grep,对应的hdfs上的输入目录为input、输出目录为output。
Q: 什么是grep?
A: A map/reduce program that counts the matches of a regex in the input.
查看输出文件:
将输出文件从分布式文件系统拷贝到本地文件系统查看:
$ bin/hadoop fs -get output output
$ cat output/*
或者
在分布式文件系统上查看输出文件:
$ bin/hadoop fs -cat output/*
统计结果:
root@v-jiwan-ubuntu-0:~/hadoop/hadoop-0.20.2-bak/hadoop-0.20.2#bin/hadoop fs -cat output/part-00000
3 dfs.class
2 dfs.period
1 dfs.file
1 dfs.replication
1 dfs.servers
1 dfsadmin
7. HDFS常用操作
hadoopdfs -ls 列出HDFS下的文件
hadoop dfs -ls in 列出HDFS下某个文档中的文件
hadoop dfs -put test1.txt test 上传文件到指定目录并且重新命名,只有所有的DataNode都接收完数据才算成功
hadoop dfs -get in getin 从HDFS获取文件并且重新命名为getin,同put一样可操作文件也可操作目录
hadoop dfs -rmr out 删除指定文件从HDFS上
hadoop dfs -cat in/* 查看HDFS上in目录的内容
hadoop dfsadmin -report 查看HDFS的基本统计信息,结果如下
hadoop dfsadmin -safemode leave 退出安全模式
hadoop dfsadmin -safemode enter 进入安全模式
8.添加节点
可扩展性是HDFS的一个重要特性,首先在新加的节点上安装hadoop,然后修改$HADOOP_HOME/conf/master文件,加入 NameNode主机名,然后在NameNode节点上修改$HADOOP_HOME/conf/slaves文件,加入新加节点主机名,再建立到新加节点无密码的SSH连接
运行启动命令:
start-all.sh
然后可以通过http://(Masternode的主机名):50070查看新添加的DataNode
9负载均衡
start-balancer.sh,可以使DataNode节点上选择策略重新平衡DataNode上的数据块的分布
结束语:遇到问题时,先查看logs,很有帮助。
机器间反问异常的处理
最近,要把原来基于Ubuntu下配置的Hadoop集群迁移到RHEL 5下,结果在启动的时候,出现了莫名其妙的问题:
Namenode进程启动起来了,但是在登录到Datanode上启动集群slaves的时候,出现了Datanode无法连接到Namenode的问题,根据Datanode日志,可以很容易地定位到问题,肯定是在集群启动之初,Datanode向Namenode注册的时候失败了,在Datanode端查看异常信息,如下所示:
[plain] view plaincopy
[shirdrn@slave-01 ~]$ tail -500f hadoop/storage/logs/hadoop-shirdrn-datanode-slave-01.log
2012-02-20 23:54:02,011 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting DataNode
STARTUP_MSG: host = slave-01/192.168.0.181
STARTUP_MSG: args = []
STARTUP_MSG: version = 0.22.0
STARTUP_MSG: classpath = /home/shirdrn/hadoop/hadoop-0.22.0/bin/../conf:/home/shirdrn/installation/jdk1.6.0_30/lib/tools.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/..:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-common-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-common-test-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-ant-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-mapred-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-mapred-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-mapred-examples-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-mapred-test-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-mapred-tools-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-launcher-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/asm-3.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjrt-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjtools-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-compiler-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-ipc-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-cli-1.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-codec-1.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-collections-3.2.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-daemon-1.0.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-el-1.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-httpclient-3.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-lang-2.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-1.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-api-1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-net-1.4.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/core-3.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ecj-3.5.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/guava-r09.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/hsqldb-1.8.0.10.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-core-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-mapper-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-compiler-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-runtime-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jdiff-1.0.9.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jets3t-0.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-util-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsch-0.1.42.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-api-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/junit-4.8.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/kfs-0.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/log4j-1.2.16.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/oro-2.0.8.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-ant-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-generator-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/qdox-1.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/servlet-api-2.5-20081211.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-api-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/snappy-java-1.0.3.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/velocity-1.6.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/xmlenc-0.52.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1/*.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/..:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../conf:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-ant-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-launcher-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/asm-3.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjrt-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjtools-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-compiler-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-ipc-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-cli-1.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-codec-1.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-collections-3.2.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-daemon-1.0.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-el-1.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-httpclient-3.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-lang-2.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-1.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-api-1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-net-1.4.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/core-3.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ecj-3.5.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/guava-r09.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/hsqldb-1.8.0.10.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-core-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-mapper-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-compiler-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-runtime-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jdiff-1.0.9.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jets3t-0.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-util-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsch-0.1.42.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-api-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/junit-4.8.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/kfs-0.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/log4j-1.2.16.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/oro-2.0.8.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-ant-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-generator-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/qdox-1.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/servlet-api-2.5-20081211.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-api-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/snappy-java-1.0.3.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/velocity-1.6.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/xmlenc-0.52.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/..:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-ant-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../hadoop-hdfs-test-0.22.0-sources.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ant-launcher-1.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/asm-3.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjrt-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/aspectjtools-1.6.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-compiler-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/avro-ipc-1.5.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-cli-1.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-codec-1.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-collections-3.2.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-daemon-1.0.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-el-1.0.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-httpclient-3.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-lang-2.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-1.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-logging-api-1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/commons-net-1.4.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/core-3.1.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/ecj-3.5.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/guava-r09.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/hsqldb-1.8.0.10.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-core-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jackson-mapper-asl-1.7.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-compiler-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jasper-runtime-5.5.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jdiff-1.0.9.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jets3t-0.7.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jetty-util-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsch-0.1.42.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-2.1-jetty-6.1.26.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/jsp-api-2.1-glassfish-2.1.v20091210.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/junit-4.8.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/kfs-0.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/log4j-1.2.16.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/mockito-all-1.8.5.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/oro-2.0.8.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-ant-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/paranamer-generator-2.3.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/qdox-1.12.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/servlet-api-2.5-20081211.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-api-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/snappy-java-1.0.3.2.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/velocity-1.6.4.jar:/home/shirdrn/hadoop/hadoop-0.22.0/bin/../lib/xmlenc-0.52.jar
STARTUP_MSG: build = http://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22/common -r 1207774; compiled by 'jenkins' on Sun Dec 4 00:57:22 UTC 2011
************************************************************/
2012-02-20 23:54:02,416 WARN org.apache.hadoop.hdfs.server.common.Util: Path /home/shirdrn/hadoop/storage/data/a should be specified as a URI in configuration files. Please update hdfs configuration.
2012-02-20 23:54:02,417 WARN org.apache.hadoop.hdfs.server.common.Util: Path /home/shirdrn/hadoop/storage/data/b should be specified as a URI in configuration files. Please update hdfs configuration.
2012-02-20 23:54:02,417 WARN org.apache.hadoop.hdfs.server.common.Util: Path /home/shirdrn/hadoop/storage/data/c should be specified as a URI in configuration files. Please update hdfs configuration.
2012-02-20 23:54:03,128 WARN org.apache.hadoop.util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2012-02-20 23:54:04,373 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 0 time(s).
2012-02-20 23:54:05,376 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 1 time(s).
2012-02-20 23:54:06,379 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 2 time(s).
2012-02-20 23:54:07,382 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 3 time(s).
2012-02-20 23:54:08,384 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 4 time(s).
2012-02-20 23:54:09,385 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 5 time(s).
2012-02-20 23:54:10,387 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 6 time(s).
2012-02-20 23:54:11,389 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 7 time(s).
2012-02-20 23:54:12,426 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 8 time(s).
2012-02-20 23:54:13,432 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: master/192.168.0.180:9000. Already tried 9 time(s).
2012-02-20 23:54:13,445 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: java.io.IOException: Call to master/192.168.0.180:9000 failed on local exception: java.net.NoRouteToHostException: No route to host
at org.apache.hadoop.ipc.Client.wrapException(Client.java:1063)
at org.apache.hadoop.ipc.Client.call(Client.java:1031)
at org.apache.hadoop.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:198)
at $Proxy4.getProtocolVersion(Unknown Source)
at org.apache.hadoop.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:235)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:275)
at org.apache.hadoop.ipc.RPC.waitForProxy(RPC.java:206)
at org.apache.hadoop.ipc.RPC.waitForProxy(RPC.java:185)
at org.apache.hadoop.ipc.RPC.waitForProxy(RPC.java:169)
at org.apache.hadoop.hdfs.server.datanode.DataNode.<init>(DataNode.java:262)
at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:1567)
at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:1510)
at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:1533)
at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:1680)
at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:1690)
Caused by: java.net.NoRouteToHostException: No route to host
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:373)
at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:416)
at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:504)
at org.apache.hadoop.ipc.Client$Connection.access$2000(Client.java:206)
at org.apache.hadoop.ipc.Client.getConnection(Client.java:1164)
at org.apache.hadoop.ipc.Client.call(Client.java:1008)
... 13 more
2012-02-20 23:54:13,447 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down DataNode at slave-01/192.168.0.181
************************************************************/
首先确定,Namenode的9000端口是否在监听:
[plain] view plaincopy
[shirdrn@master ~]$ netstat -nap | grep 9000
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 192.168.0.180:9000 0.0.0.0:* LISTEN 5374/java
可见,Namenode启动没有问题。
在网上查了一下,有人说(http://hi.baidu.com/tdfrank/blog/item/a1b9e1d95e3b013f10df9b01.html)是,hostname和hosts中配置的虚拟域名不一致会导致出现No route to host异常,经过验证:
master结点:
[plain] view plaincopy
[shirdrn@master ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost
#::1 localhost6.localdomain6 localhost6
192.168.0.180 master master
192.168.0.181 slave-01 slave-01
192.168.0.182 slave-02 slave-02
192.168.0.183 slave-03 slave-03
[shirdrn@master ~]$ cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=master
slave-01结点:
[plain] view plaincopy
[shirdrn@slave-01 ~]$ cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=slave-01
[shirdrn@slave-01 ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost
#::1 localhost6.localdomain6 localhost6
192.168.0.180 master master
192.168.0.181 slave-01 slave-01
192.168.0.182 slave-02 slave-02
192.168.0.183 slave-03 slave-03
另外两个从结点也没有问题,此处略去。
经过对比验证,都没有问题。
其实,我已经想到可能是防火墙的问题,经过查证,终于找到了有人曾经遇到过该问题,可见文章http://samwalt.iteye.com/blog/1099348,需要关闭防火墙,在集群中每台机器上都执行如下命令:
[plain] view plaincopy
[shirdrn@master ~]$ su root
Password:
[root@master shirdrn]# service iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
需要切换到root用户才能执行关闭。
然后,再启动Hadoop集群,就没有问题了。
发表评论
-
hdfs HA 实验
2016-11-06 16:35 562hdfs HA 实验 hdfs 第一次 机器准备 ... -
集群中 统一命令执行 和 文件拷贝
2016-11-05 13:06 693filecopy #!/bin/bash if [ $# ... -
ssh 免密码 不工作的问题
2016-11-05 12:43 428ssh 免密码 不工作的问题 别人不能自动登录进来,先检查 , ... -
eclipse
2013-07-23 21:37 700eclipse + hadoop main ... -
远程链接并自动执行 命令 带参数 同步主机时间到各vm
2013-03-11 22:19 907vmware 设置的 tools.syncTime = &q ... -
hadoop fs.default.name 9000 端口在外面连不上
2013-03-06 20:31 1648hadoop fs.default.name 9000 ... -
hadoop 我的配置过程 -主机配置
2013-03-06 01:24 734192.168.1.10 node10 192.1 ... -
hadoop 我的配置
2012-10-04 19:27 1164slave 192.168.1.101 192.1 ... -
转 经典漫画讲解HDFS原理
2012-10-04 19:16 1286转 http://blog.csdn.net ... -
hadoop 在eclipse 中调试
2012-10-04 19:13 1481转 http://blog.sciencenet.cn/bl ...
相关推荐
Hadoop是Apache软件基金会开发的一个开源分布式计算框架,它允许在普通硬件上高效处理大量数据。在Windows环境下,Hadoop的使用与Linux有所不同,因为它的设计最初是针对Linux操作系统的。"winutils"和"hadoop.dll...
在IT行业中,Hadoop是一个广泛使用的开源框架,主要用于大数据处理和分布式存储。Hadoop 2.7.3是这个框架的一个稳定版本,它包含了多个改进和优化,以提高性能和稳定性。在这个版本中,Winutils.exe和hadoop.dll是两...
Hadoop是一个开源的分布式计算框架,由Apache基金会开发,它主要设计用于处理和存储大量数据。在提供的信息中,我们关注的是"Hadoop的dll文件",这是一个动态链接库(DLL)文件,通常在Windows操作系统中使用,用于...
在Hadoop生态系统中,`hadoop.dll`和`winutils.exe`是两个关键组件,尤其对于Windows用户来说,它们在本地开发和运行Hadoop相关应用时必不可少。`hadoop.dll`是一个动态链接库文件,主要用于在Windows环境中提供...
在大数据处理领域,Hadoop是一个不可或缺的开源框架,它提供了分布式存储和计算的能力。本文将详细探讨与"Hadoop.dll"和"winutils.exe"相关的知识点,以及它们在Hadoop-2.7.1版本中的作用。 Hadoop.dll是Hadoop在...
在IT行业中,Hadoop是一个广泛使用的开源框架,主要用于大数据处理和分布式存储。Hadoop 2.7.3是Hadoop发展中的一个重要版本,它包含了众多的优化和改进,旨在提高性能、稳定性和易用性。在这个版本中,`hadoop.dll`...
Hadoop 是一个处理、存储和分析海量的分布式、非结构化数据的开源框架。最初由 Yahoo 的工程师 Doug Cutting 和 Mike Cafarella Hadoop 是一个处理、存储和分析海量的分布式、非结构化数据的开源框架。最初由 Yahoo...
在Hadoop生态系统中,Hadoop 2.7.7是一个重要的版本,它为大数据处理提供了稳定性和性能优化。Hadoop通常被用作Linux环境下的分布式计算框架,但有时开发者或学习者在Windows环境下也需要进行Hadoop相关的开发和测试...
Hadoop是一个由Apache基金会所开发的分布式系统基础架构。用户可以在不了解分布式底层细节的情况下,开发分布式程序。充分利用集群的威力进 Hadoop是一个由Apache基金会所开发的分布式系统基础架构。用户可以在不...
标题 "hadoop2.6 hadoop.dll+winutils.exe" 提到的是Hadoop 2.6版本中的两个关键组件:`hadoop.dll` 和 `winutils.exe`,这两个组件对于在Windows环境中配置和运行Hadoop至关重要。Hadoop原本是为Linux环境设计的,...
在Hadoop生态系统中,`hadoop.dll`和`winutils.exe`是两个关键组件,尤其对于Windows用户来说。本文将详细介绍这两个文件以及它们在Hadoop 2.6.0版本中的作用。 `hadoop.dll`是Hadoop在Windows环境下运行所必需的一...
在Windows环境下安装Hadoop 3.1.0是学习和使用大数据处理技术的重要步骤。Hadoop是一个开源框架,主要用于分布式存储和处理大规模数据集。在这个过程中,我们将详细讲解Hadoop 3.1.0在Windows上的安装过程以及相关...
在windows环境下开发hadoop时,需要配置HADOOP_HOME环境变量,变量值D:\hadoop-common-2.7.3-bin-master,并在Path追加%HADOOP_HOME%\bin,有可能出现如下错误: org.apache.hadoop.io.nativeio.NativeIO$Windows....
Hadoop是Apache软件基金会开发的一个开源分布式计算框架,它的核心设计是处理和存储大量数据的能力。这个名为"Hadoop3.1.3.rar"的压缩包文件包含了Hadoop 3.1.3版本的所有组件和相关文件,使得用户可以下载并进行...
在IT行业中,Hadoop是一个广泛使用的开源框架,主要用于大数据处理和分布式存储。它是由Apache软件基金会开发并维护的,旨在实现高效、可扩展的数据处理能力。Hadoop的核心由两个主要组件构成:Hadoop Distributed ...
Hadoop是Apache软件基金会开发的一个开源分布式计算框架,主要由HDFS(Hadoop Distributed File System)和MapReduce两大部分组成,旨在提供一种可靠、可扩展、高效的数据处理和存储解决方案。在标题中提到的...
在Hadoop生态系统中,`winutils.exe`和`hadoop.dll`是Windows环境下运行Hadoop必备的组件,尤其对于开发和测试环境来说至关重要。这里我们深入探讨这两个组件以及与Eclipse插件的相关性。 首先,`winutils.exe`是...
在IT行业中,Hadoop是一个广泛使用的开源框架,主要用于大数据处理和分布式存储。Hadoop2.6.0是这个框架的一个重要版本,它包含了多项优化和改进,以提高系统的稳定性和性能。在这个压缩包中,我们关注的是与Windows...
Hadoop是Apache软件基金会开发的一个开源分布式计算框架,它允许在大规模集群中高效处理和存储海量数据。这个压缩包文件包含的"hadop实用案例"很可能是为了帮助初学者理解和应用Hadoop技术。以下是关于Hadoop的一些...