Rework
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/95d82f94 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/95d82f94 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/95d82f94 Branch: refs/heads/master Commit: 95d82f947f1c020db3f37f796adc607997a5038e Parents: 8aea73a Author: Amanda Moran <[email protected]> Authored: Wed Jan 27 22:42:44 2016 +0000 Committer: Amanda Moran <[email protected]> Committed: Wed Jan 27 22:42:44 2016 +0000 ---------------------------------------------------------------------- core/sqf/sql/scripts/sqgen | 11 ++-- install/installer/cloud_cli_setup | 7 --- install/installer/dcs_installer | 8 --- install/installer/traf_add_sudoAccess | 9 ---- install/installer/traf_add_user | 14 ----- install/installer/traf_cloudera_mods98 | 54 ++++++------------- install/installer/traf_config | 2 +- install/installer/traf_config_check | 72 ++++++++++++++++---------- install/installer/traf_config_setup | 53 +++++++++++-------- install/installer/traf_hortonworks_mods98 | 41 +++++++-------- install/installer/traf_package_setup | 9 ---- install/installer/traf_setup | 11 ---- install/installer/traf_sqgen | 2 + install/installer/traf_start | 6 --- install/installer/traf_user_prompt | 28 ++++++++++ install/installer/traf_user_prompt_check | 27 ++++++++++ install/installer/trafodion_install | 47 +++++++---------- install/installer/trafodion_uninstaller | 13 ----- 18 files changed, 193 insertions(+), 221 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/core/sqf/sql/scripts/sqgen ---------------------------------------------------------------------- diff --git a/core/sqf/sql/scripts/sqgen b/core/sqf/sql/scripts/sqgen index 6258fde..1b11f4f 100755 --- a/core/sqf/sql/scripts/sqgen +++ b/core/sqf/sql/scripts/sqgen @@ -118,7 +118,7 @@ fi cd $MY_SQROOT/sql/scripts # Check to make sure this is a real cluster -if [ -f $SQ_PDSH ]; then +if [ "$node_count" -gt "1" ]; then GetSQcnfg @@ -148,7 +148,7 @@ mkdir -p $MPI_TMPDIR mkdir -p $HOME/cbfs #If pdsh exists -if [ -e $SQ_PDSH ]; then +if [ $node_count -gt "1" ]; then echo echo "Creating directories on cluster nodes" @@ -225,7 +225,7 @@ if [ -f $SQESPENV_FILE ]; then fi fi -if [ -e $SQ_PDCP ]; then +if [ $node_count -gt "1" ]; then echo echo "Copying the generated files to all the nodes in the cluster" echo @@ -256,9 +256,8 @@ if [ -e $SQ_PDCP ]; then echo echo "Copying rest of the generated files to $PWD" - echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold gomon.warm $PWD " - $PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold gomon.warm $PWD - + echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold gomon.warm rmsstart rmsstop rmscheck.sql ssmpstart ssmpstop sscpstart sscpstop $PWD" + $PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold gomon.warm rmsstart rmsstop rmscheck.sql ssmpstart ssmpstop sscpstart sscpstop $PWD echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE sqconfig.db $PWD " $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE sqconfig.db $PWD http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/cloud_cli_setup ---------------------------------------------------------------------- diff --git a/install/installer/cloud_cli_setup b/install/installer/cloud_cli_setup index aac0cd3..eb39b41 100755 --- a/install/installer/cloud_cli_setup +++ b/install/installer/cloud_cli_setup @@ -26,13 +26,6 @@ TRAF_CONFIG=/etc/trafodion/trafodion_config source $TRAF_CONFIG -if [ $node_count -eq 1 ]; then - exit 0 -else - TRAF_PDSH="pdsh $MY_NODES" - TRAF_PDCP="pdcp -r $MY_NODES" -fi - ###### Setting up CLI for AWS as sudo id if [[ ! -z $AWS_CLOUD ]]; then http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/dcs_installer ---------------------------------------------------------------------- diff --git a/install/installer/dcs_installer b/install/installer/dcs_installer index c959b16..5d71aab 100755 --- a/install/installer/dcs_installer +++ b/install/installer/dcs_installer @@ -27,14 +27,6 @@ export TRAF_CONFIG="/etc/trafodion/trafodion_config" -if [ $all_node_count -eq 1 ]; then - TRAF_PDSH="" - TRAF_PDCP="" -else - TRAF_PDSH="pdsh -R exec $ALL_NODES $PDSH_SSH_CMD" - TRAF_PDCP="pdcp -R ssh $ALL_NODES" -fi - function print_usage { cat << EOF This script will install/configure the specified DCS build. http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_add_sudoAccess ---------------------------------------------------------------------- diff --git a/install/installer/traf_add_sudoAccess b/install/installer/traf_add_sudoAccess index 93b4dc8..303cc1e 100755 --- a/install/installer/traf_add_sudoAccess +++ b/install/installer/traf_add_sudoAccess @@ -23,15 +23,6 @@ TRAF_CONFIG=/etc/trafodion/trafodion_config source $TRAF_CONFIG -if [ $all_node_count -eq 1 ]; then - TRAF_PDSH="" - TRAF_PDCP="" -else - TRAF_PDSH="pdsh -R exec $ALL_NODES $PDSH_SSH_CMD" - TRAF_PDCP="pdcp -R ssh $ALL_NODES" -fi - - sudoFile="trafodion" echo "***INFO: Creating $TRAF_USER sudo access file" echo http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_add_user ---------------------------------------------------------------------- diff --git a/install/installer/traf_add_user b/install/installer/traf_add_user index 8afbc78..a145255 100755 --- a/install/installer/traf_add_user +++ b/install/installer/traf_add_user @@ -55,16 +55,6 @@ if [ $? -ne 0 ]; then exit -1 fi -if [ $all_node_count -eq 1 ]; then - TRAF_PDSH="" - TRAF_PDCP="" -else - # use the -S option to cause pdsh to return largest of - # the remote command return values so we can tell if one - # or more of the remote commands failed - TRAF_PDSH="pdsh -R exec $ALL_NODES ssh -q -n %h" - TRAF_PDCP="pdcp -R ssh $ALL_NODES" -fi #============================== # Find an unused uid and gid on all nodes for the Trafodion userid. # Need to make sure the uid and gid are free on all nodes in the cluster, @@ -148,10 +138,6 @@ if [ $return_code -ne 0 ]; then fi fi -$TRAF_PDSH sudo chmod 777 $TRAF_CONFIG -$TRAF_PDSH sudo sed -i '/TRAF_USER_PASSWORD\=/d' $TRAF_CONFIG -$TRAF_PDSH sudo chmod 777 $TRAF_CONFIG - #================================================= # Setup passwordless ssh for this Trafodion userid http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_cloudera_mods98 ---------------------------------------------------------------------- diff --git a/install/installer/traf_cloudera_mods98 b/install/installer/traf_cloudera_mods98 index b112413..ffb5354 100755 --- a/install/installer/traf_cloudera_mods98 +++ b/install/installer/traf_cloudera_mods98 @@ -31,6 +31,8 @@ source $TRAF_CONFIG export PDSH="pdsh -R exec" export PDSH_SSH_CMD="ssh -q -n %h" export PDCP="pdcp -R ssh" +export PDSH_HADOOP_NODES="$PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD" +export PDCP_HADOOP_NODES="$PDCP $MY_HADOOP_NODES" #===================================== # copy Trafodion trx jar to Cloudera's plugins directory on all nodes @@ -72,23 +74,23 @@ fi echo "***INFO: copying $hbase_trx_jar to all nodes" if [ $node_count -ne 1 ]; then - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf $HADOOP_PATH/hbase-trx* 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf /usr/lib/hbase/lib/hbase-trx* 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf /usr/share/cmf/lib/plugins/hbase-trx* 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf /usr/lib/hbase/lib/trafodion* 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf /usr/share/cmf/lib/plugins/trafodion* 2>/dev/null - $PDSH $MY_NODES $PDSH_SSH_CMD mkdir -p $LOCAL_WORKDIR 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD mkdir -p $LOCAL_WORKDIR 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf $HADOOP_PATH/hbase-trx* 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf /usr/lib/hbase/lib/hbase-trx* 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf /usr/share/cmf/lib/plugins/hbase-trx* 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf /usr/lib/hbase/lib/trafodion* 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf /usr/share/cmf/lib/plugins/trafodion* 2>/dev/null + $TRAF_PDSH mkdir -p $LOCAL_WORKDIR 2>/dev/null + $PDSH_HADOOP_NODES mkdir -p $LOCAL_WORKDIR 2>/dev/null cp $UNTAR_DIR/export/lib/$hbase_trx_jar $LOCAL_WORKDIR cp $UNTAR_DIR/export/lib/$traf_util_jar $LOCAL_WORKDIR - $PDCP $MY_HADOOP_NODES $LOCAL_WORKDIR/$hbase_trx_jar $LOCAL_WORKDIR - $PDCP $MY_HADOOP_NODES $LOCAL_WORKDIR/$traf_util_jar $LOCAL_WORKDIR - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo cp $LOCAL_WORKDIR/$hbase_trx_jar $HADOOP_PATH - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo cp $LOCAL_WORKDIR/$traf_util_jar $HADOOP_PATH - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo chmod 644 $HADOOP_PATH/$hbase_trx_jar - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo chmod 644 $HADOOP_PATH/$traf_util_jar - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD rm $LOCAL_WORKDIR/$hbase_trx_jar 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD rm $LOCAL_WORKDIR/$traf_util_jar 2>/dev/null + $PDCP_HADOOP_NODES $LOCAL_WORKDIR/$hbase_trx_jar $LOCAL_WORKDIR + $PDCP_HADOOP_NODES $LOCAL_WORKDIR/$traf_util_jar $LOCAL_WORKDIR + $PDSH_HADOOP_NODES sudo cp $LOCAL_WORKDIR/$hbase_trx_jar $HADOOP_PATH + $PDSH_HADOOP_NODES sudo cp $LOCAL_WORKDIR/$traf_util_jar $HADOOP_PATH + $PDSH_HADOOP_NODES sudo chmod 644 $HADOOP_PATH/$hbase_trx_jar + $PDSH_HADOOP_NODES sudo chmod 644 $HADOOP_PATH/$traf_util_jar + $PDSH_HADOOP_NODES rm $LOCAL_WORKDIR/$hbase_trx_jar 2>/dev/null + $PDSH_HADOOP_NODES rm $LOCAL_WORKDIR/$traf_util_jar 2>/dev/null else for node in $HADOOP_NODES do @@ -358,28 +360,6 @@ if [ $? != 0 ]; then echo "***ERROR: ($HADOOP_BIN_PATH/hdfs dfs -setfacl -R -m mask::rwx /hbase/archive) command failed" exit -1 fi -sudo su hdfs --command "$HADOOP_BIN_PATH/hdfs dfs -mkdir -p /hbase/archive/data" -if [ $? != 0 ]; then - echo "***ERROR: ($HADOOP_BIN_PATH/hdfs dfs -mkdir -p /hbase/archive/data) command failed" - exit -1 -fi -sudo su hdfs --command "$HADOOP_BIN_PATH/hdfs dfs -chown hbase:hbase /hbase/archive/data" -if [ $? != 0 ]; then - echo "***ERROR: ($HADOOP_BIN_PATH/hdfs dfs -chown hbase:hbase /hbase/archive/data) command failed" - exit -1 -fi - -sudo su hdfs --command "$HADOOP_BIN_PATH/hdfs dfs -mkdir -p /hbase/archive/data/default" -if [ $? != 0 ]; then - echo "***ERROR: ($HADOOP_BIN_PATH/hdfs dfs -mkdir -p /hbase/archive/data) command failed" - exit -1 -fi -sudo su hdfs --command "$HADOOP_BIN_PATH/hdfs dfs -chown hbase:hbase /hbase/archive/data/default" -if [ $? != 0 ]; then - echo "***ERROR: ($HADOOP_BIN_PATH/hdfs dfs -chown hbase:hbase /hbase/archive/data) command failed" - exit -1 -fi - MODS_COMPLETE="Y" sudo chmod 777 $TRAF_CONFIG http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_config ---------------------------------------------------------------------- diff --git a/install/installer/traf_config b/install/installer/traf_config index be4cc1f..7bffc03 100755 --- a/install/installer/traf_config +++ b/install/installer/traf_config @@ -176,7 +176,7 @@ fi #========================================== -if [ "$all_node_count" -ne "1" ]; then +if [ "$node_count" -ne "1" ]; then echo "***INFO: copying sqconfig file ($SQCONFIG_MASTER) to $SQ_ROOT/sql/scripts/sqconfig" | tee -a $INSTALL_LOG cp $SQCONFIG_MASTER $SQ_ROOT/sql/scripts/sqconfig fi http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_config_check ---------------------------------------------------------------------- diff --git a/install/installer/traf_config_check b/install/installer/traf_config_check index d7bbee4..65dcd5d 100755 --- a/install/installer/traf_config_check +++ b/install/installer/traf_config_check @@ -211,35 +211,28 @@ else echo "export MY_NODES=\"$MY_NODES\"" >> $TRAF_CONFIG sudo chmod 777 $TRAF_CONFIG - if [ $node_count -eq 1 ]; then - TRAF_PDSH="" - echo "export TRAF_PDSH=\"\"" >> $TRAF_CONFIG - else - TRAF_PDSH="pdsh -S $MY_NODES" - echo "export TRAF_PDSH=\"$TRAF_PDSH\"" >> $TRAF_CONFIG - fi fi source $TRAF_CONFIG } function checkManageNodeList { -if [[ -z $MANAGE_NODES ]]; then +if [[ -z $MANAGEMENT_NODES ]]; then errorFound=1 - echo "MANAGE NODE LIST" >> $ERROR_LOG - echo "***ERROR: MANAGE_NODES variable not set in config file." >> $ERROR_LOG + echo "MANAGEMENT NODE LIST" >> $ERROR_LOG + echo "***ERROR: MANAGEMENT_NODES variable not set in config file." >> $ERROR_LOG else ERROR_NODES="" NODES="" - for node in $MANAGE_NODES + for node in $MANAGEMENT_NODES do newNode=$(ssh -q -n $node hostname) if [[ $? -ne "0" ]]; then errorFound=1 - echo "MANAGE NODE LIST" >> $ERROR_LOG + echo "MANAGEMENT NODE LIST" >> $ERROR_LOG echo "***ERROR: Could not ssh to $node." >> $ERROR_LOG echo "***ERROR: Please check node names for typos" >> $ERROR_LOG majorErrorFound @@ -249,14 +242,14 @@ else if [[ "$nodeName" != "$newNode" ]]; then errorFound=1 - echo "MANAGE NODE LIST" >> $ERROR_LOG + echo "MANAGEMENT NODE LIST" >> $ERROR_LOG echo "***ERROR: Nodes are not named properly." >> $ERROR_LOG echo "***ERROR: Nodes can have no special characters other than '-' and '.'" >> $ERROR_LOG fi if [[ "$newNode" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then errorFound=1 - echo "MANAGE NODE LIST" >> $ERROR_LOG + echo "MANAGEMENT NODE LIST" >> $ERROR_LOG echo "***ERROR: Nodes are not named properly." >> $ERROR_LOG echo "***ERROR: IP addresses are not supported. Please use node names." >> $ERROR_LOG fi @@ -273,13 +266,13 @@ else NODE_LIST=$NODES if [[ $error == "1" ]]; then errorFound=1 - echo "MANAGE NODE LIST" >> $ERROR_LOG + echo "MANAGEMENT NODE LIST" >> $ERROR_LOG echo "***ERROR: $ERROR_NODES does not have sudo access." >> $ERROR_LOG echo "***ERROR: Must have sudo access on all nodes." >> $ERROR_LOG fi - for node in $MANAGE_NODES + for node in $MANAGEMENT_NODES do ssh -q -n $node echo "***INFO: Testing ssh on $node" if [[ $? -ne "0" ]]; then @@ -297,11 +290,11 @@ else sudo chmod 777 $TRAF_CONFIG - sed -i '/MANAGE_NODES\=/d' $TRAF_CONFIG - echo "export MANAGE_NODES=\"$MANAGE_NODES\"" >> $TRAF_CONFIG + sed -i '/MANAGEMENT_NODES\=/d' $TRAF_CONFIG + echo "export MANAGEMENT_NODES=\"$MANAGEMENT_NODES\"" >> $TRAF_CONFIG sudo chmod 777 $TRAF_CONFIG - manage_node_count=$(echo $MANAGE_NODES | wc -w) + manage_node_count=$(echo $MANAGEMENT_NODES | wc -w) sudo chmod 777 $TRAF_CONFIG sed -i '/manage_node_count\=/d' $TRAF_CONFIG @@ -309,16 +302,16 @@ else sudo chmod 777 $TRAF_CONFIG - MY_MANAGE_NODES="" + MY_MANAGEMENT_NODES="" - for node in $MANAGE_NODES + for node in $MANAGEMENT_NODES do - MY_MANAGE_NODES="$MY_MANAGE_NODES -w $node" + MY_MANAGEMENT_NODES="$MY_MANAGEMENT_NODES -w $node" done sudo chmod 777 $TRAF_CONFIG - sed -i '/MY_MANAGE_NODES\=/d' $TRAF_CONFIG - echo "export MY_MANAGE_NODES=\"$MY_MANAGE_NODES\"" >> $TRAF_CONFIG + sed -i '/MY_MANAGEMENT_NODES\=/d' $TRAF_CONFIG + echo "export MY_MANAGEMENT_NODES=\"$MY_MANAGEMENT_NODES\"" >> $TRAF_CONFIG sudo chmod 777 $TRAF_CONFIG fi @@ -327,7 +320,7 @@ source $TRAF_CONFIG function createAllNodes { -ALL_NODE_LIST="$NODE_LIST $MANAGE_NODES" +ALL_NODE_LIST="$NODE_LIST $MANAGEMENT_NODES" sudo chmod 777 $TRAF_CONFIG sed -i '/ALL_NODE_LIST\=/d' $TRAF_CONFIG @@ -341,7 +334,7 @@ sed -i '/all_node_count\=/d' $TRAF_CONFIG echo "export all_node_count=\"$all_node_count\"" >> $TRAF_CONFIG sudo chmod 777 $TRAF_CONFIG -ALL_NODES="$MY_MANAGE_NODES $MY_NODES" +ALL_NODES="$MY_MANAGEMENT_NODES $MY_NODES" sudo chmod 777 $TRAF_CONFIG sed -i '/ALL_NODES\=/d' $TRAF_CONFIG @@ -350,6 +343,29 @@ sudo chmod 777 $TRAF_CONFIG } +function createPDSH { + +source $TRAF_CONFIG +export PDSH_SSH_CMD="ssh -q -n %h" + +if [ $all_node_count -eq 1 ]; then + TRAF_PDSH="" + TRAF_PDCP="" +else + TRAF_PDSH="pdsh -R exec $ALL_NODES $PDSH_SSH_CMD" + TRAF_PDCP="pdcp -R ssh $ALL_NODES" +fi + +sudo chmod 777 $TRAF_CONFIG +sed -i '/TRAF_PDSH\=/d' $TRAF_CONFIG +echo "export TRAF_PDSH=\"$TRAF_PDSH\"" >> $TRAF_CONFIG +sed -i '/TRAF_PDCP\=/d' $TRAF_CONFIG +echo "export TRAF_PDCP=\"$TRAF_PDCP\"" >> $TRAF_CONFIG +sudo chmod 777 $TRAF_CONFIG + + +} + function checkJavaVersion { if [[ -z "$JAVA_HOME" ]]; then errorFound=1 @@ -896,12 +912,14 @@ checkTrafPassword checkNodeList -if [[ $MANAGE_ENABLED == "Y" ]]; then +if [[ $MANAGEMENT_ENABLED == "Y" ]]; then checkManageNodeList fi createAllNodes +createPDSH + checkJavaVersion checkHomeDir http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_config_setup ---------------------------------------------------------------------- diff --git a/install/installer/traf_config_setup b/install/installer/traf_config_setup index e67958c..08ec83e 100755 --- a/install/installer/traf_config_setup +++ b/install/installer/traf_config_setup @@ -69,7 +69,8 @@ CLOUD_TYPE="" AWS_CLOUD="" OPEN_STACK="" OTHER_CLOUD="" - +MANAGEMENT_ENABLED="N" +MANAGEMENT_NODES="" LDAP_LEVEL="0" #============================================== @@ -215,7 +216,7 @@ fi #============================================== # List of Nodes -echo -n "Enter list of Trafodion nodes (blank separated), default [$NODE_LIST]: " +echo -n "Enter list of data nodes (blank separated), default [$NODE_LIST]: " read answer if [[ -z "$answer" ]]; then if [ -z "$NODE_LIST" ]; then @@ -230,30 +231,26 @@ echo "export NODE_LIST=\"$NODE_LIST\"" >> $LOCAL_TRAF_CONFIG node_count=$(echo $NODE_LIST | wc -w) #============================================== -echo -n "Are management nodes enabled (Y/N), default is N: " +echo -n "Do you have a set of management nodes (Y/N), default is N: " read answer -if [ -z $answer ]; then - echo "export MANAGE_ENABLED=\"N\"" >> $LOCAL_TRAF_CONFIG -else - if [[ "${answer}" =~ ^[Yy]$ ]]; then - echo "export MANAGE_ENABLED=\"Y\"" >> $LOCAL_TRAF_CONFIG - #List of Management Nodes - echo -n "Enter list management nodes (blank separated), default [$MANAGE_NODES]: " - read answer - if [[ -z "$answer" ]]; then - if [ -z "$MANAGE_NODES" ]; then - echo "***ERROR: Must enter list of management nodes." - exit -1 - fi - else - MANAGE_NODES="$answer" - fi - echo "export MANAGE_NODES=\"$MANAGE_NODES\"" >> $LOCAL_TRAF_CONFIG - else - echo "export MANAGE_ENABLED=\"N\"" >> $LOCAL_TRAF_CONFIG +if [[ "${answer}" =~ ^[Yy]$ ]]; then + echo "export MANAGEMENT_ENABLED=\"Y\"" >> $LOCAL_TRAF_CONFIG + #List of Management Nodes + echo -n "Enter list management nodes (blank separated), default [$MANAGEMENT_NODES]: " + read answer + if [[ -z "$answer" ]]; then + if [ -z "$MANAGEMENT_NODES" ]; then + echo "***ERROR: Management nodes must be specified." + exit -1 fi + else + MANAGEMENT_NODES="$answer" + echo "export MANAGEMENT_NODES=\"$MANAGEMENT_NODES\"" >> $LOCAL_TRAF_CONFIG + fi +else + echo "export MANAGEMENT_ENABLED=\"N\"" >> $LOCAL_TRAF_CONFIG fi #============================================== @@ -576,6 +573,7 @@ echo "export ENABLE_HA=\"$ENABLE_HA\"" >> $LOCAL_TRAF_CONFIG #============================================== #Add Floating IP if HA Enabled if [[ "$ENABLE_HA" == "true" ]]; then + #Get the floating IP address, interface name and the list of backup nodes to be used ######Get the floating IP address echo -n "Enter floating IP address for setting up HA: " read answer1 @@ -708,7 +706,7 @@ if [[ $SCANNER_MODE == "N" ]]; then read answer4 if [[ -z "$answer4" ]]; then if [ -z "$LDAP_LEVEL" ]; then - echo "***ERROR: Much enter LDAP Encryption level." + echo "***ERROR: Must enter LDAP Encryption level." exit -1 fi else @@ -768,6 +766,7 @@ if [[ $SCANNER_MODE == "N" ]]; then fi fi + #============================================== #All items added to config file #Will add setup complete flag @@ -782,4 +781,12 @@ sudo cp $LOCAL_TRAF_CONFIG $TRAF_CONFIG sudo chmod 777 $TRAF_CONFIG echo "***INFO: Configuration file: $TRAF_CONFIG" + +#============================================== +#Call user defined prompting script + +$LOCAL_WORKDIR/traf_user_prompt | tee -a $INSTALL_LOG + +#============================================== + echo "***INFO: Trafodion configuration setup complete" http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_hortonworks_mods98 ---------------------------------------------------------------------- diff --git a/install/installer/traf_hortonworks_mods98 b/install/installer/traf_hortonworks_mods98 index a849df7..cc8a762 100755 --- a/install/installer/traf_hortonworks_mods98 +++ b/install/installer/traf_hortonworks_mods98 @@ -33,9 +33,8 @@ export PDSH="pdsh -R exec" export PDSH_SSH_CMD="ssh -q -n %h" export PDCP="pdcp -R ssh" -TRAF_PDCP="$PDCP $MY_NODES" -TRAF_PDSH="$PDSH $MY_NODES $PDSH_SSH_CMD" - +export PDSH_HADOOP_NODES="$PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD" +export PDCP_HADOOP_NODES="$PDCP $MY_HADOOP_NODES" #===================================== # copy Trafodion hbase trx jar to /usr/lib/hbase/lib @@ -82,26 +81,26 @@ fi # if more than one node then copy to all nodes echo "***INFO: copying $hbase_trx_jar to all nodes" if [ $node_count -ne 1 ]; then - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf $HADOOP_PATH/hbase-trx* 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf /usr/lib/hbase/lib/hbase-trx* 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf /usr/hdp/current/hbase-regionserver/lib/hbase-trx* 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf /usr/share/cmf/lib/plugins/hbase-trx* 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf /usr/lib/hbase/lib/trafodion* 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf /usr/hdp/current/hbase-regionserver/lib/trafodion* 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo rm -rf /usr/share/cmf/lib/plugins/trafodion* 2>/dev/null - $PDSH $MY_NODES $PDSH_SSH_CMD mkdir -p $LOCAL_WORKDIR 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD mkdir -p $LOCAL_WORKDIR 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf $HADOOP_PATH/hbase-trx* 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf /usr/lib/hbase/lib/hbase-trx* 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf /usr/hdp/current/hbase-regionserver/lib/hbase-trx* 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf /usr/share/cmf/lib/plugins/hbase-trx* 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf /usr/lib/hbase/lib/trafodion* 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf /usr/hdp/current/hbase-regionserver/lib/trafodion* 2>/dev/null + $PDSH_HADOOP_NODES sudo rm -rf /usr/share/cmf/lib/plugins/trafodion* 2>/dev/null + $TRAF_PDSH mkdir -p $LOCAL_WORKDIR 2>/dev/null + $PDSH_HADOOP_NODES mkdir -p $LOCAL_WORKDIR 2>/dev/null cp $UNTAR_DIR/export/lib/$hbase_trx_jar $LOCAL_WORKDIR cp $UNTAR_DIR/export/lib/$traf_util_jar $LOCAL_WORKDIR - $PDCP $MY_HADOOP_NODES $LOCAL_WORKDIR/$hbase_trx_jar $LOCAL_WORKDIR - $PDCP $MY_HADOOP_NODES $LOCAL_WORKDIR/$traf_util_jar $LOCAL_WORKDIR - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo cp $LOCAL_WORKDIR/$traf_util_jar $HADOOP_PATH - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo cp $LOCAL_WORKDIR/$hbase_trx_jar $HADOOP_PATH - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo chmod 644 $HADOOP_PATH/$hbase_trx_jar - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD sudo chmod 644 $HADOOP_PATH/$traf_util_jar - - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD rm $LOCAL_WORKDIR/$hbase_trx_jar 2>/dev/null - $PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD rm $LOCAL_WORKDIR/$traf_util_jar 2>/dev/null + $PDCP_HADOOP_NODES $LOCAL_WORKDIR/$hbase_trx_jar $LOCAL_WORKDIR + $PDCP_HADOOP_NODES $LOCAL_WORKDIR/$traf_util_jar $LOCAL_WORKDIR + $PDSH_HADOOP_NODES sudo cp $LOCAL_WORKDIR/$traf_util_jar $HADOOP_PATH + $PDSH_HADOOP_NODES sudo cp $LOCAL_WORKDIR/$hbase_trx_jar $HADOOP_PATH + $PDSH_HADOOP_NODES sudo chmod 644 $HADOOP_PATH/$hbase_trx_jar + $PDSH_HADOOP_NODES sudo chmod 644 $HADOOP_PATH/$traf_util_jar + + $PDSH_HADOOP_NODES rm $LOCAL_WORKDIR/$hbase_trx_jar 2>/dev/null + $PDSH_HADOOP_NODES rm $LOCAL_WORKDIR/$traf_util_jar 2>/dev/null else for node in $HADOOP_NODES do http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_package_setup ---------------------------------------------------------------------- diff --git a/install/installer/traf_package_setup b/install/installer/traf_package_setup index 4e10834..49749f0 100755 --- a/install/installer/traf_package_setup +++ b/install/installer/traf_package_setup @@ -39,15 +39,6 @@ echo >> $INSTALL_LOG echo "***INFO: Starting Trafodion Package Setup ($timestamp)" #======================================== -#Setting up pdsh variables -if [ $all_node_count -eq 1 ]; then - TRAF_PDSH="" - TRAF_PDCP="" -else - TRAF_PDSH="pdsh -R exec $ALL_NODES ssh -q -n %h" - TRAF_PDCP="pdcp -R ssh $ALL_NODES" -fi -#========================================== echo "***INFO: Installing required packages" echo "***INFO: Log file located in /var/log/trafodion" YUM_LOG=/var/log/trafodion/trafodion_yum_$timestamp.log http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_setup ---------------------------------------------------------------------- diff --git a/install/installer/traf_setup b/install/installer/traf_setup index 84dd919..05bb2cf 100755 --- a/install/installer/traf_setup +++ b/install/installer/traf_setup @@ -69,17 +69,6 @@ if [ "$USER" == "$TRAF_USER" ]; then fi #================================ -if [ $all_node_count -eq 1 ]; then - TRAF_PDSH="" - TRAF_PDCP="" -else - # use the -S option to cause pdsh to return largest of - # the remote command return values so we can tell if one - # or more of the remote commands failed - TRAF_PDSH="pdsh -R exec $ALL_NODES ssh -q -n %h" - TRAF_PDCP="pdcp -R ssh $ALL_NODES" -fi -#========================================== #installing required packages" $LOCAL_WORKDIR/traf_package_setup http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_sqgen ---------------------------------------------------------------------- diff --git a/install/installer/traf_sqgen b/install/installer/traf_sqgen index d0feb01..e9ae4d5 100755 --- a/install/installer/traf_sqgen +++ b/install/installer/traf_sqgen @@ -42,9 +42,11 @@ if [ "$node_count" -ne "1" ]; then $PDCP $ALL_NODES -x $HOSTNAME -r $HOME/sqcert $HOME fi + #========================================== if [ "$all_node_count" -ne "1" ]; then + echo "***INFO: copying install to all nodes" | tee -a $INSTALL_LOG $PDCP $ALL_NODES -x $HOSTNAME -r $SQ_ROOT $SQ_ROOT/.. http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_start ---------------------------------------------------------------------- diff --git a/install/installer/traf_start b/install/installer/traf_start index 8c459c0..53ed4a2 100755 --- a/install/installer/traf_start +++ b/install/installer/traf_start @@ -47,12 +47,6 @@ else exit -1; fi - if [[ $MANAGE_ENABLED == "Y" ]]; then - ssh $STARTING_NODE "dcsstop" - sleep 15 - ssh $MANAGE_NODES "dcsstart" - fi - # Do init_trafodion if specified if [ "$INIT_TRAFODION" == "Y" ] && [ "$UPGRADE_TRAF" == "false" ]; then ssh $STARTING_NODE "cd $SQ_ROOT/sql/scripts; echo \"initialize Trafodion;\" | sqlci" | tee -a $SQ_ROOT/initializeErrors.txt http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_user_prompt ---------------------------------------------------------------------- diff --git a/install/installer/traf_user_prompt b/install/installer/traf_user_prompt new file mode 100755 index 0000000..2f35e64 --- /dev/null +++ b/install/installer/traf_user_prompt @@ -0,0 +1,28 @@ +#!/bin/bash + +# @@@ START COPYRIGHT @@@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# @@@ END COPYRIGHT @@@ + +# Script that prompts user for all user input needed for the +# trafodion_config file. This script will be called from +# traf_config_setup and will prompt for user needed prompts. + + http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/traf_user_prompt_check ---------------------------------------------------------------------- diff --git a/install/installer/traf_user_prompt_check b/install/installer/traf_user_prompt_check new file mode 100755 index 0000000..0de6e71 --- /dev/null +++ b/install/installer/traf_user_prompt_check @@ -0,0 +1,27 @@ +#!/bin/bash + +# @@@ START COPYRIGHT @@@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# @@@ END COPYRIGHT @@@ + +# Script that prompts user for all user input needed for the +# trafodion_config file. This script will be called from +# traf_config_setup and will prompt for user needed prompts. + http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/trafodion_install ---------------------------------------------------------------------- diff --git a/install/installer/trafodion_install b/install/installer/trafodion_install index 9e8f00e..c745920 100755 --- a/install/installer/trafodion_install +++ b/install/installer/trafodion_install @@ -63,14 +63,13 @@ fi function removePassword { -export TRAF_CONFIG="/etc/trafodion/trafodion_config" -source $TRAF_CONFIG + export TRAF_CONFIG="/etc/trafodion/trafodion_config" + source $TRAF_CONFIG -$TRAF_PDSH sudo chmod 777 $TRAF_CONFIG -$TRAF_PDSH sudo sed -i '/TRAF_USER_PASSWORD\=/d' $TRAF_CONFIG -$TRAF_PDSH sudo sed -i '/PASSWORD\=/d' $TRAF_CONFIG -$TRAF_PDSH sudo chmod 777 $TRAF_CONFIG -echo "here" + $TRAF_PDSH sudo chmod 777 $TRAF_CONFIG + $TRAF_PDSH sudo sed -i '/TRAF_USER_PASSWORD\=/d' $TRAF_CONFIG + $TRAF_PDSH sudo sed -i '/PASSWORD\=/d' $TRAF_CONFIG + $TRAF_PDSH sudo chmod 777 $TRAF_CONFIG } @@ -236,9 +235,6 @@ export TRAF_CONFIG="/etc/trafodion/trafodion_config" export TRAF_CONFIG_DIR=$(dirname $TRAF_CONFIG) export TRAF_CONFIG_FILE=$(basename $TRAF_CONFIG) export TRAF_USER="trafodion" -export PDSH="pdsh -R exec" -export PDSH_SSH_CMD="ssh -q -n %h" -export PDCP="pdcp -R ssh" #============================================== #Prechecks @@ -272,7 +268,6 @@ echo "***INFO: Config directory: $TRAF_CONFIG_DIR" sudo mkdir -p $TRAF_WORKDIR sudo chmod -R 777 $TRAF_WORKDIR echo "***INFO: Working directory: $TRAF_WORKDIR" - # copy install scripts into working directory sudo cp -r $(cd "$( dirname "$0" )" && pwd)/ $TRAF_WORKDIR sudo cp -rf $LOCAL_WORKDIR $TRAF_WORKDIR @@ -424,14 +419,6 @@ fi #============================================= -if [ $all_node_count -eq 1 ]; then - TRAF_PDSH="" - TRAF_PDCP="" -else - TRAF_PDSH="pdsh -R exec $ALL_NODES $PDSH_SSH_CMD" - TRAF_PDCP="pdcp -R ssh $ALL_NODES" -fi - sed -i '/ACCEPT_LICENSE\=/d' $TRAF_CONFIG echo "export ACCEPT_LICENSE=\"$ACCEPT_LICENSE\"" >> $TRAF_CONFIG @@ -722,17 +709,20 @@ $TRAF_PDSH sudo /sbin/sysctl -w kernel.pid_max=65535 2>&1 > /dev/null sudo sed -i '/kernel\.pid\_max*/d' /etc/sysctl.conf 2>&1 > /dev/null sudo chmod 777 /etc/sysctl.conf sudo echo "kernel.pid_max = 65535" >> /etc/sysctl.conf -sudo chmod 777 /etc/sysctl.conf -sudo chown $(whoami).$(whoami) /etc/sysctl.conf -cp /etc/sysctl.conf $HOME 2>&1 > /dev/null -if [[ $node_count -ne "1" ]]; then +if [[ $all_node_count -ne 1 ]]; then + sudo chmod 777 /etc/sysctl.conf + sudo chown $(whoami).$(whoami) /etc/sysctl.conf + cp /etc/sysctl.conf $HOME 2>&1 > /dev/null + $TRAF_PDCP $HOME/sysctl.conf $HOME 2>&1 > /dev/null -fi -$TRAF_PDSH sudo mv $HOME/sysctl.conf /etc/sysctl.conf -$TRAF_PDSH sudo chown root.root /etc/sysctl.conf -$TRAF_PDSH sudo chmod 644 /etc/sysctl.conf + $TRAF_PDSH sudo mv $HOME/sysctl.conf /etc/sysctl.conf + $TRAF_PDSH sudo chown root.root /etc/sysctl.conf + $TRAF_PDSH sudo chmod 644 /etc/sysctl.conf +else + sudo chmod 644 /etc/sysctl.conf +fi #Create install directory if [[ "$all_node_count" -ne "1" ]]; then @@ -825,7 +815,7 @@ if [ ${PIPESTATUS[0]} != "0" ]; then fi # Install and configure CLI for Cloud environments -if [ "$ENABLE_HA" == "true" ] && [[ $CLOUD_CONFIG == "Y" ]]; then +if [ "$ENABLE_HA" == "true" ] && [[ $CLOUD_CONFIG == "Y" ]] && [[ $all_node_count -gt 1 ]]; then echo "***INFO: Install and configure CLI for Cloud" $TRAF_WORKDIR/installer/cloud_cli_setup fi @@ -853,4 +843,3 @@ copyConfig removePassword echo echo - http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95d82f94/install/installer/trafodion_uninstaller ---------------------------------------------------------------------- diff --git a/install/installer/trafodion_uninstaller b/install/installer/trafodion_uninstaller index 62ec6aa..0924dcd 100755 --- a/install/installer/trafodion_uninstaller +++ b/install/installer/trafodion_uninstaller @@ -83,19 +83,6 @@ fi timestamp=$(date +%F-%H-%M-%S) logsdir="/var/log/trafodion" logfile="$logsdir/uninstall_$timestamp.log" -export PDSH="pdsh -R exec" -export PDSH_SSH_CMD="ssh -q -n %h" -export PDCP="pdcp -R ssh" - - -if [ $all_node_count -eq 1 ]; then - TRAF_PDSH="" -else - # use the -S option to cause pdsh to return largest of - # the remote command return values so we can tell if one - # or more of the remote commands failed - TRAF_PDSH="pdsh -R exec $ALL_NODES $PDSH_SSH_CMD" -fi #Check sudo access which is required for "--all" option sudo echo "***INFO: testing sudo access"
