Starting an Administration and Managed Servers Using WLST With Node Manager

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.

  1. Create a userConfigFile and userKeyFile:
    1. Start the WebLogic Domain's AdminServer by launching weblogic_home\user_projects\domains\your_domain\bin\startWebLogic.cmd.
    2. Browse to the P6 home directory and create a new directory called scripts.
    3. Open the command prompt.
    4. Change the directory to weblogic_home\user_projects\domains\your_domain\bin.
    5. 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

    6. 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
    7. 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).

    8. 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.

    9. Stop the WebLogic Domain's administration server from running by launching weblogic_home\user_projects\domains\your_domain\bin\stopWebLogic.cmd.
  2. Ensure that AdminServer is assigned to the machine created for the WebLogic Domain:
    1. Browse to the weblogic_home\user_projects\domains\your_domain\config directory.
    2. Make a copy of the config.xml file to back up the existing file.
    3. Open the config.xml file with a text editor.
    4. Search for the following:

      <name>AdminServer</name>

    5. 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.
    6. Save and close the config.xml file.
  3. Ensure the administration server and managed servers in the weblogic domain are configured with a boot.properties file for node manager startup:
    1. Browse to the weblogic_home\user_projects\domains\your_domain\servers\AdminServer\data directory.
    2. Check if you have a directory called nodemanager. If you do not, create a directory called nodemanager.
    3. Create a text file in the nodemanager directory called boot.properties.
    4. 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

    5. Save and close the file.
    6. 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.

  4. Create a text file in the p6home/scripts directory called start_primavera.py (this is also known as a python file).
  5. 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.

  6. Save and close the file.
  7. Create a command file that will call the Python script you created above:
    1. 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

    2. Save the file in the p6home\scripts directory with the following name: start_primavera.bat.

Related Topics

Using the WebLogic Scripting Tool on Windows

Starting the Node Manager with WebLogic

Adding the start_primavera.bat to the Windows Task Scheduler

Executing the start_primavera.bat file

Using WebLogic Scripting to Stop the WebLogic Domain for P6 EPPM

Troubleshooting



Legal Notices | Your Privacy Rights
Copyright © 2023

Last Published Thursday, January 12, 2023