The Pack Command
The pack command helps you create a template (a .jar archive file) that contains a snapshot of either an entire WebLogic domain or a subset of a WebLogic domain. You can use a template that contains a subset of a WebLogic domain to create a Managed Server domain directory hierarchy on a remote machine.
Files and Directories Included in Domain Templates
All files and directories in the source WebLogic domain are included, except the following:
- Temporary files that are created when you start a server
- The servers directory
- Files in the security directory that are created automatically when you create the WebLogic domain, such as DefaultAuthenticatorInit.ldift and XACMLRoleMapperInit.ldift
- Persistent file stores, even if they are located with the domain. File stores are excluded whether they are defined for JMS or other file systems. If the file store is located within the domain, an empty file store directory is created on the target system.
In addition to files within the domain directory, deployment plans located in external directories are included in the template that is created by pack. These resources are copied by unpack to the following standard location in the domain:
domain_home/config/deployments/deployment_name/plan
Pack command will exclude the external directories outside of the Oracle home directory are listed in the following file: ORACLE_HOME/oracle_common/common/lib/internalpaths.txt
Porting Security Provider Data to a New Domain
If you have configured additional security data through the Oracle WebLogic Server Administration Console or other online tools, such as for users, groups, or roles, the security data is stored in the LDAP server and is not included in the template because it is an offline command, the pack command does not export security provider data, such as embedded LDAP data, into a domain template. After using unpack to create the new domain, you must manually port the security provider data to the new domain.
Files and Directories Included in Managed Server Templates
The following files and directories are included by default:
- All files in the root directory with the following extensions: .cmd, .sh, .xml, .properties, and .ini
- Any files with the .pem extension defined in the SSL configuration for your WebLogic domain
- All files and subdirectories in the config directory, except config.xml
- The bin directory
- The lib directory
The following files and directories are not included in a Managed Server template by default:
- Applications and certain application initialization files
- The config.xml file
- Temporary files that are created when you start a server
- The servers directory
- Files in the security directory that are created automatically when you create the WebLogic domain, such as DefaultAuthenticatorInit.ldift and XACMLRoleMapperInit.ldift
You can pack any domain, whether or not it specifies specific names or ports for the servers in the domain. You can then unpack the domain on any system, but servers that are defined in the config.xml file to use specific systems and ports will not work on other systems. Therefore, you must unpack the same template on each remote node for all servers to start successfully on their appropriate nodes and systems.
Node Manager Configuration
The pack and unpack commands do not preserve Node Manager configuration for both managed and non-managed modes. By default, the Node Manager type is always set to PerDomainNodeManager in the unpacked domain.
If the Node Manager type in the original domain was CustomLocationNodeManager during unpacking the domain, you must include the -nodeManagerType and -nodeManagerHome parameters in the unpack command to preserve the configuration.
If a ManualNodeManagerSetup configuration was used for the original domain, the Node Manager configuration information is discarded from the template that pack creates. When you unpack the domain, specify ManualNodeManagerSetup using the -nodeManagerType parameter. After you unpack the domain, you must manually configure Node Manager.
Syntax:
pack -domain=domain -template=template -template_name="template_name"
[-template_author="author"] [-template_desc="description"] [-managed=true|false]
[-log=log_file] [-log=log_file] [-log_priority=log_priority]
Example: I gave an option -managed=true because I wanted to use this template for creating managed servers on remote machine.
cd /home/osboxes/Oracle/Middleware/Oracle_Home/oracle_common/common/bin
[osboxes@machine1 bin]$ ./pack.sh -domain=/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain -template=/home/osboxes/mydomain.jar -template_name="My WebLogic Domain" -template_author="pavan" -managed=true
<< read domain from "/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain"
>> succeed: read domain from "/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain"
<< set config option Managed to "true"
>> succeed: set config option Managed to "true"
<< write template to "/home/osboxes/mydomain.jar"
..............................
>> succeed: write template to "/home/osboxes/mydomain.jar"
<< close template
>> succeed: close template
The Unpack Command
The unpack command helps you create a full WebLogic domain or a subset of a domain that is used for a Managed Server domain directory on a remote system. Meaning you can create a new domain on the remote machine including Admin, Managed Servers cluster etc or You can just setup just Managed Servers on the remote machine.
You must use unpack only with a template that is compatible with your current installation. The current installation binaries must exist on the system on which you are running the unpack command. The template can be any of the following:
- A domain template that is packaged with your current installation
- A domain template created by using the Domain Template Builder or WLST
- A domain template created by using the pack command
- A Managed Server template created by using the pack command
When you use the unpack command with a domain template, it creates a WebLogic domain that contains all the application and resource files defined in the template. It also creates necessary start scripts, and certain security and configuration files.
The source domain must have both an administrator user and an administrator password defined for the domain. Otherwise, an error is displayed when you run the unpack command. You can define the administrator password for the source domain in the wallet that is specified by the unpack command's walletDir option.
When you use the unpack command with a Managed Server template, it creates a Managed Server domain directory that includes the following:
- A customized start script for each Managed Server in the WebLogic domain
- The config_bootstrap.xml file (based on the config.xml file in the template)
- The nm_password.properties file
- The SerializedSystemIni.dat file
By default, application files are not included in a Managed Server template that is created by using the pack command. If an application in the WebLogic domain from which you have created a Managed Server template is deployed by using the external_stage mode, the Managed Server domain directory that you create with the unpack command does not contain any of the externally staged applications. Before you start the Managed Server, you must ensure that it has access to the externally staged application files.
Syntax:
unpack [-initialize] -template=template -domain=domain [-walletDir=directory]
[-user_name=username] [-password=password] [-app_dir=application_directory]
[-nodemanager_type=type] [-nodemanager_home=nodemanager_home_directory]
[-java_home=java_home_directory] [-server_start_mode=dev|prod]
[-overwrite_domain] [-log=log_file] [-log_priority=log_priority]
Example: I used this example to create horizontal cluster setup which is creating managed server instances on the remote machine. You can also use the template to create a full domain either on the same machine or remote machine. I manually updated the nodemanager.properties after unpacking it on the remote machine and enrolled the node manager with Admin Server which resides on the remote machine using nmEnroll() command
Enrolling a NodeManager using nmEnroll() command
No comments:
Post a Comment