Hitachi

uCosminexus Application Server System Setup and Operation Guide


2.4.1 Allocating multiple J2EE servers for supporting multi-tenants

This subsection describes the procedure for changing a single Web front system to a system supporting the multi-tenant through the effective usage of host resources. For system configuration, see 1.2.3 Supporting multi-tenancy by allocating multiple J2EE servers.

Reference note

For details on the reference locations of the windows, commands, and files used in the description, and the storage locations of the commands and files, see 5. Windows, Commands, and Files used in the System Setup and Operations.

After replicating the Web system, create a host for allocating multiple J2EE servers, by adding the logical servers (Web server, J2EE server, and performance tracer), using Smart Composer functionality. In this subsection it is assumed that the same application is used in business applications operating on J2EE server to be added. The following table describes the settings used in the example.

Table 2‒7: Settings used in the example (Web front system that supports the multi-tenant by allocating the multiple J2EE servers)

Item

Example of setting

Web system name

MyWebSystem

Name of the service unit to be added

unit2

Name of the logical Web server to be added

MyWebServer2

Name of the logical J2EE server to be added

MyJ2EEServer2

Name of the logical performance tracer to be added

MyPerformanceTracer2

Name of the Configuration Change definition file

MyWebSystemAddUnit.xml

Organization of this subsection

(1) Replacing the Web system

  1. Execute the cmx_export_model command with the command prompt to export the Easy Setup definition file to Any-directory.

    Command execution example is as follows:

    cmx_export_model -m localhost:28080 -u admin -o <Export destination file path of Easy Setup Definition file>

    Specify the file name and the path of the Easy Setup definition file storage directory in Export-destination-file-path-of-Easy-Setup-definition-file. Easy Setup definition file is in XML format.

  2. Execute the cmx_delete_system command with the command prompt to delete the system.

    Delete the system already configured on the host as a preparation for the system replication.

    Command execution example is as follows:

    cmx_delete_system -m localhost:28080 -u admin -s MyWebSystem
  3. Execute the cmx_build_system command with the command prompt, to replicate the Web system from the Easy Setup definition file exported in step 1.

    Command execution example is as follows:

    cmx_build_system -m localhost:28080 -u admin -f <file path of Easy Setup Definition file>

    Specify the file name and path of the Easy Setup definition file storage directory (in step 1), in file-path-of-Easy-Setup-definition-file.

(2) Adding logical servers (Web server, J2EE server and performance tracer)

  1. Copy the template file (cmxaddcombinedmodel.xml) of the Configuration Change definition file to any location and rename it with any name.

    The template file of the Configuration Change definition file for adding the service units and the hosts is provided at the following location. In this case, rename the file as MyWebSystemAddUnit.xml.

    For Windows

    Cosminexus installation directory\manager\config\templates\cmxaddcombinedmodel.xml

    For UNIX

    /opt/Cosminexus/manager/config/templates/cmxaddcombinedmodel.xml

  2. Use the text editor to edit the Configuration Change definition file copied in step 1.

    Specify the definition of the service unit and the logical server to be added in the Configuration Change definition file. The name of the logical server to be added and the values specified in the configuration definition of logical server as described in the following table must be unique. The following table describes the unique configuration definitions to be set for each logical server.

    Table 2‒8: Unique configuration definitions to be set for each logical server

    Type of logical server

    Item

    Specification value of param-name

    Performance tracer

    PRF identifier

    PRFID

    J2EE server

    Fixed port number of the JTA recovery

    ejbserver.distributedtx.recovery.port

    Port number of the management server

    ejbserver.http.port

    Port number of in-process Naming Service

    ejbserver.naming.port

    Port number of the RMI registry

    ejbserver.rmi.naming.port

    Port number of NIO HTTP server

    webserver.connector.nio_http.port

    Web server

    http port number

    Listen

    Port number of the worker

    worker.<worker name>.port

    Example of editing the Configuration Change definition file is as follows: The part that is bold and highlighted is the part to be edited.

    <?xml version="1.0" encoding="UTF-8"?>
    <unit-addition xmlns="http://www.cosminexus.com/mngsvr/schema/UnitAddition-2.5">
      <web-system>
        <name>MyWebSystem</name>
     
        <!--Specify the settings for the Service Unit to add.-->
        <unit>
          <name>unit2</name>
          <allocated-host>
            <host-ref>@myhost</host-ref>
            <hosts-for>combined-tier</hosts-for>
            <define-server>
              <logical-server-name>MyPerformanceTracer2</logical-server-name>
              <logical-server-type>performance-tracer</logical-server-type>
          <configuration>
            <param>
              <param-name>PRFID</param-name>
              <param-value>PRF_ID2</param-value>
            </param>
          </configuration>
            </define-server>
            <define-server>
              <logical-server-name>MyJ2EEServer2</logical-server-name>
              <logical-server-type>j2ee-server</logical-server-type>
              <configuration>
                <param>
                  <param-name>ejbserver.distributedtx.recovery.port</param-name>
                  <param-value>20303</param-value>
                </param>
                <param>
                  <param-name>ejbserver.http.port</param-name>
                  <param-value>8081</param-value>
                </param>
                <param>
                  <param-name>ejbserver.naming.port</param-name>
                  <param-value>901</param-value>
                </param>
                <param>
                  <param-name>ejbserver.rmi.naming.port</param-name>
                  <param-value>23153</param-value>
                </param>
                <param>
                  <param-name>webserver.connector.nio_http.port</param-name>
                  <param-value>8008</param-value>
                </param>
              </configuration>
            </define-server>
            <define-server>
              <logical-server-name>MyWebServer2</logical-server-name>
              <logical-server-type>web-server</logical-server-type>
            <configuration>
                <param>
                  <param-name>Listen</param-name>
                  <param-value>81</param-value>
                </param>
                <param>
                  <param-name>worker.list</param-name>
                  <param-value>worker1</param-value>
                </param>
                <param>
                  <param-name>worker.worker1.port</param-name>
                  <param-value>8008</param-value>
                </param>
              </configuration>
            </define-server>
          </allocated-host>
       </unit>
      </web-system>
    </unit-addition>
    Note:

    Delete the host definition (<host> tag).

  3. Execute the cmx_change_model command and the cmx_build_system command with the command prompt, and add the logical server (Web server, the J2EE server, and performance tracer) from Configuration Change definition file edited in step 2.

    Command execution example is as follows:

    cmx_change_model -m localhost:28080 -u admin -f <file path of Configuration Change Definition file>
    cmx_build_system -m localhost:28080 -u admin -s MyWebSystem

    Specify the file name and the path of the Configuration Change definition file (MyWebSystemAddUnit.xml) storage directory in step 1 in file-path-of-Configuration-Change-definition-file.

