Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hadoop-deployer committed Nov 27, 2012
1 parent 7d995c8 commit ed6d7b6
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 70 deletions.
14 changes: 7 additions & 7 deletions cdh4/config_deployer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions cdh4/download.list.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions cdh4/install_deployer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"; }

Expand Down
2 changes: 0 additions & 2 deletions cdh4/install_hbase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cdh4/support/PUB.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cdh4/support/deploy_hbase_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 #####
Expand Down
17 changes: 1 addition & 16 deletions cdh4/support/deploy_zookeeper_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions cdh4/support/hadoop_conf/hdfs-site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,10 @@
<name>dfs.namenode.num.extra.edits.retained</name>
<value>2200</value>
</property>

<property>
<name>dfs.datanode.du.reserved</name>
<value>1024000000</value>
</property>

</configuration>
5 changes: 3 additions & 2 deletions cdh4/support/profile_hbase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
}

Expand Down
61 changes: 32 additions & 29 deletions cdh4/support/profile_hive.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
#!/usr/bin/env bash
# coding=utf-8
# Author: [email protected]
# 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
}
2 changes: 1 addition & 1 deletion cdh4/support/tarme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions cdh4/support/xml_hadoop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit ed6d7b6

Please sign in to comment.