How to install and configure Oracle Traffic Director 12c - fully unattended

Posted by Dirk Nachbar on Friday, September 15, 2017
As I am not a fan of clicking through several Configuration Wizards, I am trying to script as much as possible.
Here is a fully unattended way of how to install and configure Oracle Traffic Director 12.2.1.3.0.

Following pre requirements are necessary:
  • you need a certified Linux Server, e.g. with Oracle Enterprise Linux 7.3
  • an oracle user on the Linux Server
  • all required packages as per documentation and the necessary kernel settings and so on
  • create an ORACLE_BASE, e.g. /u00/app/oracle
Now you need to create an install/stage directory under $ORACLE_BASE:

cd /u00/app/oracle
mkdir install

Now place in the above create following Software Installation files from Oracle Technology Network:

Copy all above listed files to your Linux Server under $ORACLE_BASE/install and extract the Oracle WebLogic Server Infrastructure Installer and the Oracle Traffic Director

cd /u00/app/oracle/install
unzip fmw_12.2.1.3.0_infrastructure_Disk1_1of1.zip
unzip fmw_12.2.1.3.0_otd_linux64_Disk1_1of1.zip

Next you need to create several files for the unattended installation and configuration:
  • setLocalEnv.sh: This file contains all the required variables for the installation and configuration
  • silent_jdk.sh: Performs the installation of the JDK 1.8 Update 144
  • silent_wls_infra.sh: Performs the installation of the Oracle WebLogic Server Infrastructure 12.2.1.3.0
  • respone_file_wls_infra.rsp: Response file for the WebLogic Server Infrastructure 12.2.1.3.0 installation
  • silent_otd.sh: Performs the installation of Oracle Traffic Director 12.2.1.3.0 on top of the Oracle WebLogic Server Infrastructure 12.2.1.3.0
  • response_file_otd.rsp: Response file for the Oracle Traffic Director 12.2.1.3.0 installation
  • oraInst.loc: contains the location of the Oracle Inventory, used by silent_wls_infra.sh and silent_otd.sh
  • crDomain.sh: Shell script wrapper for the configuration of the Oracle Traffic Director as "Collocated Installation", which means the Oracle Traffic Director will reside inside a WebLogic Domain with Restricted JRF, so no Oracle Metadata Repository is required
  • crDomain.py: Python Script for the Domain creation including generation of a sample Traffic Director Instance and Configuration
All the above mentioned files should be created under $ORACLE_BASE/install

setLocalEnv.sh
# Location to the directory in which the create Domain scripts are residing
export SCRIPT_HOME=$PWD

# Software Defintions
export JDK_SOURCE=jdk-8u144-linux-x64.tar.gz
export JDK_REL=jdk1.8.0_144

# Directories
export ORACLE_BASE=/u00/app/oracle
export INT_ORACLE_HOME=$ORACLE_BASE/product/fmw-otd-12.2.1.3.0
export WL_HOME=$INT_ORACLE_HOME/wlserver
export WLST_HOME=$INT_ORACLE_HOME/oracle_common/common/bin
export MW=$INT_ORACLE_HOME
export DOMAIN_BASE=$ORACLE_BASE/user_projects/domains
export APPLICATION_BASE=$ORACLE_BASE/user_projects/applications
export APP_VZ=$APPLICATION_BASE
export JAVA_HOME=$ORACLE_BASE/product/$JDK_REL

# Domain specific
export TEMPLATE=$WL_HOME/common/templates/wls/wls.jar
export DOMAIN_NAME=OTDDOMAIN

# AdminServer
export AS_NAME=${DOMAIN_NAME}AdminServer
export ADM_USER=weblogic
export ADM_PWD=welcome1
export ADMINPORT=7001 
export ADMINPORTSSL=7101
export AS_HOST=`hostname -f`
export MACHINE_NAME=`hostname -s`

