trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sand...@apache.org
Subject [11/13] incubator-trafodion git commit: Update traf_config_check
Date Tue, 19 Jul 2016 16:09:24 GMT
Update traf_config_check

add hbase_distro to trafodion_config

Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/0a5a0b87
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/0a5a0b87
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/0a5a0b87

Branch: refs/heads/master
Commit: 0a5a0b8778a3d468345dac57a805f319cc9249b1
Parents: a0fd11e
Author: mashengchen <mashengchen@gmail.com>
Authored: Mon Jul 18 19:00:03 2016 +0800
Committer: GitHub <noreply@github.com>
Committed: Mon Jul 18 19:00:03 2016 +0800

----------------------------------------------------------------------
 install/installer/traf_config_check | 35 ++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0a5a0b87/install/installer/traf_config_check
----------------------------------------------------------------------
diff --git a/install/installer/traf_config_check b/install/installer/traf_config_check
index 3cadaca..c7da156 100755
--- a/install/installer/traf_config_check
+++ b/install/installer/traf_config_check
@@ -623,7 +623,15 @@ source $TRAF_CONFIG
 
 function setHBaseDistro {
 
-export HBASE_DISTRO="APACHE" 
+if [[ $HADOOP_TYPE == "apache" ]]; then
+   HBASE_DISTRO="APACHE"$APACHE_VERSION
+elif [[ $HADOOP_TYPE == "hortonworks" ]]; then
+   HBASE_DISTRO="HDP"$HDP_VERSION
+elif [[ $HADOOP_TYPE == "cloudera" ]]; then
+   HBASE_DISTRO="CDH"$CDH_VERSION
+fi
+
+export HBASE_DISTRO 
 
 sudo chmod 777 $TRAF_CONFIG
 sed -i '/HBASE_DISTRO\=/d' $TRAF_CONFIG
@@ -703,7 +711,9 @@ function checkRoleGroups {
 
 
 function checkClouderaVersion {
-
+cdhVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | grep -o "cdh[0-9]\.[0-9]")
+#get cdh version,eg:5.5 or 5.7
+CDH_VERSION=${cdhVersion:3:5}
 if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
    #Check that Cloudera 5.2 or 5.3 are not installed.
    if [[ "$CDH_5_4_SUPPORT" == "Y" ]] || [[ "$CDH_5_5_SUPPORT" == "Y" ]]; then
@@ -745,18 +755,22 @@ else
    fi
 fi
 
-baseVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk
{'print$2'})
+hbaseVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk
{'print$2'})
 
 echo "***INFO: nameOfVersion=$nameOfVersion"
 sudo chmod 777 $TRAF_CONFIG
 sed -i '/hbaseVersion\=/d' $TRAF_CONFIG
 echo "export hbaseVersion=\"$hbaseVersion\"" >> $TRAF_CONFIG
+sed -i '/CDH_VERSION\=/d' $TRAF_CONFIG
+echo "export CDH_VERSION=\"$CDH_VERSION\"" >> $TRAF_CONFIG
 source $TRAF_CONFIG
 
 }
 
 function checkHDPVersion {
- 
+version=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk {'print$2'})
+#get hdp version,eg:2.1 or 2.3
+HDP_VERSION=${version:6:3}
 if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
    if [[ $HDP_2_3_SUPPORT == "N" ]]; then
       #Check that Hortonworks 2.2 is not installed
@@ -809,7 +823,7 @@ if [[ -z $nameOfVersion ]]; then
    fi
 fi
 
-baseVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk
{'print$2'})
+hbaseVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk
{'print$2'})
 
 echo "***INFO: nameOfVersion=$nameOfVersion"
 echo "***INFO: HADOOP_PATH=$HADOOP_PATH"
@@ -817,12 +831,15 @@ echo "***INFO: HADOOP_PATH=$HADOOP_PATH"
 sudo chmod 777 $TRAF_CONFIG
 sed -i '/hbaseVersion\=/d' $TRAF_CONFIG
 echo "export hbaseVersion=\"$hbaseVersion\"" >> $TRAF_CONFIG
+sed -i '/HDP_VERSION\=/d' $TRAF_CONFIG
+echo "export HDP_VERSION=\"$HDP_VERSION\"" >> $TRAF_CONFIG
 source $TRAF_CONFIG
 
 }
 
 function checkApacheVersion {
-
+version=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | awk {'print $2'})
+APACHE_VERSION=${version:0:3}
 if [[ $APACHE_1_0_X_SUPPORT=="Y" || $APACHE_1_1_X_SUPPORT=="Y" ]]; then
    nameOfVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | awk {'print $2'})
    #Check that hbase 1.x.x is not installed.
@@ -838,12 +855,14 @@ if [[ $APACHE_1_0_X_SUPPORT=="Y" || $APACHE_1_1_X_SUPPORT=="Y" ]]; then
    fi
 fi
 
-baseVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk
{'print$2'}|sed s/,//g)
+hbaseVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk
{'print$2'}|sed s/,//g)
 
 echo "***INFO: nameOfVersion=$nameOfVersion"
 sudo chmod 777 $TRAF_CONFIG
 sed -i '/hbaseVersion\=/d' $TRAF_CONFIG
 echo "export hbaseVersion=\"$hbaseVersion\"" >> $TRAF_CONFIG
+sed -i '/APACHE_VERSION\=/d' $TRAF_CONFIG
+echo "export APACHE_VERSION=\"$APACHE_VERSION\"" >> $TRAF_CONFIG
 source $TRAF_CONFIG
 
 }
@@ -1088,8 +1107,8 @@ fi
 
 if [[ "$HADOOP_TYPE" == "apache" ]]; then
    setPath
-   setHBaseDistro
 fi
+setHBaseDistro
 
 getHadoopNodes
 


Mime
View raw message