Change hadoop file storage from /u01/hadoop to /hadoop
1. Stop hadoop server and hbase from ONLY node 1
Search script is like the following.
After find the related files. backup then modify all of them
4. Restart hadoop and hbase
- cd /home/hadoop/hbase-0.94.2/bin/
./stop-hbase.sh
cd /home/hadoop/hadoop-1.0.4/bin
./stop-dfs.sh
- su
cd /
mkdir /hadoop
chown hadoop:apache /hadoop
su - hadoop
cd /hadoop
cp -r /u01/hadoop/* .
su
mv /u01/hadoop /u01/hadoop1
Search script is like the following.
- cd /home/hadoop
for i in `find . -name "*.xml" -print`
do
cat $i |grep \/u01 && echo $i
done
After find the related files. backup then modify all of them
- [hadoop@qoda-n1 ~]$ vi ./hadoop-1.0.4/conf/hdfs-site.xml
[hadoop@qoda-n1 ~]$ cp ./hadoop-1.0.4/conf/hdfs-site.xml ./hadoop-1.0.4/conf/hdf-site.xml.053113
[hadoop@qoda-n1 ~]$ cp ./hadoop-1.0.4/conf/mapred-site.xml ./hadoop-1.0.4/conf/mapred-site.xml.053113
[hadoop@qoda-n1 ~]$ cp ./hbase-0.94.2/conf/hbase-site.xml ./hbase-0.94.2/conf/hbase-site.xml.053113
[hadoop@qoda-n1 ~]$ vi ./hadoop-1.0.4/conf/hdfs-site.xml
[hadoop@qoda-n1 ~]$ vi ./hadoop-1.0.4/conf/mapred-site.xml
[hadoop@qoda-n1 ~]$ vi ./hbase-0.94.2/conf/hbase-site.xml
4. Restart hadoop and hbase
- cd /home/hadoop/hadoop-1.0.4/bin
./start-dfs.sh
cd /home/hadoop/hbase-0.94.2/bin/
./start-hbase.sh