# NodeManager
export NM_LISTENADDRESS=`hostname -f`
export NM_TYPE=SSL
export NM_PORT=5556
export NM_USERNAME=nodemanager
export NM_PWD=welcome1

# OTD Configuration
export OTD_CONFIGNAME=test
export OTD_SERVERNAME=myserver
export OTD_SERVERPORT=7777
export OTD_ORIGINSERVER=weblogic122130:7003

silent_jdk.sh
#!/bin/bash
#=====================================================================
#
# $Id: silent_jdk.sh $
#
# PURPOSE: Script to install JDK
#
# PARAMETERS: none
#
# NOTES:   setLocalEnv.sh must be present and aligned
#
# AUTHOR:  Dirk Nachbar, https://dirknachbar.blogspot.com
#
# MODIFIED:
#
#
#=====================================================================
 
source setLocalEnv.sh
 
mkdir -p ${ORACLE_BASE}/product/
cp ${JDK_SOURCE} ${ORACLE_BASE}/product/
cd ${ORACLE_BASE}/product/
gunzip ${JDK_SOURCE}
JDK_TAR=${JDK_SOURCE::-3}
tar -xvf ${JDK_TAR}
rm ${ORACLE_BASE}/product/${JDK_TAR}

silent_wls_infra.sh
#!/bin/bash
#=====================================================================
#
# $Id: silent_wls_infra.sh $
#
# PURPOSE: Script to install WebLogic Infrastructure
#
# PARAMETERS: none
#
# NOTES:   setLocalEnv.sh must be present and aligned
#
# AUTHOR:  Dirk Nachbar, https://dirknachbar.blogspot.com
#
# MODIFIED:
#
#
#=====================================================================
 
source setLocalEnv.sh
 
export PATH=$JAVA_HOME/bin:$PATH
 
java -jar fmw_12.2.1.3.0_infrastructure.jar -silent -responseFile ${SCRIPT_HOME}/response_file_wls_infra.rsp -jreLoc ${JAVA_HOME} -invPtrLoc ${SCRIPT_HOME}/oraInst.loc

