To automate the startup of the Admin and managed server using WLST:
Note: If you are using P6 EPPM R8.2 or higher and you used the P6 EPPM Configuration Wizard to create the WebLogic domain, steps 1-6 below have already been completed.
- Create a userConfigFile and userKeyFile:
- Start the WebLogic Domain's AdminServer by launching weblogic_home\user_projects\domains\your_domain\bin\startWebLogic.cmd.
- Browse to the P6 home directory and create a new directory called scripts.
- Open the command prompt.
- Change the directory to weblogic_home\user_projects\domains\your_domain\bin.
- Run the following commands:
call
setDomainEnv.cmd
java_home\bin\java.exe weblogic.WLST
where java_home is the path to the JDK installed and being used by WebLogic.
Note: If the "java_home" directory contains a space in the path, it should include quotations around the full path and executable being called. For example: "C:\Program Files\Java\jdk1.6.0_27\bin\java.exe" weblogic.WLST
- At the wls:/offline> prompt, enter the following command:
connect('
weblogic','
password','
AdminServerHostName:
AdminServerPort')
where:
- weblogic is the weblogic admin user for the domain
- password is the password for the weblogic admin user for the domain
- AdminServerHostName is the host name where administration server was installed
- AdminServerPort is the port number of administration server
- At the wls:/mydomain/serverConfig> prompt, enter the following command:
storeUserConfig('
p6home/scripts/primaveraConfig.secure', '
p6home/scripts/primaveraKeyfile.secure')
where p6home is the P6 home directory the you set during installation (for example, C:/p6home).
- Enter y at the following prompt:
Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Do you want to create the key file? y or n
Note: Confirm that the following two files were created under the p6home/scripts directory: primaveraConfig.secure and primaveraKeyfile.secure. If these files were not created, repeat the previous steps.
- Stop the WebLogic Domain's administration server from running by launching weblogic_home\user_projects\domains\your_domain\bin\stopWebLogic.cmd.
- Ensure that AdminServer is assigned to the machine created for the WebLogic Domain:
- Browse to the weblogic_home\user_projects\domains\your_domain\config directory.
- Make a copy of the config.xml file to back up the existing file.
- Open the config.xml file with a text editor.
- Search for the following:
<name>AdminServer</name>
- Locate the </ssl> element and add the following line under the element:
<machine><!--NameOfMachine--></machine>
where
<!--NameOfMachine-->
is the name of the logical machine created for the WebLogic domain.Notes:
- If an </ssl> element does not exist, locate and add the line
<machine><!--NameOfMachine--></machine>
above the<listen-address>
element. - If a <machine> element already exists for AdminServer, this step can be skipped.
- If an </ssl> element does not exist, locate and add the line
- Save and close the config.xml file.
- Ensure the administration server and managed servers in the weblogic domain are configured with a boot.properties file for node manager startup:
- Browse to the weblogic_home\user_projects\domains\your_domain\servers\AdminServer\data directory.
- Check if you have a directory called nodemanager. If you do not, create a directory called nodemanager.
- Create a text file in the nodemanager directory called boot.properties.
- Open boot.properties using a text editor and add:
- usename=<werblogic>
where <weblogic> is the Administrator user created for the WebLogic domain.
- password=<password>
where <password> is the password for the Administrator user created for the WebLogic domain
- usename=<werblogic>
- Save and close the file.
- Repeat steps a – e for every managed server in the domain.
Example path:
weblogic_home\user_projects\domains\your_domain\servers\<NameOfManagedServer>\data
Note: The username and password variables will become encrypted in the boot.properties file the first time the servers start using the node manager.
- Create a text file in the p6home/scripts directory called start_primavera.py (this is also known as a python file).
- Open start_primavera.py using a text editor and add the following 6 lines (each line should be entered as a single line):
nmConnect(userConfigFile='
p6home/scripts/primaveraConfig.secure',userKeyFile='
p6home/scripts/primaveraKeyfile.secure',host='
NodeMangerHost',port='5556',domainName='
Mydomain',domainDir='
DomainLocation',nmType='ssl')
arg = "Arguments=\" -server -Xms128m -Xmx512m -XX:MaxPermSize=256m \""
prps = makePropertiesObject (arg)
nmStart('
AdminServer',props=prps)
connect(userConfigFile='
p6home/scripts/primaveraConfig.secure',userKeyFile='
p6home/scripts/primaveraKeyfile.secure',url='t3://
Adminserverhost:
Adminserverport')
start('
myManagedServer')
where:
- p6home is the home directory for one of the P6 EPPM applications. For example: C:/p6home
- NodeManagerHost is the hostname where the node manager is installed
- Adminserverhost is the hostname where the administration server is running
- Adminserverport is the port number of the administration server (default is 7001)
- Mydomain is the name of the WebLogic domain
- DomainLocation is the path to the WebLogic domain (C:/Oracle/Middleware/user_projects/domains/your_domain)
- AdminServer is the Logical Name of the administration server
- myManagedServer is the Logical Name of the managed server
Note: If multiple managed servers exist, repeat the line ‘start(‘myManagedServer')' with the name of each managed server.
- Save and close the file.
- Create a command file that will call the Python script you created above:
- Open a text editor and enter the following lines:
SETLOCAL
SET CLASSPATH=
call
weblogic_home\user_projects\domains\
your_domain\bin\setDomainEnv.cmd
call
java_home\bin\java.exe weblogic.WLST
p6home\scripts\start_primavera.py
where:
- weblogic_home is the WebLogic Server home directory. The default is C:\Oracle\Middleware
- your_domain is the domain name directory in your environment
- java_home is the path to the JDK installed and being used by WebLogic
- p6home is the home directory for the P6 EPPM folder containing the scripts directory. For example: C:\p6home
Note: If the "java_home", "p6home" or "weblogic_home" directories contain a space in the path, it should include quotations around the full path and executable/command file being called. For example: call "C:\Program Files\Java\jdk1.6.0_27\bin\java.exe" weblogic.WLST C:\P6WebAccess\scripts\start_primavera.py
- Save the file in the p6home\scripts directory with the following name: start_primavera.bat.
- Open a text editor and enter the following lines: