diff --git a/cdh4/config_deployer.sh b/cdh4/config_deployer.sh
index 03ce912..a1a0cd4 100755
--- a/cdh4/config_deployer.sh
+++ b/cdh4/config_deployer.sh
@@ -4,15 +4,15 @@
# Data: 2012-09
PASS=$USER #user's login password
-SSH_PORT=22
+SSH_PORT=9922
NODES="
-host1
-host2
-host3
-host4
-host5
+platform30
+platform31
+platform32
+platform33
+platform34
"
# 其它应用的众多服务端口前缀
-PORT_PREFIX=50
+PORT_PREFIX=55
diff --git a/cdh4/download.list.txt b/cdh4/download.list.txt
index da860a6..e69de29 100644
--- a/cdh4/download.list.txt
+++ b/cdh4/download.list.txt
@@ -1,6 +0,0 @@
-http://localhost/c/jdk-7u3-linux-x64.tar.gz
-http://localhost/c/hadoop-2.0.0-cdh4.0.0.tar.gz
-http://localhost/c/hbase-0.92.1-cdh4.0.0.tar.gz
-http://localhost/c/hive-0.8.1-cdh4.0.0.tar.gz
-http://localhost/c/mysql-connector-java-5.1.16-bin.jar
-http://localhost/c/zookeeper-3.4.3-cdh4.0.0.tar.gz
diff --git a/cdh4/install_deployer.sh b/cdh4/install_deployer.sh
index 0e46225..c706b9f 100755
--- a/cdh4/install_deployer.sh
+++ b/cdh4/install_deployer.sh
@@ -47,8 +47,8 @@ cd $DIR
show_head;
-[ -e logs ] || mkdir logs
-[ -e tars ] || mkdir tars
+mkdir -p logs
+mkdir -p tars
[ -f logs/install_deployer_ok ] && { cd $OLD_DIR; die "deployer is installed"; }
diff --git a/cdh4/install_hbase.sh b/cdh4/install_hbase.sh
index 44c77c7..1664fc3 100755
--- a/cdh4/install_hbase.sh
+++ b/cdh4/install_hbase.sh
@@ -38,8 +38,6 @@ deploy()
REGIONSERVERS=\"\$HBASE_CONF_DIR/regionservers\";
BACKUP_MASTERS=\"\$HBASE_CONF_DIR/backup-masters\";
- xml_set \$HBASE hbase.zookeeper.quorum \$HBASE_ZOOKEEPER_QUORUM
-
xml_set \$HBASE hbase.tmp.dir \$HOME/hbase_temp
xml_set \$HBASE hbase.master.port \$HBASE_MASTER_PORT
xml_set \$HBASE hbase.master.info.port \$HBASE_MASTER_INFO_PORT
diff --git a/cdh4/support/PUB.sh b/cdh4/support/PUB.sh
index 22b7e26..bdc187d 100644
--- a/cdh4/support/PUB.sh
+++ b/cdh4/support/PUB.sh
@@ -138,7 +138,7 @@ if [ "$PUB_HEAD_DEF" != "PUB_HEAD_DEF" ]; then
find_tar()
{
#find $D/tars -regex ".*/$1-.*(\.tar)\.gz" -printf "%f\n"
- find $D/tars -regex ".*/$1(\.tar)?\.gz" -printf "%f\n"
+ find $D/tars -regex ".*/$1\(\.tar\)?\.gz" -printf "%f\n"
}
PUB_HEAD_DEF="PUB_HEAD_DEF"
diff --git a/cdh4/support/deploy_hbase_env.sh b/cdh4/support/deploy_hbase_env.sh
index 475d3d1..a3f7a10 100755
--- a/cdh4/support/deploy_hbase_env.sh
+++ b/cdh4/support/deploy_hbase_env.sh
@@ -8,7 +8,7 @@ if [ -z $DEPLOYER_HOME ]; then
fi
. $DEPLOYER_HOME/support/PUB.sh
-HBASE_TAR="hbase-0.92.1-cdh4.0.0.tar.gz"
+HBASE_TAR=`find_tar "hbase-.*-cdh4.*"`
HBASE_VERSION=${HBASE_TAR%.tar.gz} ||:;
##### conf file #####
diff --git a/cdh4/support/deploy_zookeeper_env.sh b/cdh4/support/deploy_zookeeper_env.sh
index b9b5374..3489a2e 100755
--- a/cdh4/support/deploy_zookeeper_env.sh
+++ b/cdh4/support/deploy_zookeeper_env.sh
@@ -9,21 +9,6 @@ fi
. $DEPLOYER_HOME/support/PUB.sh
##### tar package #####
-ZK_TAR=`find_tar "zookeeper.*-cdh4.*"
+ZK_TAR=`find_tar "zookeeper.*-cdh4.*"`
ZK_VERSION=${ZK_TAR%.tar.gz}
-##### conf file #####
-#quorum()
-#{
-# local OLD_IFS="$IFS"
-# IFS="
-# "
-# local arr=($DN)
-# IFS=$OLD_IFS
-# local tmp=${arr[@]::5}
-# tmp=`echo $tmp`
-# tmp=${tmp// /,}
-# HBASE_ZOOKEEPER_QUORUM=$tmp
-#}
-#quorum
-
diff --git a/cdh4/support/hadoop_conf/hdfs-site.xml b/cdh4/support/hadoop_conf/hdfs-site.xml
index 3b0a0e1..6cb5c16 100644
--- a/cdh4/support/hadoop_conf/hdfs-site.xml
+++ b/cdh4/support/hadoop_conf/hdfs-site.xml
@@ -178,5 +178,10 @@
dfs.namenode.num.extra.edits.retained
2200
+
+
+ dfs.datanode.du.reserved
+ 1024000000
+
diff --git a/cdh4/support/profile_hbase.sh b/cdh4/support/profile_hbase.sh
index 7fba2dc..05a5e59 100644
--- a/cdh4/support/profile_hbase.sh
+++ b/cdh4/support/profile_hbase.sh
@@ -10,7 +10,7 @@ HBFLAG="# hbase profile - uc.cn"
profile()
{
- if ! grep -q "#HBFLAG" $BAPF; then
+ if ! grep -q "$HBFLAG" $BAPF; then
echo "$HBFLAG" >> $BAPF;
echo "if [ -f $HBPF ]; then" >> $BAPF;
echo " . $HBPF;" >> $BAPF;
@@ -19,13 +19,14 @@ profile()
fi
echo "$HBFLAG
-
export HBASE_HOME=\$HOME/hbase
export HBASE_BIN=\$HBASE_HOME/bin
export HBASE_CONF_DIR=\$HBASE_HOME/conf
export PATH=\$HBASE_BIN:\$PATH
+ alias cchb='cd \$HBASE_HOME'
+ alias cchbf='cd \$HBASE_CONF_DIR'
" > $HBPF
}
diff --git a/cdh4/support/profile_hive.sh b/cdh4/support/profile_hive.sh
index 073854e..055ed9b 100644
--- a/cdh4/support/profile_hive.sh
+++ b/cdh4/support/profile_hive.sh
@@ -1,36 +1,39 @@
#!/usr/bin/env bash
# coding=utf-8
# Author: zhaigy@ucweb.com
-# Data: 2012-09
+# Data: 2012-11
BAPF="$HOME/.bash_profile"
HIPF="$HOME/.hive_profile"
-if [ ! -e $BAPF ]; then
- touch $BAPF;
-fi
-
-if ! grep -q "hive profile" $BAPF; then
- echo "" >> $BAPF;
- echo "#" >> $BAPF;
- echo "# hive profile" >> $BAPF;
- echo "#" >> $BAPF;
- echo "if [ -f $HIPF ]; then" >> $BAPF;
- echo " . $HIPF" >> $BAPF;
- echo "fi" >> $BAPF;
- echo "#END#" >> $BAPF;
-fi
-
-echo "# Hive profile
-
-export HIVE_HOME=\$HOME/hive
-export HIVE_BIN=\$HIVE_HOME/bin
-export HIVE_CONF_DIR=\$HIVE_HOME/conf
-
-export PATH=\$HIVE_BIN:\$PATH
-
-alias cch='cd \$HIVE_HOME'
-alias cchf='cd \$HIVE_CONF'
-" > $HIPF
-
-. $HIPF
+HIFLAG="# hive profile - uc.cn"
+
+profile()
+{
+ if ! grep -q "$HIFLAG" $BAPF; then
+ echo "" >> $BAPF;
+ echo "$HIFLAG" >> $BAPF;
+ echo "if [ -f $HIPF ]; then" >> $BAPF;
+ echo " . $HIPF;" >> $BAPF;
+ echo "fi" >> $BAPF;
+ echo "#END#" >> $BAPF;
+ fi
+
+ echo "$HIFLAG
+ export HIVE_HOME=\$HOME/hive
+ export HIVE_BIN=\$HIVE_HOME/bin
+ export HIVE_CONF_DIR=\$HIVE_HOME/conf
+
+ export PATH=\$HIVE_BIN:\$PATH
+
+ alias cchi='cd \$HIVE_HOME'
+ alias cchif='cd \$HIVE_CONF_DIR'
+ " > $HIPF
+}
+
+unprofile()
+{
+ rm -f $HIPF
+ cp $BAPF "$BAPF.$NOW8_6"
+ sed -i "/$HIFLAG/,/#END#/d" $BAPF
+}
diff --git a/cdh4/support/tarme.sh b/cdh4/support/tarme.sh
index cf92550..d78a922 100644
--- a/cdh4/support/tarme.sh
+++ b/cdh4/support/tarme.sh
@@ -4,4 +4,4 @@
# Data: 2012-09
TAR=hadoop-deployer.tar.gz
rm -rf ./$TAR
-tar -czvf $TAR ./ --exclude .git --exclude tars --exclude logs --exclude $TAR
+tar -czvf $TAR ../ --exclude .git --exclude tars --exclude logs --exclude $TAR
diff --git a/cdh4/support/xml_hadoop.sh b/cdh4/support/xml_hadoop.sh
index e8d9fc8..c112f3c 100644
--- a/cdh4/support/xml_hadoop.sh
+++ b/cdh4/support/xml_hadoop.sh
@@ -24,7 +24,7 @@ conf_hadoop()
xml_set $CORE hadoop.tmp.dir $HADOOP_TMP_DIR
quorum=""
for s in $ZK_NODES; do
- if [ $quorum == "" ]; then
+ if [ "$quorum" == "" ]; then
quorum="$s:${ZK_PORT_PREFIX}181"
else
quorum="$quorum,$s:${ZK_PORT_PREFIX}181"
@@ -68,8 +68,8 @@ conf_hadoop()
echo $dn >> $HADOOP_CONF_DIR/slaves;
done;
- mkdir $HOME/hadoop_name
- mkdir $HOME/hadoop_ha_edit
+ mkdir -p $HOME/hadoop_name
+ mkdir -p $HOME/hadoop_ha_edit
}
main()