reponse_file_wls_infra.rsp
[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#Set this to true if you wish to skip software updates
DECLINE_AUTO_UPDATES=true
#My Oracle Support User Name
MOS_USERNAME=
#My Oracle Support Password
MOS_PASSWORD=<SECURE VALUE>
#If the Software updates are already downloaded and available on your local system, then specify the path to the directory where these patches are available and set SPECIFY_DOWNLOAD_LOCATION to true
AUTO_UPDATES_LOCATION=
#Proxy Server Name to connect to My Oracle Support
SOFTWARE_UPDATES_PROXY_SERVER=
#Proxy Server Port
SOFTWARE_UPDATES_PROXY_PORT=
#Proxy Server Username
SOFTWARE_UPDATES_PROXY_USER=
#Proxy Server Password
SOFTWARE_UPDATES_PROXY_PASSWORD=<SECURE VALUE>
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/u00/app/oracle/product/fmw-otd-12.2.1.3.0
#Set this variable value to the Installation Type selected. e.g. Fusion Middleware Infrastructure, Fusion Middleware Infrastructure With Examples.
INSTALL_TYPE=Fusion Middleware Infrastructure
#Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name.
MYORACLESUPPORT_USERNAME=
#Provide the My Oracle Support Password
MYORACLESUPPORT_PASSWORD=<SECURE VALUE>
#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration
DECLINE_SECURITY_UPDATES=true
#Set this to true if My Oracle Support Password is specified
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
#Provide the Proxy Host
PROXY_HOST=
#Provide the Proxy Port
PROXY_PORT=
#Provide the Proxy Username
PROXY_USER=
#Provide the Proxy Password
PROXY_PWD=<SECURE VALUE>
#Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http/Https]]://[repeater host]:[repeater port]
COLLECTOR_SUPPORTHUB_URL=


oraInst.loc
# Align the two values to your environment
inst_group=oinstall
inventory_loc=/u00/app/oracle/oraInventory

silent_otd.sh
#!/bin/bash
#=====================================================================
#
# $Id: silent_otd.sh $
#
# PURPOSE: Script to install Oracle Traffic Director
#           on top of existing WebLogic Server Infrastructure Installation
#
# PARAMETERS: none
#
# NOTES:   setLocalEnv.sh must be present and aligned
#
# AUTHOR:  Dirk Nachbar, https://dirknachbar.blogspot.com
#
# MODIFIED:
#
#
#=====================================================================
 
source setLocalEnv.sh
 
./fmw_12.2.1.3.0_otd_linux64.bin -silent -responseFile ${SCRIPT_HOME}/response_file_otd.rsp -jreLoc ${JAVA_HOME} -invPtrLoc ${SCRIPT_HOME}/oraInst.loc

response_file_otd.rsp
[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#Set this to true if you wish to skip software updates
DECLINE_AUTO_UPDATES=true
#My Oracle Support User Name
MOS_USERNAME=
#My Oracle Support Password
MOS_PASSWORD=<SECURE VALUE>
#If the Software updates are already downloaded and available on your local system, then specify the path to the directory where these patches are available and set SPECIFY_DOWNLOAD_LOCATION to true
AUTO_UPDATES_LOCATION=
#Proxy Server Name to connect to My Oracle Support
SOFTWARE_UPDATES_PROXY_SERVER=
#Proxy Server Port
SOFTWARE_UPDATES_PROXY_PORT=
#Proxy Server Username
SOFTWARE_UPDATES_PROXY_USER=
#Proxy Server Password
SOFTWARE_UPDATES_PROXY_PASSWORD=<SECURE VALUE>
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/u00/app/oracle/product/fmw-otd-12.2.1.3.0
#Set this variable value to the Installation Type selected as either Standalone Forms Builder OR Forms and Reports Deployment
INSTALL_TYPE=Collocated OTD (Managed through WebLogic server)

crDomain.sh
#!/bin/bash
#=====================================================================
#
# $Id: crDomain.sh $
#
# PURPOSE: Script to call the Python Script crDomain.py
#
# PARAMETERS: none
#
# NOTES:   setLocalEnv.sh must be present and aligned
#
# AUTHOR:  Dirk Nachbar, https://dirknachbar.blogspot.com
#
# MODIFIED:
#
#
#=====================================================================

# set -x

# Set Start Time
start_time=$(date +%s)

echo ${DOMAIN_NAME}

source $PWD/setLocalEnv.sh

echo $ORACLE_HOME


function warten
{
echo " "
echo "ENTER to proceed ..."
read
echo "The Installation Process is started ..."
}

echo "======================================================================================"
echo " Program  : crDomain.sh                                                ........"
echo "======================================================================================"

if [ -z "${WLST_HOME}" ]; then
    echo "Environment not correctly set - please verify"
    exit 1
fi

if ! test -d "${DOMAIN_BASE}/${DOMAIN_NAME}"; then
   echo "=================================================="
   echo "Domain will be installed ..."
   echo "=================================================="
   if [  -z "${ADM_PWD}"  -o -z "${TEMPLATE}" -o -z "${ADMINPORT}" -o -z "${MW}" -o -z "${ADMINPORTSSL}" -o -z " ${DOMAIN_NAME}" ]; then
      echo "Environment not set - Exit"
      exit 1
   fi

   # In case we are facing problems with /dev/random
   export CONFIG_JVM_ARGS=-Djava.security.egd=file:/dev/./urandom:$CONFIG_JVM_ARGS

   ${WLST_HOME}/wlst.sh ${SCRIPT_HOME}/crDomain.py 

   mkdir -p  ${DOMAIN_BASE}/${DOMAIN_NAME}/servers/${AS_NAME}/security
   echo "username=${ADM_USER}" >  ${DOMAIN_BASE}/${DOMAIN_NAME}/servers/${AS_NAME}/security/boot.properties
   echo "password=${ADM_PWD}" >> ${DOMAIN_BASE}/${DOMAIN_NAME}/servers/${AS_NAME}/security/boot.properties

crDomain.py
#!/usr/bin/python

# Things to do:
# Log output in File via redirect()

import os, sys
v_asName=os.environ['AS_NAME']
v_asUser=os.environ['ADM_USER']
v_webpw=os.environ['ADM_PWD']
v_adminport=os.environ['ADMINPORT']
v_adminportssl=os.environ['ADMINPORTSSL']
v_domainName=os.environ['DOMAIN_NAME']
v_template=os.environ['TEMPLATE']
v_javaHome=os.environ['JAVA_HOME']
v_setup_domain_base=os.environ['DOMAIN_BASE']
v_setup_application_base=os.environ['APPLICATION_BASE']
v_OracleHome=os.environ['INT_ORACLE_HOME']
v_MachineName=os.environ['MACHINE_NAME']
v_nmListenAddress=os.environ['NM_LISTENADDRESS']
v_nmPort=os.environ['NM_PORT']
v_nmUserName=os.environ['NM_USERNAME']
v_nmPwd=os.environ['NM_PWD']
v_otdTemplate=os.environ['TEMPLATE']
v_otdConfigName=os.environ['OTD_CONFIGNAME']
v_otdServerPort=os.environ['OTD_SERVERPORT']
v_otdServerName=os.environ['OTD_SERVERNAME']
v_otdOriginServer=os.environ['OTD_ORIGINSERVER']

def printHeader(headerText):
    print "\n======================================================================================"
    print "--> "+headerText
    print "======================================================================================\n"

def printInfo(infoText):
    print "-->: "+infoText

printHeader("Started: crDomain.py")

printHeader("Step: Read default template (always wls.jar!!)")
readTemplate(v_template)
printInfo("Template: "+v_template+" successfully read")   

printHeader("Step: Prepare Domain --> Set Domain Name to "+v_domainName)
cd('/')
cmo.setName(v_domainName)
printInfo("Step: Set Domain Name --> Successful")

printHeader("Step: Prepare Domain --> Set User Password")
cd('/')
cd('/Security/'+v_domainName+'/User/'+v_asUser)
cmo.setPassword(v_webpw)
printInfo("Step: Set User Password --> Successful")

printHeader('Step: Prepare Domain --> Set AdminServer Name ('+v_asName+') and Port ('+v_adminport+')')
cd('/')
cd('/Server/AdminServer')
cmo.setName(v_asName)
cd('/')
cd('/Server/'+v_asName)
cmo.setListenPort(int(v_adminport))
printInfo("Step: Set AdminServer Name --> Successful")

printHeader("Step: Prepare Domain --> Set Domain Properties")
setOption('OverwriteDomain', 'true')
setOption('ServerStartMode','prod')
printInfo("Step: Set Domain Properties --> Successful")

printHeader("Step: Prepare Domain --> Align NodeManager")
cd('/NMProperties')
set('ListenAddress',v_nmListenAddress)
set('ListenPort',int(v_nmPort))
set('CrashRecoveryEnabled', 'true')
set('NativeVersionEnabled', 'true')
set('StartScriptEnabled', 'false')
set('SecureListener', 'true')
set('LogLevel', 'INFO')

cd('/SecurityConfiguration/base_domain')
set('NodeManagerUsername', v_nmUserName)
set('NodeManagerPasswordEncrypted', v_nmPwd)
printInfo("Step: Align NodeManager --> Successful")


printHeader("Step: Prepare Domain --> Set JAVA_HOME in Domain")
setOption('JavaHome',v_javaHome)
printInfo("Step: Set JAVA_HOME in Domain --> Successful")

printHeader("Step: writeDomain and closeTemplate")
writeDomain(v_setup_domain_base+'/'+v_domainName)
closeTemplate()

readDomain(v_setup_domain_base+'/'+v_domainName)

printHeader('Step: Create Unix Machine --> Set Machine Name ('+v_MachineName+') and Port ('+v_nmPort+')')
cd('/')
create(v_MachineName, 'UnixMachine')
cd('Machine/' + v_MachineName)
create(v_MachineName, 'NodeManager')
cd('NodeManager/'+v_MachineName)
set('ListenAddress', v_nmListenAddress)
set('ListenPort',int(v_nmPort))
set('NMType','ssl')

cd('/Servers/'+v_asName)
set('Machine',v_MachineName)
printInfo("Step: Create Unix Machine --> Successful")
updateDomain()
closeDomain()

readDomain(v_setup_domain_base+'/'+v_domainName)
printHeader('Step: Include OTD template')
selectTemplate('Oracle Traffic Director - Restricted JRF','12.2.1.3.0')
loadTemplates()
printInfo('Step: Include OTD template --> Successful')
updateDomain()
closeDomain()
printInfo("Step: writeDomain and closeTemplate --> Successful")

printHeader('Step: Creating OTD Instance')
readDomain(v_setup_domain_base+'/'+v_domainName)
props = {}
props['configuration'] = v_otdConfigName
props['listener-port'] = v_otdServerPort
props['server-name'] = v_otdServerName
props['origin-server'] = v_otdOriginServer
otd_createConfiguration(props)
updateDomain()
closeDomain()

readDomain(v_setup_domain_base+'/'+v_domainName)
props = {}
props['configuration'] = v_otdConfigName
props['machine'] = v_MachineName
otd_createInstance(props)
updateDomain()
closeDomain()
printInfo('Step: Creating OTD Instance --> Successful')

printHeader("Finished: crDomain.py")

And now you can start to install and configure your Oracle Traffic Director 12.2.1.3.0.

At first you need to execute the installation scripts:

cd $ORACLE_BASE/install
# Install the JDK
./silent_jdk.sh

jdk1.8.0_144/
jdk1.8.0_144/THIRDPARTYLICENSEREADME-JAVAFX.txt
jdk1.8.0_144/THIRDPARTYLICENSEREADME.txt
jdk1.8.0_144/lib/
jdk1.8.0_144/lib/jexec
jdk1.8.0_144/lib/javafx-mx.jar
jdk1.8.0_144/lib/packager.jar
jdk1.8.0_144/lib/visualvm/
. . .
. . .
jdk1.8.0_144/man/ja_JP.UTF-8/man1/tnameserv.1
jdk1.8.0_144/man/ja_JP.UTF-8/man1/pack200.1
jdk1.8.0_144/man/ja_JP.UTF-8/man1/jcmd.1
jdk1.8.0_144/man/ja_JP.UTF-8/man1/javapackager.1
jdk1.8.0_144/man/ja_JP.UTF-8/man1/jstat.1

# Install the Oracle WebLogic Server Infrastructure
./silent_wls_infra.sh

Launcher log file is /tmp/OraInstall2017-09-15_05-51-04PM/launcher2017-09-15_05-51-04PM.log.
Extracting the installer . . . . . . . . . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2194.918 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 3071 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 10035 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2017-09-15_05-51-04PM
Log: /tmp/OraInstall2017-09-15_05-51-04PM/install2017-09-15_05-51-04PM.log
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Skipping Software Updates
Starting check : CertifiedVersions
Expected result: One of oracle-6, oracle-7, redhat-7, redhat-6, SuSE-11, SuSE-12
Actual Result: oracle-7.3
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.
. . .
. . .
Percent Complete : 90
Percent Complete : 100

The installation of Oracle Fusion Middleware 12c Infrastructure 12.2.1.3.0 completed successfully.
Logs successfully copied to /u00/app/oracle/oraInventory/logs.

# Install the Oracle Traffic Director
./silent_otd.sh

Launcher log file is /tmp/OraInstall2017-09-15_05-54-37PM/launcher2017-09-15_05-54-37PM.log.
Checking if CPU speed is above 300 MHz.   Actual 2194.918 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 3071 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 8508 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2017-09-15_05-54-37PM
Log: /tmp/OraInstall2017-09-15_05-54-37PM/install2017-09-15_05-54-37PM.log
Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Skipping Software Updates
Starting check : CertifiedVersions
Expected result: One of redhat-7, redhat-6, oracle-6, oracle-7, SuSE-11, SuSE-12
Actual Result: oracle-7.3
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.
. . .
. . .
Percent Complete : 90
Percent Complete : 100

The installation of Oracle Traffic Director 12.2.1.3.0 completed successfully.
Logs successfully copied to /u00/app/oracle/oraInventory/logs.

As next you can configure your Oracle Traffic Director Domain:

cd $ORACLE_BASE/install
./crDomain.sh

======================================================================================
 Program  : crDomain.sh                                                ........
======================================================================================
==================================================
Domain will be installed ...
==================================================

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands


======================================================================================
--> Started: crDomain.py
======================================================================================


======================================================================================
--> Step: Read default template (always wls.jar!!)
======================================================================================

-->: Template: /u00/app/oracle/product/fmw-otd-12.2.1.3.0/wlserver/common/templates/wls/wls.jar successfully read

======================================================================================
--> Step: Prepare Domain --> Set Domain Name to OTDDOMAIN
======================================================================================

-->: Step: Set Domain Name --> Successful

======================================================================================
--> Step: Prepare Domain --> Set User Password
======================================================================================

-->: Step: Set User Password --> Successful

======================================================================================
--> Step: Prepare Domain --> Set AdminServer Name (OTDDOMAINAdminServer) and Port (7001)
======================================================================================

-->: Step: Set AdminServer Name --> Successful

======================================================================================
--> Step: Prepare Domain --> Set Domain Properties
======================================================================================

-->: Step: Set Domain Properties --> Successful

======================================================================================
--> Step: Prepare Domain --> Align NodeManager
======================================================================================

-->: Step: Align NodeManager --> Successful

======================================================================================
--> Step: Prepare Domain --> Set JAVA_HOME in Domain
======================================================================================

-->: Step: Set JAVA_HOME in Domain --> Successful

======================================================================================
--> Step: writeDomain and closeTemplate
======================================================================================


======================================================================================
--> Step: Create Unix Machine --> Set Machine Name (otd122130) and Port (5556)
======================================================================================

-->: Step: Create Unix Machine --> Successful

======================================================================================
--> Step: Include OTD template
======================================================================================

-->: Step: Include OTD template --> Successful
-->: Step: writeDomain and closeTemplate --> Successful

======================================================================================
--> Step: Creating OTD Instance
======================================================================================

-->: Step: Creating OTD Instance --> Successful

======================================================================================
--> Finished: crDomain.py
======================================================================================

Finished
Domain Build Time: 1  minutes.
Start Domain manually by using startNodeManager.sh and startWeblogic.sh

Now you can startup the NodeManager and the WebLogic AdminServer:

cd $DOMAIN_HOME/bin
nohup ./startNodeManager > /dev/null 2>&1 &

cd $DOMAIN_HOME
nohup ./startWebLogic.sh > /dev/null 2>&1 &

Wait some minutes and then access with a browser the Oracle Enterprise Manager Fusion Middleware Control http://<servername>:<port>/em



Under the top right menu option "WebLogic Domain" go to "Administration / OTD Configurations"


And now you can see your Oracle Traffic Director Instance and Configuration and start the Instance from here, mark the line of your Instance and then click "Start Instances"


And that's it ... with the above script set you are easily in the position to install and configure your Oracle Traffic Director 12.2.1.3.0 and you can easily align the configuration for the Traffic Director Instances and Configurations to your needs.