+

Search Tips   |   Advanced Search

Install a server farm using an Ant task

  1. Configure the REST connector of all the Liberty servers of the farm.

    This configuration defines the following parameters for each Liberty server:

    • The Liberty administrator and password
    • The keystore

  2. Write the XML configuration file for the farm plug-in.

    The configuration file is a flat file in XML format. We must write it manually. In this file, each server is defined as an XML element with attributes specific to each type of supported application server: WebSphere Application Server Express or Base, Liberty, or Tomcat. These attributes identify a server as unique, indicate the connection type and ports to use, and provide credentials for authentication purpose when applicable. Your configuration file is read by the farm plug-in at run time and validated against the FarmSchema.xsd XML schema. When we write the configuration file, we can use the schema to ensure that the XML code complies with it to prevent any problem at run time.

    Give the configuration files meaningful names, for example TomcatFarm.xml or LibertyFarm.xml.

    The contents of the configuration file depends on the type of application server.

  3. Customize the Ant script to configure the databases.

    1. If we must create the database, do as follows:

      • Edit the Ant script we will use later to configure the databases.

        To help you write configuration files, sample Ant files that use these Ant tasks are provided in MF_HOME/WorklightServer/configuration-samples.

        The files are named after this pattern:

          create-database-database.xml

        See Sample configuration files.

      • To create the administration services databases

          ant -f create-database-database.xml admdatabases

      • If only one MobileFirst project is deployed in the farm, run the following command to create the project.databases:

          ant -f create-database-database.xml databases

      • If several MobileFirst projects are to be deployed in the farm, each MobileFirst project must have its own database. Create a copy of the Ant file per project. Each one must point to a different database or schema, or, for Oracle, have a different user. Then, run the database target for each file.

      Because all the servers in the farm must share MobileFirst Server databases, you run these commands only once, even if you defined several servers.

    2. If the databases are created, and we must create only the database tables:

      • Edit the Ant script we will use later to create and configure the databases.

        To help you write configuration files, sample Ant files that use these Ant tasks are provided in...

          MF_HOME/WorklightServer/configuration-samples

        The files are named after this pattern:

          configure-appServer-database.xml

        See Sample configuration files.

      • To create the administration services databases, run these commands:

          ant -f configure-appServer-database.xml admdatabases

      • If only one MobileFirst project is deployed in the farm, run the following command to create the project.databases:

          ant -f configure-appServer-database.xml databases

      • If several MobileFirst projects are to be deployed in the farm, each MobileFirst project must have its own database. Create a copy of the Ant file per project. Each one must point to a different database or schema, or, for Oracle, have a different user. Then, run the database target for each file.

      Because all the servers in the farm must share Worklight databases, you run these commands only once, even if you defined several servers.

  4. Customize and run the Ant script so that each server becomes a farm node.

    For each server to promote as a farm node...

    1. Edit the Ant script that we use to configure the server.

      To install the administration services and the MobileFirst runtime environments, the script must contain at least the admininstall and install targets.

      To help you write configuration files, sample Ant files that use these Ant tasks are provided in MF_HOME/WorklightServer/configuration-samples. The files are named after this pattern: configure-appServer-database.

      See Sample configuration files.

    2. For WAS Liberty profile, modify the JMX tag to define the Liberty administrator credentials. In the Ant file, replace the empty <jmx/> tag by the following line.

        <jmx libertyAdminUser="demo" libertyAdminPassword="demo" createLibertyAdmin="false"/>

      Where:

      • libertyAdminUser is the name of the Liberty administrator.
      • libertyAdminPassword is the password of the Liberty administrator.
      • If createLibertyAdmin is set to false, the Ant task does not attempt to add the user in the basic registry, or to declare it as a Liberty administrator.

    3. Optional: In addition, if the server farm includes several Tomcat servers on the same computer, specify a different JMX port number for each server by setting the tomcatRMIPort attribute of the <jmx> element inside the installworklightadmin Ant task.

      This port number must match the value of the JMXPortNumber attribute of the corresponding <TomcatNode> element in the configuration file.

      For example, consider a farm with several Tomcat servers, two of which are on the same computer. Assign port 8686 to the first server and 8687 to the second.

      1. In the Ant script, add the following elements.

        • For the first server: <jmx tomcatRMIPort="8686"/>
        • For the second server:<jmx tomcatRMIPort="8687"/>

      2. In the configuration file of the farm, add the following elements.
        <TomcatNode .. JMXPortNumber="8686">
        <TomcatNode .. JMXPortNumber="8687">

    4. Stop all the servers that you are about to configure as members of a server farm.

    5. Deploy the administration services and MobileFirst runtime environments on the targeted application server.

      Run the following commands for each server of the farm.

        ant -f configure-<appServer>-<database>.xml adminstall
        ant -f configure-<appServer>-<database>.xml install

  5. Manually add the necessary JNDI properties.

    Depending on the type of application server...

    See following documentation.

  6. Exchange the public certificates between all the servers of the farm.

  7. Replicate the LTPA keystores across farm members.

    For a Liberty farm, see step 9 in Configure a Liberty server farm manually.


What to do next

Start the servers.

Set up an IBM HTTP Server for Liberty. See Set up an IBM HTTP Server in WAS Liberty profile farm.


Parent topic: Install a server farm