B Customizing Server Parameters with the setUserOverridesLate Script

Oracle recommends using the setUserOverridesLate startup script to customize server parameters in enterprise deployments. While other scripts and methods exist for customizing startup parameters, the use of setUserOverridesLate has been specifically tested with this Enterprise Deployment guide.

Modifying the setDomainEnv script is not recommended. For more information, see Customizing Domain Wide Server Parameters in Administering Server Startup and Shutdown for Oracle WebLogic Server.

This appendix provides an example script with features specifically standardized for configuration requirements related to this Enterprise Deployment guide. As the EDG is executed, specific configuration changes can simply be un-commented to implement the changes required in various chapters, as well as any of the additional optional enhancements.

Benefits:

  • Example for standardized file-based configuration management of server properties.

  • Single point of configuration of customized JVM parameters across entire domain.

  • setUserOverridesLate script propagates with standard pack/unpack tooling.

  • Will execute after all other FMW product extension settings appropriately.

Example includes code for the following features:

  • Fix for Java SecureRandom function blocking bug on systems with low entropy.

  • Customized JVM Heap allocations by server name matching.

  • Customized SSL Trust KeyStore file location.

  • WebCenter Portal SSO parameters on Portal Managed Servers only.

  • Debugging function can be enabled on a server case-by-case basis.

Example: setUserOverridesLate.sh
#!/bin/bash
#
# setUserOverridesLate.sh
# Description: Example for Fusion Middleware 12.2.1.x Enterprise Deployment topologies
#     Version: WCEDG.12.2.1.3
#
#
# Runtime location: ${ASERVER_HOME}/bin/setUserOverridesLate.sh
#                   ${MSERVER_HOME}/bin/setUserOverridesLate.sh
#
# Testing protocol (isolated):
#
#   export SERVER_NAME="WLS_WSM1"
#   . ${ASERVER_HOME}/bin/setUserOverridesLate.sh && unset USER_MEM_ARGS && unset EXTRA_JAVA_PROPERTIES && unset SERVER_NAME;
#
#
# Deployment protocol:
#
#   setUserOverridesLate.sh propagates with domain during pack/unpack commands.
#
#   Alternative:
#   cp  ${ASERVER_HOME}/bin/setUserOverridesLate.sh ${MSERVER_HOME}/bin/setUserOverridesLate.sh
#   scp ${ASERVER_HOME}/bin/setUserOverridesLate.sh wcchost2:${MSERVER_HOME}/bin/setUserOverridesLate.sh
#   scp ${ASERVER_HOME}/bin/setUserOverridesLate.sh wcphost1:${MSERVER_HOME}/bin/setUserOverridesLate.sh
#   scp ${ASERVER_HOME}/bin/setUserOverridesLate.sh wcphost2:${MSERVER_HOME}/bin/setUserOverridesLate.sh
#

#
# Functions
#


# Support for any additional optional debugging parameters
#
function enableDebug() {
  # Set Debugging Parameters only if invoked per managed server type below
  # Example includes SSL & network debugging
  DEBUG_PROPERTIES="-Dssl.debug=true -Djavax.net.debug=all "
  #
  # Include debug properties
  EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES}  ${DEBUG_PROPERTIES} "
  export EXTRA_JAVA_PROPERTIES
  echo "** DEBUGGING ENABLED on EXTRA_JAVA_PROPERTIES: ${DEBUG_PROPERTIES}"
  echo ""
}


#
# MAIN
#

#
# Baseline domain-wide configigurations
#
# Add configuration enhancements that apply to all servers here.
#

#
# Java SecureRandom Entropy fix
#
# Use the pseudo-random device on hosts with low entropy to improve performance.
# See MOS KB 1574979.1 - How to Diagnose a Linux Entropy Issue on WebLogic Server Instances
#
# EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Djava.security.egd=file:/dev/./urandom "
# export EXTRA_JAVA_PROPERTIES


#
# Custom TrustStore Configuration
#
# When using a custom trust store in your environment:
#    a. Uncomment this assignment
#    b. Update path to custom trust store, EDG uses the path to KEYSTORE_HOME
#

#EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Djavax.net.ssl.trustStore=/u01/oracle/config/keystores/appTrustKeyStore.jks"
#export EXTRA_JAVA_PROPERTIES


# Per-ServerType Configurations (Memory, etc..)
#
# Recomendations:
#    * Total JVM Heap for all servers per host should not exceed 50% total memory
#    * Review declarations in the setDynServerListAddresses function before enabling/un-commenting it below.
#    * setDynServerListenAddress functionality should only be enabled for dynamic clusters, but is
#      harmless if left enabled for servers in static clusters.
#    * Set only required debug parameters in the enableDebug function above before enabling it here on
#      an as-needed basis only.  Disable it for regular production use.
#    * Review and set USER_MEM_ARGS appropriately for your environment.  Values are only examples.
#
case "${SERVER_NAME}" in

   AdminServer)
      echo "** AdminServer Customizations:"
      USER_MEM_ARGS="${USER_MEM_ARGS} -Xms2g -Xmx2g ";
      export USER_MEM_ARGS;
      #enableDebug;
      ;;

   WLS_WSM*)
      echo "** WLS_WSM Managed Server Customizations:"
      USER_MEM_ARGS="${USER_MEM_ARGS} -Xms1g -Xmx1g ";
      export USER_MEM_ARGS;
      #enableDebug;
      ;;

   WLS_WCC*)
      echo "** WLS_WCC Managed Server Customizations:"
      USER_MEM_ARGS="${USER_MEM_ARGS} -Xms4g -Xmx4g ";
      export USER_MEM_ARGS;
      #enableDebug;
      ;;

   WLS_IBR*)
      echo "** WLS_IBR Managed Server Customizations:"
      USER_MEM_ARGS="${USER_MEM_ARGS} -Xms2g -Xmx2g ";
      export USER_MEM_ARGS;
      #enableDebug;
      ;;

   WLS_SOA*)
      echo "** WLS_SOA Managed Server Customizations:"
      USER_MEM_ARGS="${USER_MEM_ARGS} -Xms4g -Xmx4g ";
      export USER_MEM_ARGS;
      #enableDebug;
      ;;

   WC_Portal*)
      echo "** WC_Portal Managed Server Customizations:"
      USER_MEM_ARGS="${USER_MEM_ARGS} -Xms4g -Xmx4g ";
      export USER_MEM_ARGS;
      #enableDebug;
      #
      # WCEDG Chapter 19 Enable SSO for WebCenter Portal
      # Un-comment when appropriate during build then re-deploy script to all hosts
      #
      #EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Doracle.webcenter.spaces.osso=true"
      #export EXTRA_JAVA_PROPERTIES
      ;;

   WC_Portlet*)
      echo "** WC_Portlet Managed Server Customizations:"
      USER_MEM_ARGS="${USER_MEM_ARGS} -Xms2g -Xmx2g ";
      export USER_MEM_ARGS;
      #enableDebug;
      ;;

   *)
      echo "** WARNING - NO SERVER MATCH - VERIFY setUserOverridesLate.sh case condition coding."
      ;;

esac

echo "USER_MEM_ARGS=\"${USER_MEM_ARGS}\""
echo "EXTRA_JAVA_PROPERTIES=\"${EXTRA_JAVA_PROPERTIES}\""
echo ""
echo "*****************************************************"
echo "** End of setUserOverrideLate.sh"
echo "*****************************************************"
echo ""