You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by sv...@apache.org on 2016/05/05 23:21:26 UTC
[1/2] incubator-trafodion git commit: [[TRAFODION-1951]] Fix for JAVA
checking
Repository: incubator-trafodion
Updated Branches:
refs/heads/release2.0 b3f7856f5 -> 7b5e5ea01
[[TRAFODION-1951]] Fix for JAVA checking
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/e208598d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/e208598d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/e208598d
Branch: refs/heads/release2.0
Commit: e208598d88caab04e14db1dbb38ac5f4378e8826
Parents: b3f7856
Author: Amanda Moran <am...@apache.com>
Authored: Thu May 5 17:11:48 2016 +0000
Committer: Amanda Moran <am...@apache.com>
Committed: Thu May 5 17:11:48 2016 +0000
----------------------------------------------------------------------
.../installer/traf_apache_hadoop_config_setup | 842 -------------------
install/installer/traf_config_check | 8 +-
.../installer/trafodion_apache_hadoop_install | 763 -----------------
3 files changed, 7 insertions(+), 1606 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e208598d/install/installer/traf_apache_hadoop_config_setup
----------------------------------------------------------------------
diff --git a/install/installer/traf_apache_hadoop_config_setup b/install/installer/traf_apache_hadoop_config_setup
deleted file mode 100755
index 9547db2..0000000
--- a/install/installer/traf_apache_hadoop_config_setup
+++ /dev/null
@@ -1,842 +0,0 @@
-#!/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
-
-
-#==============================================
-# Defaults
-suseLinux=$(grep -cr SUSE /proc/version)
-LOCAL_WORKDIR="$( cd "$( dirname "$0" )" && pwd )"
-TRAF_WORKDIR="/usr/lib/trafodion"
-TRAF_CONFIG="/etc/trafodion/trafodion_config"
-TRAF_CONFIG_DIR=$(dirname $TRAF_CONFIG)
-LOCAL_TRAF_CONFIG="$LOCAL_WORKDIR/trafodion_config"
-LDAP_AUTH_FILE="traf_authentication_config_${HOSTNAME}"
-TRAF_USER="trafodion"
-TRAF_USER_PASSWORD="traf123" # must be 6-8 chars
-userForTrafodion=`grep "$TRAF_USER:" /etc/passwd | wc -l`
-NODE_LIST=""
-HOME_DIR="/home"
-
-TRAF_PACKAGE=""
-TRAF_BUILD=""
-DCS_BUILD=""
-
-
-HADOOP_PREFIX=""
-HBASE_HOME=""
-HIVE_HOME=""
-
-
-HADOOP_NODES=""
-HDFS_USER="hdfs"
-HBASE_USER="hbase"
-HBASE_GROUP="hbase"
-
-SQ_ROOT=""
-INIT_TRAFODION="N"
-START="N"
-SQCONFIG=""
-DCS_SERVERS_PARM="2"
-LDAP_SECURITY="N"
-SCANNER_MODE="N"
-
-LDAP_LEVEL="0"
-#==============================================
-
-function print_usage {
-cat << EOF
-
-This script takes in user input to add to the trafodion_config file or uses known
-defaults. Script will return an error if user enters bad inputs. Type response or
-select [Enter] to select default.
-
-Inputs Requested:
-
-*Trafodion Password (default is [$TRAF_USER_PASSWORD])
-*List of Nodes
-*Home directory (default is [$HOME_DIR])
-*Location of EPEL RPM (default is [None])
-*Full path to Trafodion Server tar file
-(default is [$TRAF_BUILD])
-*Apache Hadoop install location
-*Apache Hbase install location
-*Apache Hive install location
-*HDFS username (default is [$HDFS_USER])
-*HBase username (default is [$HBASE_USER])
-*HBase group (default is [$HBASE_GROUP])
-*Full pathname to the install directory location (default [$SQ_ROOT])
-*Full pathname to the DNS build tar file (default [$DCS_BUILD])
-*Start Trafodion after install (default is [No])
-*Total number of DCS servers to start
-
-
-Options:
- --help Print this message and exit.
-
-EOF
-}
-
-#==============================================
-#Parse input parameters
-
-while [[ $# -gt 0 ]]; do
- case "$1" in
- --scanner_mode)
- SCANNER_MODE="Y"
- ;;
-
- --help)
- print_usage
- exit -1
- ;;
- *)
- echo "***ERROR: unknown parameter '$1'"
- print_usage
- exit -1
- esac
- shift
-done
-
-#==============================================
-
-
-echo
-echo "*******************************"
-echo " Trafodion Configuration Setup"
-echo "*******************************"
-echo
-echo "***INFO: Please press [Enter] to select defaults."
-echo
-
-sudo mkdir -p $TRAF_WORKDIR
-sudo chmod 777 $TRAF_WORKDIR
-
-# if there was a partial config file then use it
-# to fill in default values so user doesn't have to retype
-# everything again.
-if [ -f $LOCAL_TRAF_CONFIG ]; then
- source $LOCAL_TRAF_CONFIG
-fi
-
-if [[ "$suseLinux" -ge "1" ]]; then
- SUSE_LINUX="true"
-else
- SUSE_LINUX="false"
-fi
-
-echo "#!/bin/bash" > $LOCAL_TRAF_CONFIG
-echo "export SUSE_LINUX=\"$SUSE_LINUX\"" >> $LOCAL_TRAF_CONFIG
-echo "export TRAF_USER=\"$TRAF_USER\"" >> $LOCAL_TRAF_CONFIG
-echo "export TRAF_WORKDIR=\"$TRAF_WORKDIR\"" >> $LOCAL_TRAF_CONFIG
-echo "export LOCAL_WORKDIR=\"$LOCAL_WORKDIR\"" >> $LOCAL_TRAF_CONFIG
-echo "export SQCONFIG=\"$SQCONFIG\"" >> $LOCAL_TRAF_CONFIG
-
-#==============================================
-# Password
-if [[ "$userForTrafodion" == "0" ]]; then
- echo -n "Enter $TRAF_USER password, default is [$TRAF_USER_PASSWORD]: "
- read answer
- if [ -z $answer ]; then
- echo "export TRAF_USER_PASSWORD=\"$TRAF_USER_PASSWORD\"" >> $LOCAL_TRAF_CONFIG
- else
- length=${#answer}
- if [[ $length -lt "6" ]]; then
- echo "***ERROR: Linux requires password to be at least 6 characters"
- echo "***ERROR: Password length must be from 6-8 characters."
- exit -1
- fi
- if [[ $length -gt "8" ]]; then
- echo "***ERROR: VNC server requires passwords be 8 or less characters"
- echo "***ERROR: Password length must be from 6-8 characters."
- exit -1
- fi
- echo "export TRAF_USER_PASSWORD=\"$answer\"" >> $LOCAL_TRAF_CONFIG
- fi
-fi
-
-#==============================================
-# List of Nodes
-
-echo -n "Enter list of nodes to install trafodion(must have apache hadoop/hbase installed) (blank separated), default [$NODE_LIST]: "
-read answer
-if [[ -z "$answer" ]]; then
- if [ -z "$NODE_LIST" ]; then
- echo "***ERROR: Must enter list of nodes."
- exit -1
- fi
-else
- NODES="$answer"
- NODE_LIST=""
- ERROR_NODES=""
- for node in $NODES
- do
- newNode=$(ssh -q -n $node hostname)
-
- if [[ $? -ne "0" ]]; then
- echo "***ERROR: Could not ssh to $node."
- echo "***ERROR: Please check node names for typos"
- exit -1
- fi
-
- nodeName=$(echo $newNode | sed 's/[^a-zA-Z0-9\ \.\-]//g')
-
- if [[ "$nodeName" != "$newNode" ]]; then
- echo "***ERROR: Nodes are not named properly."
- echo "***ERROR: Nodes can have no special characters other than '-' and '.'"
- exit -1
- fi
-
- if [[ "$newNode" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then
- echo "***ERROR: Nodes are not named properly."
- echo "***ERROR: IP addresses are not supported. Please use node names."
- exit -1
- fi
-
- #Testing sudo access on all nodes
- ssh -q -n $newNode sudo echo "***INFO: Testing sudo access on node $newNode"
- if [ $? -ne "0" ]; then
- error=1
- ERROR_NODES="$ERROR_NODES $newNode"
- fi
- NODE_LIST="$NODE_LIST $newNode"
- done
-
- if [[ $error == "1" ]]; then
- echo "***ERROR: $ERROR_NODES does not have sudo access."
- echo "***ERROR: Must have sudo access on all nodes."
- exit -1
- fi
-
-fi
-
-for node in $NODE_LIST
-do
- ssh -q -n $node echo "***INFO: Testing ssh on $node"
- if [[ $? -ne "0" ]]; then
- errorFound=1
- ERROR_NODES="$ERROR_NODES $node"
- fi
-done
-
-if [[ $errorFound == "1" ]]; then
- echo "***ERROR: Could not ssh to $ERROR_NODES."
- echo "***ERROR: Check permissions and known hosts files."
- exit -1
-fi
-
-node_count=$(echo $NODE_LIST | wc -w)
-echo "export NODE_LIST=\"$NODE_LIST\"" >> $LOCAL_TRAF_CONFIG
-echo "export node_count=\"$node_count\"" >> $LOCAL_TRAF_CONFIG
-
-MY_NODES=""
-for node in $NODE_LIST
-do
- MY_NODES="$MY_NODES -w $node"
-done
-echo "export MY_NODES=\"$MY_NODES\"" >> $LOCAL_TRAF_CONFIG
-
-if [ $node_count -eq 1 ]; then
- TRAF_PDSH=""
-else
- TRAF_PDSH="pdsh -S $MY_NODES"
-fi
-
-#==============================================
-# Home directory
-if [[ "$userForTrafodion" == "0" ]]; then
- echo -n "Enter Trafodion userid's home directory prefix, default is [$HOME_DIR]: "
- read answer
-
- if [ ! -z $answer ]; then
- # strip off TRAF_USER if user added it on end of directory
- HOME_DIR=$(echo "$answer" | sed -e "s@/$TRAF_USER\$@@")
- fi
-
- #Test if home directory is on a NFS disk
- diskType="$( df -P -T $HOME_DIR | tail -n +2 | awk '{print $2}')"
- if [ "$diskType" == "nfs" ]; then
- echo "***ERROR: Trafodion userid's home directory ($HOME_DIR) cannot be on an NFS disk"
- echo "***ERROR: Please choose a different directory to install on."
- exit -1
- fi
-else
- HOME_DIR=$(grep -r "trafodion" /etc/passwd | sed 's/.*:://' | sed 's/\:.*$//' | sed 's/\/trafodion.*$//')
-
-fi
-
-echo "export HOME_DIR=\"$HOME_DIR\"" >> $LOCAL_TRAF_CONFIG
-#==============================================
-#Check location given for EPEL RPM
-if [[ "$userForTrafodion" == "0" ]] &&[[ "$SUSE_LINUX" != "true" ]]; then
- echo -n "Specify full path to EPEL RPM (including .rpm), default is None: "
- read answer
-
- if [ -z $answer ]; then
- echo "***INFO: Will attempt to download RPM if EPEL is not installed on all nodes."
- echo "export EPEL_RPM=\"\"" >> $LOCAL_TRAF_CONFIG
- else
- if [[ ! -f $answer ]]; then
- echo "***ERROR: File not found. Please check path for existence and typos."
- exit -1
- fi
- if [[ "$answer" == *"rpm"* ]]; then
- echo "export EPEL_RPM=\"$answer\"" >> $LOCAL_TRAF_CONFIG
- else
- echo "***ERROR: File enter is not an RPM. Check file is of type epel***.rpm"
- exit -1
- fi
- fi
-fi
-#==============================================
-#Check location given for Java 65 or greater
-
-echo -n "Specify location of Java 1.7.0_65 or higher (JDK), default is [$JAVA_HOME]: "
-read answer
-
-if [ -z $answer ]; then
- if [ -z $JAVA_HOME ]; then
- echo "***ERROR: Must specify location of Java 1.7.0_65 or higher (JDK)."
- exit -1
- fi
-else
- JAVA_HOME=$answer
-fi
-
-REQ_VER="1.7.0_65"
-JAVA7="7"
-JAVA65="65"
-
-for node in $NODE_LIST
-do
- THIS_JVM_VER="$(ssh -q -n $node $JAVA_HOME/bin/java -version 2>&1 > /dev/null)"
- if [[ "$THIS_JVM_VER" == *"No such file"* ]]; then
- echo "***ERROR: Unable to find Java version on node $node"
- echo "***ERROR: Must enter a specific Java version (example: /usr/java/jdk1.7.0_67)"
- echo "***ERROR: Please check for typos and that directory exists"
- exit -1
- fi
-
- javaType="$(ssh -q -n $node $JAVA_HOME/bin/javac -version 2>&1 > /dev/null | grep "No such file" | wc -l)"
- if [[ $javaType -eq "1" ]]; then
- echo "***ERROR: Java version on node $node is of type JRE"
- echo "***ERROR: Java version needed on all nodes must be a JDK"
- exit -1
- fi
-
- temp_JAVA=`echo "${THIS_JVM_VER:15:2}" | sed 's/.*\.//'`
-
- #Check if using something less than Java 7
- if [[ "$temp_JAVA" -lt "$JAVA7" ]]; then
- error="true"
- fi
-
- #Checking if using 1.7.0_n
- if [[ "${THIS_JVM_VER:18:1}" -eq "0" ]] && [[ "$temp_JAVA" -eq "$JAVA7" ]]; then
- if [[ "${THIS_JVM_VER:20:1}" -eq "0" ]] || [[ "${THIS_JVM_VER:20:2}" -lt $JAVA65 ]]; then
- error="true"
- fi
- fi
-
- if [[ -n $error ]]; then
- echo "***ERROR: Your existing JAVA_HOME on $node is less than $REQ_VER"
- echo "***ERROR: Your Java Version on $node = $THIS_JVM_VER"
- echo "***ERROR: Required java version on $node should be greater than $REQ_VER"
- exit -1
- fi
-done
-
-echo "export JAVA_HOME=\"$JAVA_HOME\"" >> $LOCAL_TRAF_CONFIG
-
-#==============================================
-# Trafodion Build location
-# set the following based on what the user provided as input
-# TRAF_PACKAGE = the trafodion package tar file which contains trafodion core & dcs
-# TRAF_BUILD = the trafodion core tar file extracted from the trafodion package
-# DCS_BUILD = the dcs tar file extracted from the trafodion package
-
-if [ -z "$TRAF_PACKAGE" ]; then
- TRAF_DEFAULT="$TRAF_BUILD"
-else
- TRAF_DEFAULT="$TRAF_PACKAGE"
-fi
-
-
-echo -n "Enter full path (including .tar or .tar.gz) of trafodion tar file [$TRAF_DEFAULT]: "
-read answer
-if [ -z $answer ] && [ -z $TRAF_DEFAULT ]; then
- echo "***ERROR: Must specify Trafodion tar file location."
- exit -1
-fi
-
-if [ ! -z "$answer" ]; then
- TRAF_PACKAGE="$answer"
-else
- TRAF_PACKAGE="$TRAF_DEFAULT"
-fi
-
-# make sure file exists
-if [ ! -f $TRAF_PACKAGE ]; then
- echo "***ERROR: $TRAF_PACKAGE does not exist"
- exit -1
-fi
-
-# Determine if we have a package or just the trafodion_server tar file
-# Normally, the package file is what should be specified but because
-# we used to not support the package file and required the trafodion core
-# tar file previous users might still specify the trafodion core tar file instead
-# Also, developers might only have trafodion core tar file and not a package
-# tar file.
-package=$(tar -tzf $TRAF_PACKAGE | grep build-version.txt | wc -l )
-if [ $package -eq 0 ]; then
-
- # assume user specified a trafodion core tar file
- TRAF_BUILD=$TRAF_PACKAGE
- TRAF_PACKAGE=""
-
- #TODO: do a quick sanity check on the file to make sure it is a traf build tar file
-
- echo "***INFO: tar file is not a package tar file which includes Trafodion & DCS"
- echo "***INFO: assuming it is a Trafodion build only tar file"
-
- # since it is not a package tar file, we'll need to prompt for the DCS build file
- echo -n "Enter location of DCS tar file [DCS_BUILD]: "
- read answer
- if [ -z $answer ]; then
- if [ -z $DCS_BUILD ]; then
- echo "***ERROR: Must specify DCS tar file location."
- exit -1
- fi
- else
- DCS_BUILD=$answer
- fi
-
- # make sure file exists
- if [ ! -f $DCS_BUILD ]; then
- echo "***ERROR: $DCS_BUILD does not exist"
- exit -1
- fi
-
- #TODO: do a quick sanity check on the file to make sure it is a DCS build tar file
-
- # since it is not a package tar file, we'll need to prompt for the rest build file
- echo -n "Enter location of REST tar file [$REST_BUILD]: "
- read answer
- if [ -z $answer ]; then
- if [ -z $REST_BUILD ]; then
- echo "***ERROR: Must specify REST tar file location."
- exit -1
- fi
- else
- REST_BUILD=$answer
- fi
-
- # make sure file exists
- if [ ! -f $REST_BUILD ]; then
- echo "***ERROR: $REST_BUILD does not exist"
- exit -1
- fi
-
- #TODO: do a quick sanity check on the file to make sure it is a rest build tar file
-
-else
- # user specifed a package file
- TRAF_BUILD=""
- DCS_BUILD=""
- REST_BUILD=""
-fi
-
-
-echo "export TRAF_PACKAGE=\"$TRAF_PACKAGE\"" >> $LOCAL_TRAF_CONFIG
-echo "export TRAF_BUILD=\"$TRAF_BUILD\"" >> $LOCAL_TRAF_CONFIG
-echo "export DCS_BUILD=\"$DCS_BUILD\"" >> $LOCAL_TRAF_CONFIG
-echo "export REST_BUILD=\"$REST_BUILD\"" >> $LOCAL_TRAF_CONFIG
-
-#Check if install_features file exists
-if [[ -z $TRAF_BUILD ]]; then
- TRAF_BUILD=$(tar -tf $TRAF_PACKAGE | grep "trafodion_server")
- tar -xzf $TRAF_PACKAGE --directory $LOCAL_WORKDIR
-fi
-
-if [[ -z $TRAF_BUILD ]]; then
- echo "***ERROR: trafodion_server-n.n.n.tgz not included in $TRAF_PACKAGE"
- echo "***ERROR: Workaround may be to enter trafodion_server-n.n.n.tgz as trafodion tar package."
- exit -1
-fi
-
-
-#==============================================
-#Hadoop path
-
-echo -n "Enter Hadoop installed full path, default is [$HADOOP_PREFIX]: "
-read answer
-
-if [ -z $answer ]; then
- if [[ -z $HADOOP_PREFIX ]]; then
- echo "***ERROR: Must enter apache Hadoop installed path"
- exit -1
- fi
-else
- if [[ -e $answer ]]; then
- HADOOP_PREFIX=$answer
- else
- echo "***ERROR: apache Hadoop installed path doesn't exist"
- exit -1
- fi
-fi
-echo "export HADOOP_PREFIX=\"$HADOOP_PREFIX\"" >> $LOCAL_TRAF_CONFIG
-
-#==============================================
-#Hbase path
-
-echo -n "Enter Hbase installed full path, default is [$HBASE_HOME]: "
-read answer
-
-if [ -z $answer ]; then
- if [[ -z $HBASE_HOME ]]; then
- echo "***ERROR: Must enter apache Hbase installed path"
- exit -1
- fi
-else
- if [[ -e $answer ]]; then
- HBASE_HOME=$answer
- else
- echo "***ERROR: apache Hbase installed path doesn't exist"
- exit -1
- fi
-fi
-echo "export HBASE_HOME=\"$HBASE_HOME\"" >> $LOCAL_TRAF_CONFIG
-
-#==============================================
-#Hive path
-
-echo -n "Enter Hive installed full path, default is [$HIVE_HOME]: "
-read answer
-
-if [ -z $answer ]; then
- if [[ -z $HIVE_HOME ]]; then
- echo "***ERROR: Must enter apache Hive installed path"
- exit -1
- fi
-else
- if [[ -e $answer ]]; then
- HIVE_HOME=$answer
- else
- echo "***ERROR: apache Hive installed path doesn't exist"
- exit -1
- fi
-fi
-
-echo "export HIVE_HOME=\"$HIVE_HOME\"" >> $LOCAL_TRAF_CONFIG
-
-#=====================
-#Hadoop checks
-count=0
-
-# assume they are the same
-HADOOP_NODES=$NODE_LIST
-echo "export HADOOP_NODES=\"$HADOOP_NODES\"" >> $LOCAL_TRAF_CONFIG
-
-for node in $NODE_LIST;
-do
- ssh -q -n $node 'echo "exit" | hbase shell &> $HOME/hbaseVersion.txt'
- count=$[$count+1]
- foundFile=$(ssh -q -n $node ls $HOME/hbaseVersion.txt | wc -l)
- if [[ $foundFile -eq "0" ]]; then
- echo "***ERROR: HBase shell not found on any node"
- echo "***ERROR: Check that HBase is installed and working"
- exit -1
- fi
-done
-
-
-#==============================================
-#HDFS Username
-
-echo -n "Enter HDFS username, default is [$HDFS_USER]: "
-read answer
-
-if [ -z $answer ]; then
- echo "export HDFS_USER=\"$HDFS_USER\"" >> $LOCAL_TRAF_CONFIG
-else
- echo "export HDFS_USER=\"$answer\"" >> $LOCAL_TRAF_CONFIG
-fi
-
-#==============================================
-#HBase user
-
-echo -n "Enter HBase username, default is [$HBASE_USER]: "
-read answer
-
-if [ -z $answer ]; then
- echo "export HBASE_USER=\"$HBASE_USER\"" >> $LOCAL_TRAF_CONFIG
-else
- echo "export HBASE_USER=\"$answer\"" >> $LOCAL_TRAF_CONFIG
-fi
-
-#==============================================
-#HBase group
-
-echo -n "Enter HBase group, default is [$HBASE_GROUP]: "
-read answer
-
-if [ -z $answer ]; then
- echo "export HBASE_GROUP=\"$HBASE_GROUP\"" >> $LOCAL_TRAF_CONFIG
-else
- echo "export HBASE_GROUP=\"$answer\"" >> $LOCAL_TRAF_CONFIG
-fi
-
-#==============================================
-#Install location
-
-if [ -z $SQ_ROOT ]; then
-
- # if we have a package file then use its name for the default install dir
- if [ ! -z "$TRAF_PACKAGE" ]; then
- traf_filename=$(basename "$TRAF_PACKAGE")
- SQ_ROOT="$HOME_DIR/$TRAF_USER/${traf_filename%.tar.gz}"
- else
- # otherwise, create a default install dir using a timestamp
- SQ_ROOT="$HOME_DIR/$TRAF_USER/traf_$(date +%F_%H%M)"
- fi
-fi
-
-echo -n "Enter directory to install trafodion to, default is [$SQ_ROOT]: "
-read answer
-
-if [ -z $answer ]; then
- echo "export SQ_ROOT=\"$SQ_ROOT\"" >> $LOCAL_TRAF_CONFIG
-else
- echo "export SQ_ROOT=\"$answer\"" >> $LOCAL_TRAF_CONFIG
-fi
-
-#==============================================
-#Run sqstart
-if [[ $SCANNER_MODE == "N" ]]; then
- echo -n "Start Trafodion after install (Y/N), default is Y: "
- read answer
-
- if [ -z $answer ]; then
- echo "export START=\"Y\"" >> $LOCAL_TRAF_CONFIG
- echo "export INIT_TRAFODION=\"Y\"" >> $LOCAL_TRAF_CONFIG
- else
- if [[ "${answer}" =~ ^[Yy]$ ]]; then
- echo "export START=\"Y\"" >> $LOCAL_TRAF_CONFIG
- echo "export INIT_TRAFODION=\"Y\"" >> $LOCAL_TRAF_CONFIG
- else
- echo "export START=\"N\"" >> $LOCAL_TRAF_CONFIG
- echo "export INIT_TRAFODION=\"N\"" >> $LOCAL_TRAF_CONFIG
- echo "***INFO: Trafodion will not be started after install is complete."
- echo "***INFO: User will need follow steps on the trafodion wiki on how to start."
- fi
- fi
-fi
-#==============================================
-#DCS Servers
-
-echo -n "Total number of DCS servers to start, default [$DCS_SERVERS_PARM]: "
-read answer
-
-if [ ! -z $answer ]; then
- DCS_SERVERS_PARM="$answer"
-fi
-
-if [[ $DCS_SERVERS_PARM != *[!0-9]* ]]; then
- echo "export DCS_SERVERS_PARM=\"$DCS_SERVERS_PARM\"" >> $LOCAL_TRAF_CONFIG
-else
- echo "***ERROR: DCS servers must be a number."
- exit -1
-fi
-
-#==============================================
-#Simple security
-if [[ $SCANNER_MODE == "N" ]]; then
- echo -n "Enable simple LDAP security (Y/N), default is N: "
- read answer
-
- if [ ! -z $answer ]; then
- if [[ "${answer}" =~ ^[Yy]$ ]]; then
- LDAP_SECURITY="Y"
- fi
- else
- LDAP_SECURITY="N"
- fi
-
- echo "export LDAP_SECURITY=\"$LDAP_SECURITY\"" >> $LOCAL_TRAF_CONFIG
-
- if [[ "$LDAP_SECURITY" == "Y" ]]; then
- #Hostnames
- echo -n "Enter list of LDAP Hostnames (blank separated), default [$LDAP_HOSTS]: "
- read answer1
- if [[ -z "$answer1" ]]; then
- if [ -z "$LDAP_HOSTS" ]; then
- echo "***ERROR: Must enter list of LDAP Hostnames."
- exit -1
- fi
- else
- LDAP_HOSTS=$answer1
- fi
- echo "export LDAP_HOSTS=\"$LDAP_HOSTS\"" >> $LOCAL_TRAF_CONFIG
- cp -rf traf_authentication_conf_default $LOCAL_WORKDIR/$LDAP_AUTH_FILE
- echo "export LDAP_AUTH_FILE=\"$LDAP_AUTH_FILE\"" >> $LOCAL_TRAF_CONFIG
-
- counter=0
- for host in $LDAP_HOSTS
- do
- counter=$[$counter+1]
- if [ $counter -eq "1" ]; then
- list=" LdapHostname: $host"
- elif [ $counter -eq "$node_count" ]; then
- list="LdapHostname: $host\n $list"
- else
- list=" LdapHostname: $host\n $list"
- fi
- done
- sed -i -e "s/LdapHostname:/$list/g" $LDAP_AUTH_FILE
-
- #Port numbers
- echo -n "Enter LDAP Port number (Example: 389 for no encryption or TLS, 636 for SSL), default [$LDAP_PORT]: "
- read answer2
- if [[ -z "$answer2" ]]; then
- if [ -z "$LDAP_PORT" ]; then
- echo "***ERROR: Must enter LDAP port."
- exit -1
- fi
- else
- LDAP_PORT=$answer2
- fi
-
- echo "export LDAP_PORT=\"$LDAP_PORT\"" >> $LOCAL_TRAF_CONFIG
- port="LdapPort: $LDAP_PORT"
- sed -i -e "s/LdapPort:389/$port/g" $LDAP_AUTH_FILE
-
- #Unique IDs
- echo -n "Enter all LDAP unique identifiers (blank separated), default [$LDAP_ID]: "
- read answer3
- if [[ -z "$answer3" ]]; then
- if [ -z "$LDAP_ID" ]; then
- echo "***ERROR: Must enter LDAP unique identifiers."
- exit -1
- fi
- else
- LDAP_ID=$answer3
- fi
- echo "export LDAP_ID=\"$LDAP_ID\"" >> $LOCAL_TRAF_CONFIG
-
- counter=0
- for id in $LDAP_ID
- do
- counter=$[$counter+1]
- if [ $counter -eq "1" ]; then
- list=" UniqueIdentifier: $id"
- elif [ $counter -eq "$node_count" ]; then
- list="UniqueIdentifier: $id\n $list"
- else
- list=" LdapHostname: $id\n $list"
- fi
- done
-
- sed -i -e "s/UniqueIdentifier:/$list/g" $LDAP_AUTH_FILE
-
- #Encryption level
- echo -n "Enter LDAP Encryption Level (0: Encryption not used, 1: SSL, 2: TLS), default [$LDAP_LEVEL]: "
- read answer4
- if [[ -z "$answer4" ]]; then
- if [ -z "$LDAP_LEVEL" ]; then
- echo "***ERROR: Much enter LDAP Encryption level."
- exit -1
- fi
- else
- LDAP_LEVEL=$answer4
- fi
- echo "export LDAP_LEVEL=\"$LDAP_LEVEL\"" >> $LOCAL_TRAF_CONFIG
-
- level="LDAPSSL: $LDAP_LEVEL"
- sed -i -e "s/LDAPSSL:0/$level/g" $LDAP_AUTH_FILE
-
-
- if [[ "$LDAP_LEVEL" -eq "1" ]] || [[ "$LDAP_LEVEL" -eq "2" ]]; then
- echo -n "Enter full path to TLS certificate, default [$LDAP_CERT]: "
- read answer7
- if [[ -z "$answer7" ]]; then
- if [ -z "$LDAP_CERT" ]; then
- echo "***ERROR: Encryption level 2(TLS) requires a certificate file (*.pem)"
- exit -1
- fi
- else
- LDAP_CERT=$answer7
- LDAP_CERT_BASE=$(basename $LDAP_CERT)
-
- if [[ ! -f $LDAP_CERT ]]; then
- echo "***ERROR: File does not exist."
- echo "***ERROR: Please enter full path or check for errors."
- exit -1
- fi
-
- fi
- echo "export LDAP_CERT=\"$LDAP_CERT\"" >> $LOCAL_TRAF_CONFIG
- echo "export LDAP_CERT_BASE=\"$LDAP_CERT_BASE\"" >> $LOCAL_TRAF_CONFIG
-
- list="TLS_CACERTFilename: $HOME_DIR/$TRAF_USER/$LDAP_CERT_BASE"
-
- sed -i -e "s@TLS\_CACERTFilename:@$list@" $LDAP_AUTH_FILE
- fi
-
- #Search username and password
- echo -n "Enter Search user name (if required), default [$LDAP_USER]: "
- read answer5
- if [[ ! -z "$answer5" ]]; then
- LDAP_USER=$answer5
- echo "export LDAP_USER=\"$LDAP_USER\"" >> $LOCAL_TRAF_CONFIG
-
- echo -n "Enter Search password (if required), default [$LDAP_PASSWORD]: "
- read answer6
- if [[ ! -z "$answer6" ]]; then
- LDAP_PASSWORD=$answer6
- echo "export LDAP_PASSWORD=\"$LDAP_PASSWORD\"" >> $LOCAL_TRAF_CONFIG
- fi
- fi
- user="LDAPSearchDN: $LDAP_USER"
- sed -i -e "s/LDAPSearchDN:/$user/g" $LDAP_AUTH_FILE
- password="LDAPSearchPwd: $LDAP_PASSWORD"
- sed -i -e "s/LDAPSearchPwd:/$password/g" $LDAP_AUTH_FILE
- fi
-
-fi
-#==============================================
-#All items added to config file
-#Will add setup complete flag
-
-echo "export CONFIG_COMPLETE=\"true\"" >> $LOCAL_TRAF_CONFIG
-#=============================================
-#Create directories and cp files
-
-sudo mkdir -p $TRAF_CONFIG_DIR
-sudo chmod 777 $TRAF_CONFIG_DIR
-sudo cp $LOCAL_TRAF_CONFIG $TRAF_CONFIG
-sudo chmod 777 $TRAF_CONFIG
-echo "***INFO: Configuration file: $TRAF_CONFIG"
-
-echo "***INFO: Trafodion configuration setup complete"
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e208598d/install/installer/traf_config_check
----------------------------------------------------------------------
diff --git a/install/installer/traf_config_check b/install/installer/traf_config_check
index 8c45e83..6bf3760 100755
--- a/install/installer/traf_config_check
+++ b/install/installer/traf_config_check
@@ -413,7 +413,13 @@ else
#Checking if using 1.7.0_n
if [[ "${THIS_JVM_VER:18:1}" -eq "0" ]] && [[ "$temp_JAVA" -eq "$JAVA7" ]]; then
if [[ "${THIS_JVM_VER:20:1}" -eq "0" ]] || [[ "${THIS_JVM_VER:20:2}" -lt $JAVA65 ]]; then
- error="true"
+ #If Java is **less** than than 1.7.0_65 the next command will fail.
+ #Install will fail anyways if less than 1.7.0_65
+ #Will not fail if Java is 1.7.0_100 or greater
+ #Temporary fix to support Java 7 upgrades greater than 100
+ if [[ "${THIS_JVM_VER:20:3}" -lt $JAVA_65 ]]; then
+ error="true"
+ fi
fi
fi
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e208598d/install/installer/trafodion_apache_hadoop_install
----------------------------------------------------------------------
diff --git a/install/installer/trafodion_apache_hadoop_install b/install/installer/trafodion_apache_hadoop_install
deleted file mode 100755
index ca36122..0000000
--- a/install/installer/trafodion_apache_hadoop_install
+++ /dev/null
@@ -1,763 +0,0 @@
-#!/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 @@@
-
-#==============================================
-# Trafodion installation script. Setup Trafodion
-# environment, configuration of HBase with
-# Hbase-trx and co-processors need for Trafodion, and
-# install Trafodion build. All parameters from scripts
-# use configuration file.
-#==============================================
-
-function print_usage {
-cat << EOF
-
-This script will install Trafodion on Apache Hadoop.
-It will create a configuration file (if one has not been created),
-setup of the environment needed for Trafodion,
-configure HBase with Hbase-trx and co-processors needed,
-and install a specified Trafodion build.
-
-Options:
- --help Print this message and exit
- --accept_license If provided, the user agrees to accept all the
- provisions in the Trafodion license. This allows
- for automation by skipping the display and prompt of
- the Trafodion license.
- --config_file If provided, all install prompts will be
- taken from this file and not prompted for.
- --run_scanner If provided, the Trafodion scanner will run
- to check system configuration.
- --no_scanner If provided, the Trafodion scanner will not
- run to check system configuration.
-EOF
-}
-
-#==============================================
-#Parse input
-USER_CONFIG=""
-ACCEPT_LICENSE="N"
-RUN_SCANNER="N"
-
-while [[ $# -gt 0 ]]; do
- case "$1" in
- --help)
- print_usage
- exit -1
- ;;
- --accept_license)
- ACCEPT_LICENSE="Y"
- ;;
- --config_file)
- if [[ -z "$2" ]]; then
- echo "***ERROR: No value passed to param $1."
- print_usage
- exit -1
- fi
- USER_CONFIG=$2
- if [ -f $USER_CONFIG ]; then
- source $USER_CONFIG
- else
- echo "***ERROR: configuration file $USER_CONFIG does not exist"
- exit -1
- fi
- shift
- ;;
- --run_scanner)
- RUN_SCANNER="Y"
- selectedRun="true"
- if [[ $selectedNo == "true" ]]; then
- echo "***ERROR: Selected --run_scanner and --no_scanner. Invalid combination."
- exit -1
- fi
- ;;
- --no_scanner)
- RUN_SCANNER="N"
- selectedNo="true"
- if [[ $selectedRun == "true" ]]; then
- echo "***ERROR: Selected --run_scanner and --no_scanner. Invalid combination."
- exit -1
- fi
- ;;
- *)
- echo "***ERROR: unknown parameter '$1'"
- print_usage
- exit -1
- esac
- shift
-done
-
-
-#==============================================
-echo
-echo "******************************"
-echo " TRAFODION INSTALLATION START"
-echo "******************************"
-echo
-
-#==============================================
-# Default values
-
-export timestamp=$(date +%F-%H-%M-%S)
-export TRAF_LOGDIR="/var/log/trafodion"
-export INSTALL_LOG="$TRAF_LOGDIR/trafodion_apache_hadoop_install_$timestamp.log"
-export SCANNER_LOG="$TRAF_LOGDIR/trafodion_scanner_$timestamp.log"
-#export TRAF_WORKDIR="$( cd "$( dirname "$0" )" && pwd )/.."
-export TRAF_WORKDIR="/usr/lib/trafodion"
-export LOCAL_WORKDIR="$( cd "$( dirname "$0" )" && pwd )"
-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
-
-#Check not installing as userid Trafodion
-if [[ "$(whoami)" == "$TRAF_USER" ]]; then
- echo "***ERROR: The Trafodion username cannot be the same as the install username"
- exit -1
-fi
-
-# check that we are running from a userid with sudo access
-sudo echo "***INFO: testing sudo access"
-if [ $? -ne 0 ]; then
- echo "***ERROR: This script must be run from a userid with sudo access."
- exit -1
-fi
-
-#==============================================
-# Setup log & working directories
-
-sudo mkdir -p $TRAF_LOGDIR
-sudo chmod 777 $TRAF_LOGDIR
-touch $INSTALL_LOG
-sudo chmod 777 $INSTALL_LOG
-echo "***INFO: Log file located at $INSTALL_LOG"
-
-sudo mkdir -p $TRAF_CONFIG_DIR
-sudo chmod 777 $TRAF_CONFIG_DIR
-echo "***INFO: Config directory: $TRAF_CONFIG_DIR"
-
-# create a working directory
-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
-sudo chmod -R 777 $TRAF_WORKDIR
-#=============================================
-# Shutdown Trafodion if it is running
-
-userForTrafodion=`grep "$TRAF_USER:" /etc/passwd | wc -l`
-
-if [[ "$userForTrafodion" != "0" ]]; then
- isTrafUp=$(sudo su $TRAF_USER --login --command "sqcheck" 2>/dev/null)
-
- trafodionRunning=$(echo $isTrafUp | grep "The SQ environment is up" | wc -l)
- if [[ "$trafodionRunning" -eq "1" ]]; then
- echo "***ERROR: Trafodion is still running."
- echo -n "Stop Trafodion (Y/N), default is N: "
- read answer
-
- if [ -z $answer ]; then
- echo "***ERROR: Please stop Trafodion then rerun trafodion_apache_hadoop_install"
- echo "***ERROR: Change to trafodion userid then do a 'sqstop'"
- exit -1
- else
- if [[ "${answer}" =~ ^[Yy]$ ]]; then
- echo "***INFO: Stopping Trafodion instance."
- sudo su $TRAF_USER --login --command "sqstop"
- sudo su $TRAF_USER --login --command "ckillall"
- else
- echo "***ERROR: Please stop Trafodion then rerun trafodion_apache_hadoop_install"
- echo "***ERROR: Change to trafodion user id then do a 'sqstop'"
- exit -1
- fi
- fi
- fi
-fi
-
-#==============================================
-# config file
-
-# if user did not supply their own config file, use the default
-# or prompt to generate a new one.
-if [ -z "$USER_CONFIG" ]; then
- if [ -f $TRAF_CONFIG ]; then
- # strip out LOCAL_WORKDIR from config file, if there.
- # LOCAL_WORKDIR was erroneously saved to the config file in
- # previous versions of the installer scripts and since the config
- # file hangs around between installer runs it needs to be stripped
- # out here before we source in the config file
- cp $TRAF_CONFIG config_temp
- sudo grep -vE "LOCAL_WORKDIR" config_temp > $TRAF_CONFIG 2> /dev/null
- source $TRAF_CONFIG
- fi
-
- # prompt user for configuration info
- $LOCAL_WORKDIR/traf_apache_hadoop_config_setup | tee -a $INSTALL_LOG
- if [ ${PIPESTATUS[0]} != "0" ]; then
- echo "***ERROR: Error while running traf_apache_hadoop_config_setup." | tee -a $INSTALL_LOG
- echo "***ERROR: No configuration file created." | tee -a $INSTALL_LOG
- exit -1
- fi
-else
- # copy the user's config file to the default location
- sudo cp $USER_CONFIG $TRAF_CONFIG
- if [ $? -ne 0 ]; then
- echo "***ERROR: unable to copy $USER_CONFIG to $TRAF_CONFIG"
- exit -1
- fi
- #$LOCAL_WORKDIR/traf_getHadoopNodes | tee -a $INSTALL_LOG
- sudo chmod 777 $TRAF_CONFIG
-fi
-
-source $TRAF_CONFIG
-if [ $? -ne 0 ]; then
- echo "***ERROR: unable to source $TRAF_CONFIG"
- exit -1
-fi
-
-sudo chmod 777 $TRAF_CONFIG
-sed -i '/INSTALL_LOG\=/d' $TRAF_CONFIG
-echo "export INSTALL_LOG=\"$INSTALL_LOG\"" >> $TRAF_CONFIG
-sudo chmod 777 $TRAF_CONFIG
-source $TRAF_CONFIG
-
-
-#==============================================
-#Check if doing an upgrade
-
-if [[ $CONFIG_COMPLETE ]]; then
- userForTrafodion=`grep "$TRAF_USER:" /etc/passwd | wc -l`
- if [[ "$userForTrafodion" == "0" ]]; then
- UPGRADE_TRAF=false;
- else
- UPGRADE_TRAF=true;
- fi
-
- #Add upgrade variable to config file
- sudo chmod 777 $TRAF_CONFIG
- sed -i '/UPGRADE_TRAF\=/d' $TRAF_CONFIG
- echo "export UPGRADE_TRAF=\"$UPGRADE_TRAF\"" >> $TRAF_CONFIG
- sudo chmod 777 $TRAF_CONFIG
- source $TRAF_CONFIG
-fi
-
-#==============================================
-#Run Trafodion scanner
-
-if [[ $UPGRADE_TRAF == "true" ]]; then
- echo "***INFO: Trafodion scanner will not be run."
-else
- if [[ "$RUN_SCANNER" == "Y" ]]; then
- echo "***INFO: Running Trafodion Scanner"
- $LOCAL_WORKDIR/tools/trafodion_scanner -l $SCANNER_LOG -t $TRAF_CONFIG \
- -c $LOCAL_WORKDIR/tools/trafodion_scanner.cfg | tee -a $INSTALL_LOG
-
- returnCode=${PIPESTATUS[0]}
-
- case $returnCode in
-
- 2|1)
- echo "***ERROR: Error while running trafodion_scanner."
- echo "***ERROR: Please review logs and fix listed issue(s)."
- exit -1
- ;;
- 3|0)
- echo "***INFO: Trafodion scanner ran without error. Install will continue..."
- ;;
- *)
- echo "***ERROR: Error while running trafodion_scanner."
- exit -1
- ;;
- esac
- else
- echo "***INFO: Trafodion scanner will not be run."
- fi
-fi
-
-#=============================================
-
-if [ $node_count -eq 1 ]; then
- TRAF_PDSH=""
- TRAF_PDCP=""
-else
- TRAF_PDSH="pdsh -R exec $MY_NODES $PDSH_SSH_CMD"
- TRAF_PDCP="pdcp -R ssh $MY_NODES"
-fi
-
-sed -i '/ACCEPT_LICENSE\=/d' $TRAF_CONFIG
-echo "export ACCEPT_LICENSE=\"$ACCEPT_LICENSE\"" >> $TRAF_CONFIG
-
-
-#==============================================
-# untar package and files into /usr/lib/trafodion (the new TRAF_WORKDIR)
-# This will be a global location that all tar files are untarred into
-
-# if we have the package tar file we need to extract
-# trafodion core and dcs and rest-server builds from it
-if [ ! -z $TRAF_PACKAGE ]; then
-
- # create directory to contain build tar files using the
- # timestamp from the package filename
- traf_filename=$(basename "$TRAF_PACKAGE")
- UNTAR_DIR="$TRAF_WORKDIR/${traf_filename%.tar.gz}"
- sudo mkdir -p $UNTAR_DIR
- sudo chmod 755 $UNTAR_DIR
-
- # untar the package
- sudo tar -xzf $TRAF_PACKAGE --directory=$UNTAR_DIR
-
- build_file=$(ls $UNTAR_DIR | grep "trafodion_.*server")
- if [[ -z $build_file ]]; then
- echo "***ERROR: trafodion_server-*.tgz could not be found in $UNTAR_DIR"
- exit -1
- fi
- TRAF_BUILD=$UNTAR_DIR/$build_file
-
- build_file=$(ls $UNTAR_DIR | grep "dcs")
- DCS_BUILD=$UNTAR_DIR/$build_file
-
- build_file=$(ls $UNTAR_DIR | grep "rest")
- if [ -z $build_file ]; then
- REST_BUILD=""
- else
- REST_BUILD=$UNTAR_DIR/$build_file
- fi
-
-else
- # we don't have a package and only have the trafodion and dcs build tar files
- # we can't use the package filename timestamp since we don't have a package tar
- # file so we'll just create a directory using the current time
- UNTAR_DIR="$TRAF_WORKDIR/traf_$(date +%F_%H%M)"
- sudo mkdir -p $UNTAR_DIR
- sudo chmod 777 $UNTAR_DIR
-
- sudo cp $TRAF_BUILD $UNTAR_DIR
- if [ $? -ne 0 ]; then
- echo "***ERROR: unable to copy trafodion build ($TRAF_BUILD) to $UNTAR_DIR"
- exit -1
- fi
-
- sudo cp $DCS_BUILD $UNTAR_DIR
- if [ $? -ne 0 ]; then
- echo "***ERROR: unable to copy DCS build ($DCS_BUILD) to $UNTAR_DIR"
- exit -1
- fi
-
- if [ ! -z $REST_BUILD ]; then
- sudo cp $REST_BUILD $UNTAR_DIR
- if [ $? -ne 0 ]; then
- echo "***ERROR: unable to copy REST build ($REST_BUILD) to $UNTAR_DIR"
- exit -1
- fi
- fi
-
- build_file=$(basename $TRAF_BUILD)
- TRAF_BUILD=$UNTAR_DIR/$build_file
-
- sudo tar -xzf $TRAF_BUILD --directory=$UNTAR_DIR
-
- build_file=$(basename $DCS_BUILD)
- DCS_BUILD=$UNTAR_DIR/$build_file
-
- build_file=$(basename $REST_BUILD)
- REST_BUILD=$UNTAR_DIR/$build_file
-
-fi
-
-sed -i '/TRAF_BUILD\=/d' $TRAF_CONFIG
-echo "export TRAF_BUILD=\"$TRAF_BUILD\"" >> $TRAF_CONFIG
-sed -i '/DCS_BUILD\=/d' $TRAF_CONFIG
-echo "export DCS_BUILD=\"$DCS_BUILD\"" >> $TRAF_CONFIG
-sed -i '/REST_BUILD\=/d' $TRAF_CONFIG
-echo "export REST_BUILD=\"$REST_BUILD\"" >> $TRAF_CONFIG
-
-# add the untar directory to the config file
-sed -i '/UNTAR_DIR\=/d' $TRAF_CONFIG
-echo "export UNTAR_DIR=\"$UNTAR_DIR\"" >> $TRAF_CONFIG
-source $TRAF_CONFIG
-
-#============================================
-#If user supplied a config file must now check if install_features file
-#exists
-
-if [[ -n "$USER_CONFIG" ]]; then
- #Check if install_features file exists
- if [[ -z $CDH_5_3_HDP_2_2_SUPPORT ]]; then
- install_features_path=$(tar -tf $TRAF_BUILD | grep "install_features")
- if [[ ! -z $install_features_path ]]; then
- tar -xzf $TRAF_BUILD $install_features_path
- source $install_features_path
- echo "export CDH_5_3_HDP_2_2_SUPPORT=\"$CDH_5_3_HDP_2_2_SUPPORT\"" >> $TRAF_CONFIG
- else
- CDH_5_3_HDP_2_2_SUPPORT="N"
- echo "export CDH_5_3_HDP_2_2_SUPPORT=\"$CDH_5_3_HDP_2_2_SUPPORT\"" >> $TRAF_CONFIG
- fi
- fi
-fi
-
-#==============================================
-#Check to make sure HBase Version is the correct version
-
-
-for node in $HADOOP_NODES;
-do
- ssh -q -n $node 'echo "exit" | hbase shell &> $HOME/hbaseVersion.txt'
- hbaseInstalled=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | wc -l)
- if [[ $hbaseInstalled -eq "1" ]]; then
-
- version=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk {'print$2'})
- hbaseVersion=$(echo "${version#*.}"| cut -f1 -d".")
- if [[ $hbaseVersion -lt "98" ]]; then
- echo "***ERROR: HBase installed must be 0.98"
- exit -1
- fi
- hbaseVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk {'print$2'})
- break
- fi
-
-done
-
-
-sudo chmod 777 $TRAF_CONFIG
-sed -i '/hbaseVersion\=/d' $TRAF_CONFIG
-echo "export hbaseVersion=\"$hbaseVersion\"" >> $TRAF_CONFIG
-sudo chmod 777 $TRAF_CONFIG
-sudo rm -rf hbaseVersion.txt
-
-trafodionFullName=$(basename $TRAF_BUILD)
-echo "***DEBUG: trafodionFullName=$trafodionFullName"
-#Debug version
-trafodionVersion=$(echo $trafodionFullName | sed 's/trafodion_.*server-//' | sed 's/-debug//' | sed 's/.tgz//')
-
-echo "***INFO: Trafodion version = $trafodionVersion"
-#==============================================
-# Determine Trafodion version by parsing it
-# from the trafodion_server tar file.
-# Determine Java version
-
-cd $UNTAR_DIR
-
-# clean up any old files left lying around
-sudo rm -rf $UNTAR_DIR/export/lib 2>/dev/null
-
-# extract the hbase-trx jar file (and others) from the build tar file
-sudo tar -xzf $TRAF_BUILD export/lib 2>&1 | tee -a $INSTALL_LOG
-if [ ${PIPESTATUS[0]} != 0 ]; then
- echo "***ERROR: unable to find export/lib/ directory in $TRAF_BUILD" 2>&1 | tee -a $INSTALL_LOG
- exit -1
-fi
-
-# Detect java version
-
-for node in $HADOOP_NODES
-do
- java_exec=$(ssh -q -n $node ps -C java --noheader -o pid,user,cmd \
- | grep --max-count=1 "hbase" \
- | awk '{print $3}' )
- echo "***DEBUG: HBase's java_exec=$java_exec"
- if [ ! -z $java_exec ]; then
- JAVA_VERSION=$(ssh -q -n $node $java_exec -version 2>&1)
- break;
- echo "***ERROR: Unable to determine HBase's Java version"
- echo "***ERROR: Check that HBase is up on node $HOSTNAME"
- exit -1
- fi
-done
-
-if [[ -z $JAVA_VERSION ]]; then
- echo "***ERROR: Unable to determine HBase's Java version"
- echo "***ERROR: Check that apache HBase is up"
- exit -1
-else
- JAVA_VERSION=$(echo $JAVA_VERSION \
- | grep version \
- | awk '{print $3}' \
- | sed -e 's@"@@g')
-fi
-
-# test for java 1.7
-java_17=$(echo $JAVA_VERSION | grep "1.7." | wc -l)
-
-# if not java 1.7 then test for java 1.6
-if [ "$java_17" == "0" ]; then
- java_16=$(echo $JAVA_VERSION | grep "1.6." | wc -l)
-
- # if not 1.7 nor 1.6 then we have a problem
- if [ "$java_16" == "0" ]; then
- echo "***ERROR: Unsupported HBase java version. HBase java version must be 1.6 or 1.7"
- exit -1
- else
- JAVA_VERSION="1.6"
- fi
-else
- JAVA_VERSION="1.7"
-fi
-
-sudo chmod 777 $TRAF_CONFIG
-sed -i '/JAVA_VERSION\=/d' $TRAF_CONFIG
-echo "export JAVA_VERSION=\"$JAVA_VERSION\"" >> $TRAF_CONFIG
-sudo chmod 777 $TRAF_CONFIG
-#==============================================
-# Run trafodion_setup
-echo
-echo "******************************"
-echo " TRAFODION SETUP"
-echo "******************************"
-echo
-
-if [[ "$UPGRADE_TRAF" == "true" ]]; then
-
- sed -i -e "s@export NODE_LIST=.*@export NODE_LIST=\"$NODE_LIST\"@" $HOME_DIR/$TRAF_USER/.bashrc
- sed -i -e "s@export MY_NODES=.*@export MY_NODES=\"$NODE_LIST\"@" $HOME_DIR/$TRAF_USER/.bashrc
-
- for node in $NODE_LIST
- do
- userForTrafodion=$(ssh -q -n $node grep "$TRAF_USER:" /etc/passwd | wc -l)
- if [[ "$userForTrafodion" == 0 ]]; then
- $LOCAL_WORKDIR/traf_setup | tee -a $INSTALL_LOG
- if [ ${PIPESTATUS[0]} != "0" ]; then
- echo "***ERROR: Error while running traf_setup." | tee -a $INSTALL_LOG
- echo "***ERROR: Setup not complete, review logs." | tee -a $INSTALL_LOG
- echo "***ERROR: Exiting...." | tee -a $INSTALL_LOG
- exit -1
- else
- echo "***INFO: Trafodion environment setup completed" | tee -a $INSTALL_LOG
- fi
- fi
- done
-
-else
- $LOCAL_WORKDIR/traf_setup | tee -a $INSTALL_LOG
-
- if [ ${PIPESTATUS[0]} != "0" ]; then
- echo "***ERROR: Error while running traf_setup." | tee -a $INSTALL_LOG
- echo "***ERROR: Setup not complete, review logs." | tee -a $INSTALL_LOG
- echo "***ERROR: Exiting...." | tee -a $INSTALL_LOG
- exit -1
- else
- echo "***INFO: Trafodion environment setup completed" | tee -a $INSTALL_LOG
- fi
-fi
-
-# create working directories on all nodes
-$TRAF_PDSH sudo mkdir -p $TRAF_WORKDIR
-$TRAF_PDSH sudo chmod 777 $TRAF_WORKDIR
-$TRAF_PDSH sudo mkdir -p $LOCAL_WORKDIR
-$TRAF_PDSH sudo chmod 777 $LOCAL_WORKDIR
-
-# copy config file to all nodes
-if [ $node_count -ne 1 ]; then
- cp $TRAF_CONFIG $LOCAL_WORKDIR
- $TRAF_PDCP $LOCAL_WORKDIR/$TRAF_CONFIG_FILE $LOCAL_WORKDIR
- $TRAF_PDSH sudo mkdir -p $TRAF_CONFIG_DIR
- $TRAF_PDSH sudo cp $LOCAL_WORKDIR/$TRAF_CONFIG_FILE $TRAF_CONFIG_DIR
- $TRAF_PDSH sudo chmod 777 $TRAF_CONFIG
-fi
-
-
-$LOCAL_WORKDIR/traf_sqconfig
-if [ $? != 0 ]; then
- echo "***ERROR: traf_sqconfig script failed."
- echo "***ERROR: sqconfig file not created."
- exit -1
-fi
-#Reserve DCS Ports
-
-echo "***INFO: Reserving DCS ports"
-trafodion_ports=${DCS_MASTER_PORT:-23400},${DCS_MASTER_INFO_PORT:-24400}
-reservedTrafodionPorts="net.ipv4.ip_local_reserved_ports = ${trafodion_ports}"
-
-for node in $NODE_LIST
-do
- redhatSystem=$(ssh -q -n $node '/sbin/sysctl net.ipv4.ip_local_reserved_ports | wc -l')
- if [[ "$redhatSystem" -ge "1" ]]; then
- reserved_ports=$(ssh -q -n $node '/sbin/sysctl net.ipv4.ip_local_reserved_ports' | awk -F'=' '{print $2;}' | sed 's/^ //')
- ssh -q -n $node 'sudo chmod 777 /etc/sysctl.conf'
- ssh -q -n $node 'sudo sed -i '/net.ipv4.ip_local_reserved_ports""\=*/d' /etc/sysctl.conf'
-
- if [[ -z "${reserved_ports}" ]]; then
- ssh -q -n $node "sudo echo "$reservedTrafodionPorts" >> /etc/sysctl.conf"
- else
- ssh -q -n $node "sudo echo "$reservedTrafodionPorts","$reserved_ports" >> /etc/sysctl.conf"
- fi
- ssh -q -n $node 'sudo chmod 644 /etc/sysctl.conf'
- ssh -q -n $node 'sudo /sbin/sysctl -p' 2>&1 > /dev/null
- else
- echo "***ERROR: Unable to reserve DCS ports (${trafodion_ports})."
- exit -1
- fi
-done
-
-#Set Max kernel pid
-
-$TRAF_PDSH sudo sysctl -w kernel.pid_max=65535
-
-
-#Create install directory
-if [[ "$node_count" -ne "1" ]]; then
- $TRAF_PDSH sudo mkdir -p /$HOME_DIR/$TRAF_USER/installer &> /dev/null
-fi
-
-#Copy over traf_authentication_config file to all nodes
-if [[ "$LDAP_SECURITY" == "Y" ]]; then
- echo "***INFO: Copying $LDAP_AUTH_FILE to Trafodion home dir"
-
- if [[ "$node_count" -eq "1" ]]; then
- sudo cp -r $LOCAL_WORKDIR/$LDAP_AUTH_FILE $HOME_DIR/$TRAF_USER
- sudo chown trafodion.trafodion $HOME_DIR/$TRAF_USER/$LDAP_AUTH_FILE
- sudo chmod 750 $HOME_DIR/$TRAF_USER/$LDAP_AUTH_FILE
- if [[ $LDAP_LEVEL == "2" ]] || [[ $LDAP_LEVEL == "1" ]]; then
- echo "***INFO: Copying $LDAP_CERT to Trafodion home dir"
- sudo cp -r $LDAP_CERT $HOME_DIR/$TRAF_USER
- sudo chown trafodion.trafodion $HOME_DIR/$TRAF_USER/$LDAP_CERT_BASE
- sudo chmod 750 $HOME_DIR/$TRAF_USER/$LDAP_CERT_BASE
- fi
- else
- $TRAF_PDCP $LOCAL_WORKDIR/$LDAP_AUTH_FILE $HOME
- $TRAF_PDSH sudo cp -r $HOME/$LDAP_AUTH_FILE $HOME_DIR/$TRAF_USER
- $TRAF_PDSH sudo chown trafodion.trafodion $HOME_DIR/$TRAF_USER/$LDAP_AUTH_FILE
- $TRAF_PDSH sudo chmod 750 $HOME_DIR/$TRAF_USER/$LDAP_AUTH_FILE
- if [[ $LDAP_LEVEL == "2" ]] || [[ $LDAP_LEVEL == "1" ]]; then
- echo "***INFO: Copying $LDAP_CERT to Trafodion home dir"
- $TRAF_PCP $LDAP_CERT $HOME
- $TRAF_PDSH sudo cp -r $HOME/$LDAP_CERT_BASE $HOME_DIR/$TRAF_USER
- $TRAF_PDSH sudo chown trafodion.trafodion $HOME_DIR/$TRAF_USER/$LDAP_CERT_BASE
- $TRAF_PDSH sudo chmod 750 $HOME_DIR/$TRAF_USER/$LDAP_CERT_BASE
- fi
- fi
-fi
-#=============================================
-#Run trafodion_mods
-
-echo
-echo "******************************"
-echo " TRAFODION MODS"
-echo "******************************"
-echo
-
-hbase_trx_jar=hbase-trx-hbase*.jar
-
-echo "***INFO: copying $hbase_trx_jar to HBase lib"
-if [ $node_count -ne 1 ]; then
- # if more than one node then copy to all nodes
- $TRAF_PDSH sudo rm -rf $HBASE_HOME/lib/hbase-trx* 2>/dev/null
- $TRAF_PDSH sudo chmod 777 $UNTAR_DIR/export/lib
- $TRAF_PDSH sudo cp $UNTAR_DIR/export/lib/$hbase_trx_jar $LOCAL_WORKDIR
- $TRAF_PDSH sudo cp $LOCAL_WORKDIR/$hbase_trx_jar $LOCAL_WORKDIR
- $TRAF_PDSH sudo cp $LOCAL_WORKDIR/$hbase_trx_jar $HBASE_HOME/lib
- $TRAF_PDSH sudo chmod 644 $HBASE_HOME/lib/$hbase_trx_jar
- $TRAF_PDSH sudo rm $LOCAL_WORKDIR/$hbase_trx_jar 2>/dev/null
-else
- sudo rm -rf $HBASE_HOME/lib/hbase-trx* 2>/dev/null
- sudo mkdir -p $TRAF_WORKDIR 2>/dev/null
- sudo chmod 777 $TRAF_WORKDIR
- sudo chmod 777 $UNTAR_DIR/export/lib
- sudo cp $UNTAR_DIR/export/lib/$hbase_trx_jar $TRAF_WORKDIR
- sudo cp $TRAF_WORKDIR/$hbase_trx_jar $HBASE_HOME/lib
- sudo chmod 644 $HBASE_HOME/lib/$hbase_trx_jar
-
-fi
-
-
-# modify hbase-site.xml directly
-echo "***INFO: modifying hbase-site.xml"
-HBASE_XML=$HBASE_HOME/conf/hbase-site.xml
-sudo cp -f $HBASE_XML ${HBASE_XML}.orig
-
-if [[ `grep -c "TrxRegionObserver" $HBASE_XML` -eq 0 ]]; then
-
- sudo sed -i '/<\/configuration>/d' $HBASE_XML
-
- sudo cat >> $HBASE_XML <<EOF
-<property>
- <name>hbase.client.scanner.caching</name>
- <value>100</value>
-</property>
-<property>
- <name>hbase.coprocessor.region.classes</name>
- <value>
- org.apache.hadoop.hbase.coprocessor.transactional.TrxRegionObserver,
- org.apache.hadoop.hbase.coprocessor.transactional.TrxRegionEndpoint,
- org.apache.hadoop.hbase.coprocessor.AggregateImplementation
- </value>
-</property>
-<property>
- <name>hbase.hregion.impl</name>
- <value>org.apache.hadoop.hbase.regionserver.transactional.TransactionalRegion</value>
-</property>
-</configuration>
-EOF
-
- if [ $node_count -ne 1 ]; then
- $TRAF_PDSH sudo cp -f ${HBASE_XML}.orig $HBASE_HOME/conf
- $TRAF_PDSH sudo cp -f $HBASE_XML $HBASE_HOME/conf
- fi
-fi
-
-# restart HBase
-$HBASE_HOME/bin/stop-hbase.sh
-sleep 5
-$HBASE_HOME/bin/start-hbase.sh
-if [[ $? -eq 0 ]]; then
- echo "***INFO: HBase restart completed successfully"
-else
- echo "***ERROR: Failed to restart apache HBase"
- exit -1
-fi
-
-
-echo "***INFO: Trafodion Mods ran successfully."
-
-#==============================================
-#Install Trafodion
-echo
-echo "******************************"
-echo " TRAFODION START"
-echo "******************************"
-echo
-sudo mkdir -p $SQ_ROOT
-sudo chown $TRAF_USER.trafodion $SQ_ROOT
-/bin/cp -rf $LOCAL_WORKDIR/traf_config $TRAF_WORKDIR/installer/traf_config
-
-sudo su $TRAF_USER --command "$TRAF_WORKDIR/installer/traf_config" 2>&1 | tee -a $INSTALL_LOG
-
-if [ ${PIPESTATUS[0]} != "0" ]; then
- echo "***ERROR: Error while running traf_config." | tee -a $INSTALL_LOG
- echo "***ERROR: Setup not complete, review logs." | tee -a $INSTALL_LOG
- echo "***ERROR: Exiting...." | tee -a $INSTALL_LOG
- exit -1
-fi
-
-#==============================================
-echo
-echo "*********************************"
-echo " TRAFODION INSTALLATION COMPLETE"
-echo "*********************************"
-echo
[2/2] incubator-trafodion git commit: Merge [TRAFODION-1951] Fix for
JAVA checking
Posted by sv...@apache.org.
Merge [TRAFODION-1951] Fix for JAVA checking
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/7b5e5ea0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/7b5e5ea0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/7b5e5ea0
Branch: refs/heads/release2.0
Commit: 7b5e5ea010789a063e40dcb8d7fdcc8d3f6fc704
Parents: b3f7856 e208598
Author: Steve Varnau <st...@esgyn.com>
Authored: Thu May 5 23:20:05 2016 +0000
Committer: Steve Varnau <st...@esgyn.com>
Committed: Thu May 5 23:20:05 2016 +0000
----------------------------------------------------------------------
.../installer/traf_apache_hadoop_config_setup | 842 -------------------
install/installer/traf_config_check | 8 +-
.../installer/trafodion_apache_hadoop_install | 763 -----------------
3 files changed, 7 insertions(+), 1606 deletions(-)
----------------------------------------------------------------------