摘要: 今天在hadoop集群环境下需要将两台datanode删除,为了不影响在运行业务,需对节点进行动态删除,记录操作过程如下:1, 从集群中移走节点,需要对移走节点的数据进行备份:在主节点的core-site.xml配置文件中添加如下内容:<property> <name>dfs.hosts.exclude</name> <value>/home/hadoop/hadoop/conf/excludes</value></property>说明dfs.hosts.exclude:指要删除的节点/home/hadoop/hadoo 阅读全文
posted @ 2011-11-08 23:38 Jonson Li 阅读(624) 评论(0) 推荐(0)
摘要: http://developer.yahoo.com/hadoop/tutorial/index.htmlTable of ContentsWelcome to the Yahoo! Hadoop Tutorial. This tutorial includes the following materials designed to teach you how to use the Hadoop distributed data processing environment:Hadoop 0.18.0 distribution (includes full source code)A virt 阅读全文
posted @ 2011-11-08 23:33 Jonson Li 阅读(297) 评论(0) 推荐(0)
摘要: Hadoop添加节点的方法 1.将cluster停止。 2. 在新加的节点上配置好环境,包括ssh,jdk,并将其它datanode上的hadoop和hbase文件夹全部copy过去; 3. 将新的datanode的host加到集群namenode及其他datanode中去; 4. 将新的datanode的host加到master的conf/slaves中; 5. 再次启动cluster,在cluster中看到新的datanode节点; 5. 运行bin/start-balancer.sh,平衡数据。备注: 1.balance是为了平衡数据,如果不执行该命令,cluster将会把新的数据都存放 阅读全文
posted @ 2011-11-08 23:31 Jonson Li 阅读(818) 评论(0) 推荐(0)
摘要: root@u1:/home/sa/hod/hadoop-0.20.1# bin/hadoop fs -put ./conf/core-site.xml /inputroot@u1:/home/sa/hod/hadoop-0.20.1# bin/hadoop jar hadoop-*-examples.jar wordcount /input /output2root@u1:/home/sa/hod/hadoop-0.20.1# bin/hadoop jar hadoop-*-examples.jarAn example program must be given as the first ar 阅读全文
posted @ 2011-11-08 22:38 Jonson Li 阅读(703) 评论(0) 推荐(0)
摘要: Hadoop MapReduce是一个软件框架(framwork),这个架构的目的是方便程序员在大规模集群(可大到上千台结点)上处理超大规模数据(可多到数T),而且MapReduce的可靠性和fault-tolerant特性都很好。一个MapReduce job 会把输入数据分割成独立的若干块,这些数据块由map tasks并行处理。MapReduce framework把map task的输出进行排序,作为reduce task的输入。通常job的输入和输出都被保存在文件系统中。Framework负责调度,监控这些任务,而且会重复执行那些失败的task。一般情况下,计算集群和存储集群是一样的 阅读全文
posted @ 2011-11-08 21:56 Jonson Li 阅读(311) 评论(0) 推荐(0)
摘要: 本文继续来看Mapper的实现。Mapper01publicstaticclassMap02extendsMapper<LongWritable,Text,Text,IntWritable>{03privatefinalstaticIntWritableone=newIntWritable(1);04privateTextword=newText();0506publicvoidmap(LongWritablekey,Textvalue,Contextcontext)07throwsIOException,InterruptedException{08Stringline=valu 阅读全文
posted @ 2011-11-08 21:56 Jonson Li 阅读(346) 评论(0) 推荐(0)
摘要: 本文通过官方文档中的word count例子来学习如何利用Hadoop进行分布式计算。1. Inputs and Outputs任何一个程序,都需要有输入和输出,Hadoop MapReduce框架只能操作<Key, Value>对,就是说Hadoop的输入和输出都是<Key, Value>对,当然,key和value可以有多种类型。key和value会被Hadoop序列化。Hadoop默认的序列化机制要求key和value实现Writable接口。除此之外,key还必须能够被排序,所以,需要让key实现WritableComparable接口。下面是一个MapRedu 阅读全文
posted @ 2011-11-08 21:54 Jonson Li 阅读(381) 评论(0) 推荐(0)
摘要: 这几天在自己的ubuntu机器上,研究sector/sphere,突然发现我原来在公司配置ssh无密码登录的办法无效,后来搜索后知道了原因,现将ubuntu上设置ssh无密码登录的步骤列出来:步骤1.创建密钥~/.ssh$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): (忽略) Enter same passphrase again: (忽略) Your identification has been saved in /.ssh/id_ 阅读全文
posted @ 2011-11-08 09:24 Jonson Li 阅读(653) 评论(0) 推荐(0)
摘要: ubuntu安装以后缺省的hostname是ubuntu,安装的机器多了,容易产生混淆,直接用命令#hostname newname,重启后失效。 修改/etc/hostname文件就可以了, root@ubuntuServer:/etc# more hostname #ubuntu newname 但是这样一来在X下面,很多命令不正常,比如打开terminal出不来,原来还需要修改 /etc/hosts文件, 127.0.0.1 localhost.localdomain localhost newname # # The following lines are des... 阅读全文
posted @ 2011-11-08 08:53 Jonson Li 阅读(2217) 评论(0) 推荐(0)
摘要: Ubuntu 的网络配置文件主要有以下几个IP地址配置文件: /etc/network/interfaces打开后里面可设置DHCP或手动设置静态ip。前面auto eth0,让网卡开机自动挂载.1. 以DHCP方式配置网卡编辑文件/etc/network/interfaces:sudo vi /etc/network/interfaces并用下面的行来替换有关eth0的行:# The primary network interface – use DHCP to find our addressauto eth0iface eth0 inet dhcp用下面的命令使网络设置生效:sudo / 阅读全文
posted @ 2011-11-08 08:46 Jonson Li 阅读(290) 评论(0) 推荐(0)
摘要: 在向大家详细介绍Server之前,首先让大家了解下Ubuntu Server,然后全面介绍Ubuntu Server,希望对大家有用。Ubuntu 团队对它的使用者公开的承诺:Ubuntu 永远免费 , 并且对于 "企业版本" 没有任何额外的费用, 在同样的自由团队上,将最好的工作成果带给每一个人。 实验室内部搭建了个网站,放在虚拟机中Ubuntu Server下,需要进行配置以便局域网内都可以访问。虚拟机改成"桥接"模式.(1)Ubuntu Server修改IP打开 /etc/network/interfacessudo vim /etc/networ 阅读全文
posted @ 2011-11-08 08:45 Jonson Li 阅读(266) 评论(0) 推荐(0)