Domain creation procedure is a complex and laborious process itself. Depending on the domain size this task can take several days. At the same time, most of the settings are the same across all servers. In order to unify domains configuration and reduce the impact of the “human factor” we decide to create automation script for domain creation procedure.
In general, a domain creation process can be divided in several steps:
- Virtual Machine creation
- Data Base preparation
- Domain creation and AdminServer configuration
- Managed servers configuration
There are a lot of tools that are intended to automate the step 1. That is why, we will not care about it and will not describe a VM creation in this article. We just assume that all needed VM are already created and configured according to our requirements.
For each of the next steps we created different script.
Data Base preparation
DB schemas set depends on the required domain functionality. For example, if a domain will be created with SOA and BPM functionality, then at least 3 schemas should be created: _SOAINFRA, _MDS and _ORASDPM. Another example is a case, when we plan to migrate OPSS (Oracle Platform Security Services) from files-based store to Oracle DB. In such a case, _OPSS schema should be created. Oracle provides a tool named RCU (Repository Creation Utility) that allows creating all required schemas. The same tool can be used to drop schemas as well.
Unfortunately, not all schemas can be created via RCU. For example, this tool cannot create _RDBMS schema, which is needed in case when domain should be created with RDBMS Security Store support. Oracle just provides step by step instruction how to create schema, tablespace, user and grant required privileges. It also provides a SQL script, which will create all required objects inside the schema. But all these steps and SQL script execution should be performed manually.
create_schemas.sh script is intended to simplify all tasks related to DB operations. The same script can be used both for creating and for deleting schemas.
The script uses a lightweight version of the RCU to create _SOAINFRA, _MDS, _ORASDPM and _OPSS schemas and Oracle instant client to create _RDBMS schema.
In addition to creating schemas, the script implements some Oracle recommendations that should improve database performance:
- Creating index in _SOAINFRA schema according to “High CPU Usage in SOA 188.8.131.52 due to Full Table Scan (Doc ID 1420114.1)”
- LIVE_INSTANCES table modification according to “ORABPEL-05002 Exception While Running large number of Parallel BPM Process. (Doc ID 1597990.1)”
The video below shows the schemas creation process.
The result of the script work is a set of created and configured schemas for particular domain feature set.
Domain creation can be automated by WLST (WebLogic Scripting Tool) tool. This process can also be divided in several phases:
- Domain creation in offline mode
- Domain configuration in online mode
- Post install configuration
In offline mode a base domain will be created and all features will be activated according to create_domain.properties file. Each feature is activating by adding of an appropriate template to the base domain. Also in this step the script creates all servers and performs base configuration for each of them.
Tasks listed below are also performed during offline phase:
- Assigning servers to the machines
- Creating clusters and assigning servers to them
- Adding JRF Template on all vanilla WebLogic servers
- Datasource configuration
- Converting JMS resources to UDD (Uniform Distributed Destinations)
Then AdminServer starts for the first time and script goes into online mode. During online phase the script performs the following tasks:
- Credentials configuration for EmbeddedLDAP and CrossDomain Security
- Authentication Provider configuration, if it is specified in the property file
- Invocation and JTA timeouts configuration
- OPSS Datasource creation and configuration
- Logging subsystem configuration
- Clusters configuration
- OPSS Security Store migration to Oracle DB
- Removal of all clusters from targets list for diagnostic module Module-FMWDFW
- Keystores, SSL and OverloadProtection configuration, tlog file relocation for each server
- Nodemanager type configuration for each machine
In the last step, the script performs Global roles association and configures Nodemanager on the AdminServer’s host. Also WKA list for OSB Coherence and Lifecycle scripts are generated in this step. After the script stops AdminServer, Nodemanager starts and then AdminServer starts under Nodemanager control.
In this step the domain and AdminServer are fully configured, and AdminServer is started in regular manner via Nodemanager.
The video below demonstrates the domain creation process:
Managed servers configuration
In general, distributed domains spent a significant part of time on the configuration of managed servers. But the list of tasks is almost the same among all servers. config_managed.sh script automates this process and allows to reduce overall configuration time. This script may be used in both domain creation and in cluster extension procedure.
The script creates template file for managed servers and forms list of servers from the domain configuration. For security reason, the script will asks for the password of oracle user in interactive mode. Then scrip logs in to each server with provided credential and performs several tasks:
- Unpack procedure
- Set umask to 022 in the startWebLogic.sh
- Optimize setDomainEnv.sh file depending on the server type
- Configure and start Nodemanager
After the script will finish its work, we will have completely configured managed servers with started Nodemanager on each server. We can check Nodemanger’s status in the WebLogic Administration Console:
The script can be re-executed multiple times with the same property file. This may be useful in order to complete configuration in case when one or several servers were unreachable during initial execution. In such a case the script connects to each host in the list and performs tasks only on those hosts where it is needed. Already completed tasks will be skipped:
It should also be noted that managed servers doesn’t start after the script execution. This task should be performed manually.
The video below shows the configuration of managed servers: