[hadoop@lab02 ~]$ uname -a
Linux lab02 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[hadoop@lab02 ~]$ hadoop dfsadmin -upgradeProgress status
There are no upgrades in progress.
备份相关信息
hadoop fs -lsr / > namenode_lsr.log
hadoop fsck / > namenode_fsck.log
nohup rsync -av filesystem/ ../hadoop_upgrade/filesystem/ &
分发软件
[hadoop@lab02 opdir]$ cat sync_hadoop_main.sh
#!/bin/bash
HOSTS="lab03 lab04 lab05 lab06 lab07 lab08 lab09 lab10 lab11 lab12 lab13"
cd /home/hadoop/hadoop-installed && rm hadoop && ln -s hadoop-0.20.2-cdh3u4 hadoop && chown hadoop.hadoop hadoop
for host in $HOSTS
do
echo rsync -av /home/hadoop/hadoop-installed/hadoop-1.2.1/ $host:/home/hadoop/hadoop-installed/hadoop-1.2.1/
rsync -av /home/hadoop/hadoop-installed/hadoop-1.2.1/ $host:/home/hadoop/hadoop-installed/hadoop-1.2.1/
done
cd /home/hadoop/hadoop-installed && rm -f hadoop && ln -s hadoop-1.2.1 hadoop
cd /home/hadoop/hadoop-installed/hadoop-1.2.1/contrib/streaming && ln -s hadoop-streaming-1.2.1.jar hadoop-streaming.jar
stop-all.sh
start-dfs.sh -upgrade
ssck -f allhost.lab -u root "cd /home/hadoop/hadoop-installed && rm hadoop && ln -s hadoop-0.20.2-cdh3u4 hadoop && chown hadoop.hadoop hadoop"
ssck -f allhost.lab -u root "cd /home/hadoop/hadoop-installed && rm hadoop && ln -s hadoop-1.2.1 hadoop && chown hadoop.hadoop hadoop"
ssck -f allhost.lab -u root "chmod 755 /home/hadoop/hadoop-installed/filesystem/dfs/data"
参考链接
http://dongxicheng.org/mapreduce-nextgen/hadoop-upgrade-in-version-1/
http://blog.pureisle.net/archives/1845.html