Discussion
Pegasystems Inc.
IT
Last activity: 29 Mar 2019 12:11 EDT
Sample script to configure Oracle WebLogic Server (with Oracle Database) for Pega Platform
The script configure.sh attached to this article is provided as a sample and on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. The script leverages WebLogic built-in Scripting Tool (see Oracle Fusion Middleware - Understanding the WebLogic Scripting Tool).
The script does NOT replace steps described in the Pega Platform Installation Guide, the WebLogic administrator shall always refer to the installation guide performing the configuration.
The WebLogic administrator may customize it to fit any particular need of the local environment, for example to have different defaults.
The script will try to connect to the admin server on localhost, so the appropriate place for the script to run would be the admin server.
The following sample command will create the basic configuration and a server (in this case the script will use local host details to create the server):
$ ./configure.sh DATABASEURL=oracle01:1521/orcl PEGAADMINPASSWORD=PEGA_ADMIN PEGARULES=pega811_data PEGARULESPASSWORD=PEGA_DATA DEPLOYTYPE=EAR DEPLOYNAME=prpc811_wls_jee4 DEPLOYPATH=/opt/pega/811/archives/prpc/ear
The output will be:
Mon Feb 4 15:28:23 UTC 2019 Setting environment CLASSPATH=/opt/java/jdk1.8.0_191/lib/tools.jar:/opt/weblogic/wls12213/wlserver/modules/features/wlst.wls.classpath.jar: PATH=/opt/weblogic/wls12213/wlserver/server/bin:/opt/weblogic/wls12213/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/ Proprietary information hidden.0/apache-ant-1.9.8/bin:/opt/java/jdk1.8.0_191/jre/bin:/opt/java/jdk1.8.0_191/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/weblogic/wls12213/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin Your environment has been set. Mon Feb 4 15:28:23 UTC 2019 Creating the WebLogic configuration for Oracle database as: CLUSTER = cluster MACHINE = docker01 MACHINELISTENADDRESS = docker01 MACHINELISTENPORT = default SERVER = docker01 SERVERLISTENADDRESS = docker01 SERVERLISTENPORT = 8080 SERVERLISTENPORTSSL = 8443 KEYSTORE = /opt/weblogic/domain/security/weblogic.pkcs12 KEYSTOREPASSWORD = changeit KEYALIAS = weblogic KEYALIASPASSWORD = changeit DATABASEURL = oracle01:1521/orcl DATABASEGRIDLINK = false PEGAADMIN = pega_admin PEGAADMINPASSWORD = PEGA_ADMIN PEGAADMINMIN = 5 PEGAADMINMAX = 10 PEGARULES = pega811_data PEGARULESPASSWORD = PEGA_DATA PEGARULESMIN = 30 PEGARULESMAX = 100 PEGAMKT = PEGAMKTPASSWORD = changeit PEGAMKTMIN = 30 PEGAMKTMAX = 100 DEPLOYTYPE = EAR (valid options for actual deployment are: EAR or WAR) DEPLOYNAME = prpc811_wls_jee4 DEPLOYPATH = /opt/pega/811/archives/prpc/ear (for EAR deployment, pass a directory containing app and plan directories) DEPLOYMODE = nostage (valid options are: stage or nostage, check WebLogic documentation) Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Trying to connect to the server ... Please enter your username :weblogic Please enter your password : Connecting to t3://localhost:7001 with userid weblogic ... Successfully connected to Admin Server "admin" that belongs to domain "domain". Warning: An insecure protocol was used to connect to the server. To ensure on-the-wire security, the SSL port or Admin port should be used instead. Location changed to edit tree. This is a writable tree with DomainMBean as the root. To make changes you will need to start an edit session via startEdit(). For more help, use help('edit'). You already have an edit session in progress and hence WLST will continue with your edit session. Starting an edit session ... Started edit session, be sure to save and activate your changes once you are done. creating mbean of type Cluster ... cluster creating mbean of type UnixMachine ... docker01 setting attributes for mbean type NodeManager ... listen address docker01 creating mbean of type Server ... docker01 setting attributes for mbean type Server ... listen address docker01 ... listen port 8080 ... cluster name cluster setting attributes for mbean type SSL ... listen port 8443 creating mbean of type JDBCSystemResource ... AdminPegaRULES setting attributes for mbean type JDBCDataSource ... name AdminPegaRULES setting attributes for mbean type JDBCDataSourceParams ... JNDI name jdbc/AdminPegaRULES ... global transaction false setting attributes for mbean type JDBCDriverParams ... service oracle01:1521/orcl setting attributes for mbean type JDBCProperty ... user pega_admin setting attributes for mbean type JDBCConnectionPoolParams ... minimum 5 ... maximum 10 setting attributes for mbean type JDBCOracleParams ... FAN enabled false ... Active GridLink false setting attributes for mbean type JDBCSystemResource ... target cluster creating mbean of type JDBCSystemResource ... PegaRULES setting attributes for mbean type JDBCDataSource ... name PegaRULES setting attributes for mbean type JDBCDataSourceParams ... JNDI name jdbc/PegaRULES ... global transaction false setting attributes for mbean type JDBCDriverParams ... service oracle01:1521/orcl setting attributes for mbean type JDBCProperty ... user pega811_data setting attributes for mbean type JDBCConnectionPoolParams ... minimum 30 ... maximum 100 setting attributes for mbean type JDBCOracleParams ... FAN enabled false ... Active GridLink false setting attributes for mbean type JDBCSystemResource ... target cluster creating mbean of type JMSServer ... PRJMS_Server-docker01 setting attributes for mbean type JMSServer ... target docker01 creating mbean of type JMSSystemResource ... PRJMS_Module-docker01 setting attributes for mbean type JMSSystemResource ... target docker01 creating mbean of type ConnectionFactory ... PRAsyncCF-docker01 setting attributes for mbean type JMSConnectionFactory setting attributes for mbean type TransactionParams creating mbean of type SubDeployment ... PRJMS_SubdeploymentCF-docker01 setting attributes for mbean type SubDeployment ... target PRJMS_Server-docker01 adding subdeployment to parent ... /JMSSystemResources/PRJMS_Module-docker01/JMSResource/PRJMS_Module-docker01/ConnectionFactories/PRAsyncCF-docker01 creating mbean of type Topic ... PRAsyncTopic-docker01 setting attributes for mbean type Topic creating mbean of type SubDeployment ... PRJMS_SubdeploymentTopic-docker01 setting attributes for mbean type SubDeployment ... target PRJMS_Server-docker01 adding subdeployment to parent ... /JMSSystemResources/PRJMS_Module-docker01/JMSResource/PRJMS_Module-docker01/Topics/PRAsyncTopic-docker01 Saving all your changes ... Saved all your changes successfully. Activating all your changes, this may take a while ... The edit lock associated with this edit session is released once the activation is completed. Activation completed Deploying ... prpc811_wls_jee4 ... EAR /opt/pega/811/archives/prpc/ear/app/prpc_wls_jee4.ear ... Plan /opt/pega/811/archives/prpc/ear/plan/Plan.xml ... staging mode nostage ... target cluster Deploying application from /opt/pega/811/archives/prpc/ear/app/prpc_wls_jee4.ear to targets cluster (upload=false) ... <Feb 4, 2019 3:29:03 PM UTC> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, prpc811_wls_jee4 [archive: /opt/pega/811/archives/prpc/ear/app/prpc_wls_jee4.ear], to cluster .> Completed the deployment of Application with status completed Current Status of your Deployment: Deployment command type: deploy Deployment State : completed Deployment Message : no message <Feb 4, 2019 3:29:05 PM UTC> <Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a different thread than the one in which it was created.> Mon Feb 4 15:29:05 UTC 2019 End
Note that an additional message may show on first script execution:
Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.
After script execution, login to the Administration Console and confirm that the configuration is correct as per Pega Platform Installation Guide. A cluster should have been created:
A machine assigned to the cluster:
Note that the Node Manager is configured to use a plain connection by default:
thus the SecureListener property in the file nodemanager.properties (located in <domain home>/nodemanager) shall be set to false (in each server).
A server should have been created assigned to that machine:
Verify the deployment of Pega application:
and the JMS server configuration:
with its related JMS module:
having expected resources configured (a Topic and a Connection Factory) targeting this server only:
Last check, verify the required data sources have been created:
Now, a new server can be added by executing for example:
$ ./configure.sh MACHINE=docker02 MACHINELISTENADDRESS=docker02
Note that existing configurations with same name (e.g. the cluster, the data sources) will not be overwritten. The output will be:
Mon Feb 4 17:01:21 UTC 2019 Setting environment CLASSPATH=/opt/java/jdk1.8.0_191/lib/tools.jar:/opt/weblogic/wls12213/wlserver/modules/features/wlst.wls.classpath.jar: PATH=/opt/weblogic/wls12213/wlserver/server/bin:/opt/weblogic/wls12213/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/ Proprietary information hidden.0/apache-ant-1.9.8/bin:/opt/java/jdk1.8.0_191/jre/bin:/opt/java/jdk1.8.0_191/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/weblogic/wls12213/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin Your environment has been set. Mon Feb 4 17:01:21 UTC 2019 Creating the WebLogic configuration for Oracle database as: CLUSTER = cluster MACHINE = docker02 MACHINELISTENADDRESS = docker02 MACHINELISTENPORT = default SERVER = docker02 SERVERLISTENADDRESS = docker02 SERVERLISTENPORT = 8080 SERVERLISTENPORTSSL = 8443 KEYSTORE = /opt/weblogic/domain/security/weblogic.pkcs12 KEYSTOREPASSWORD = changeit KEYALIAS = weblogic KEYALIASPASSWORD = changeit DATABASEURL = server:port/service DATABASEGRIDLINK = false PEGAADMIN = pega_admin PEGAADMINPASSWORD = changeit PEGAADMINMIN = 5 PEGAADMINMAX = 10 PEGARULES = pega_data PEGARULESPASSWORD = changeit PEGARULESMIN = 30 PEGARULESMAX = 100 PEGAMKT = PEGAMKTPASSWORD = changeit PEGAMKTMIN = 30 PEGAMKTMAX = 100 DEPLOYTYPE = none (valid options for actual deployment are: EAR or WAR) DEPLOYNAME = prpc_wls_jee4 DEPLOYPATH = /opt/pega/media/ear (for EAR deployment, pass a directory containing app and plan directories) DEPLOYMODE = nostage (valid options are: stage or nostage, check WebLogic documentation) Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Trying to connect to the server ... Please enter your username :weblogic Please enter your password : Connecting to t3://localhost:7001 with userid weblogic ... Successfully connected to Admin Server "admin" that belongs to domain "domain". Warning: An insecure protocol was used to connect to the server. To ensure on-the-wire security, the SSL port or Admin port should be used instead. Location changed to edit tree. This is a writable tree with DomainMBean as the root. To make changes you will need to start an edit session via startEdit(). For more help, use help('edit'). You already have an edit session in progress and hence WLST will continue with your edit session. Starting an edit session ... Started edit session, be sure to save and activate your changes once you are done. creating mbean of type UnixMachine ... docker02 setting attributes for mbean type NodeManager ... listen address docker02 creating mbean of type Server ... docker02 setting attributes for mbean type Server ... listen address docker02 ... listen port 8080 ... cluster name cluster setting attributes for mbean type SSL ... listen port 8443 creating mbean of type JMSServer ... PRJMS_Server-docker02 setting attributes for mbean type JMSServer ... target docker02 creating mbean of type JMSSystemResource ... PRJMS_Module-docker02 setting attributes for mbean type JMSSystemResource ... target docker02 creating mbean of type ConnectionFactory ... PRAsyncCF-docker02 setting attributes for mbean type JMSConnectionFactory setting attributes for mbean type TransactionParams creating mbean of type SubDeployment ... PRJMS_SubdeploymentCF-docker02 setting attributes for mbean type SubDeployment ... target PRJMS_Server-docker02 adding subdeployment to parent ... /JMSSystemResources/PRJMS_Module-docker02/JMSResource/PRJMS_Module-docker02/ConnectionFactories/PRAsyncCF-docker02 creating mbean of type Topic ... PRAsyncTopic-docker02 setting attributes for mbean type Topic creating mbean of type SubDeployment ... PRJMS_SubdeploymentTopic-docker02 setting attributes for mbean type SubDeployment ... target PRJMS_Server-docker02 adding subdeployment to parent ... /JMSSystemResources/PRJMS_Module-docker02/JMSResource/PRJMS_Module-docker02/Topics/PRAsyncTopic-docker02 Saving all your changes ... Saved all your changes successfully. Activating all your changes, this may take a while ... The edit lock associated with this edit session is released once the activation is completed. Activation completed Mon Feb 4 17:02:00 UTC 2019 End
Verify a new server has been created, correctly assigned to the new machine:
and that a new JMS server with its own JMS module has been created. The resources in the new JMS module shall be different from the ones previously created and shall be targeting the new JMS server only:
Execute the script again per each server in the infrastructure.
-
Your friendly neighborhood Technical Architect