(3) Startup and login of Management Portal

If you have already logged in to the management portal, proceed to (4) Batch start of the added logical servers.

  1. Start the Web browser, connect to http://localhost:28080/mngsvr/index.jsp, and start the management portal.

  2. Enter "admin" in the management user ID on the Login Management Server window, and click the Login button.

(4) Starting added logical servers as batch

  1. Click Start/Stop the Logical Server on the Management Portal window.

  2. In the Server View tab, click DefaultDomain, and then click the Batch Startup tab.

  3. Click the Execute button on the Batch Start window.

    The request for batch startup is received, and the operational status of logical servers in the Operational Status of Logical Servers window changes to "Operating".

(5) Setting and starting the resource adapter on the added J2EE server (MyJ2EEServer2)

  1. Click Application Management of the Logical Servers on the Management Portal window.

  2. Click DefaultDomain - Logical J2EE Server - J2EE Server - MyJ2EEServer2 - Resources - Resource Adapter, and then click the Import tab.

  3. Set the information of the resource adapter to be imported to MyJ2EEServer2 in the Import Resource Adapter window, and click the Execute button.

  4. Click the Back anchor if "Success" is displayed in the Execution result.

    If "Failure" is displayed in the Execution result, click the Display log tab, check the message in the Display Log window, remove the cause of failure, and then import the resource adapter again.

  5. Click DefaultDomain - Logical J2EE Server - J2EE Server - MyJ2EEServer - Resources - Resource Adapter, and then click the Property Settings tab.

  6. Click the Basic Settings anchor of Operation of the resource adapter imported in step 3, in the Resource Adapter Property Settings window.

  7. Set the basic information and properties in the Basic Settings of Resource Adapter window, and click the Settings button.

  8. Check the message displayed on the Basic Settings of Resource Adapter window, and click the Back anchor.

    If a failure message is displayed, remove the cause of the failure and then set the property again.

  9. Click the Start anchor of Operation in the Start/Stop Resource Adapter window.

  10. Click the Yes button in the Start Resource Adapter window.

  11. Click the Back anchor if "Success" is displayed in the Execution result.

    If "Failure" is displayed in the Execution result, click the Display log tab, check the message in the Display Log window, remove the cause of failure, and then start the resource adapter again.

(6) Setting and starting the business application on the added J2EE server (MyJ2EEServer2)

  1. Click Application management of the Logical servers on the Management Portal window.

  2. Click DefaultDomain - Logical J2EE Server - J2EE Server - MyJ2EEServer2 - Application and then click the Import tab.

  3. Select the same J2EE application (MyApp) from the J2EE application files on the Import J2EE Application window, and then click the Execute button.

    Reference note

    Import the uploaded J2EE application so that the same business application can also operate on the added J2EE server. For operating a different business application, first upload the J2EE application, and then import.

  4. Click the Back anchor if "Success" is displayed in the Execution result.

    If "Failure" is displayed in the Execution result, click the Display log tab, check the message in the Display Log window, remove the cause of failure, and then import the J2EE application again.

  5. Click the Start/Stop tag.

  6. Click the Start anchor of Operation for the application imported in step 3, existing in the Import J2EE applications list on the Start/Stop J2EE Application window.

  7. Click the Yes button on the Start J2EE Application window.

  8. Check the Execution result, and click the Back anchor.

    If "Failure" is displayed in the Execution result, click the Display log tab, check the message in the Display Log window, remove the cause of failure, and then start the J2EE application again.

    If "Success" is displayed in the Execution result, the Status of the Start/Stop J2EE Application window changes to "Operating".