+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Install a server farm with Ant tasks

Use Ant tasks to configure each server in the farm according to the requirements of the single type of application server that is used for each member of the server farm.

When we plan a server farm with Ant tasks, first create the stand-alone servers and configure their respective truststores so that they can communicate with one another in a secure way. Then, run Ant tasks to configure the database instance that is shared by the MobileFirst Server components. Finally, run Ant tasks to deploy the MobileFirst Server components to each server and modify its configuration to make it a member of a server farm.


Procedure

  1. Prepare the application servers that must be configured as the server farm members.

    1. Choose the type of application server to use to configure the members of the server farm. IBM MobileFirst™ Platform Foundation supports the following application servers in server farms:

      • WebSphere® Application Server full profile

        Note: In a farm topology, we cannot use the RMI JMX connector. In this topology, only the SOAP connector is supported by IBM MobileFirst Platform Foundation.

      • WebSphere Application Server Liberty profile
      • Apache Tomcat

      To know which versions of the application servers are supported, see System requirements.

      Important:

      IBM MobileFirst Platform Foundation supports only homogeneous server farms. A server farm is homogeneous when it connects same type of application servers. Attempting to associate different types of application servers might lead to unpredictable behavior at run time. For example, a farm with a mix of Apache Tomcat servers and WebSphere Application Server full profile servers is an invalid configuration.

    2. Set up as many stand-alone servers as the number of members that we want in the farm.

      Each of these stand-alone servers must communicate with the same database. You must make sure that any port used by any of these servers is not also used by another server that is configured on the same host. This constraint applies to the ports used by HTTP, HTTPS, REST, SOAP, and RMI protocols.

      Each of these servers must have the MobileFirst Server administration service, the MobileFirst Server live update service, and one or more MobileFirst runtimes deployed on it.

      For more information about setting up a server, see Constraints on MobileFirst Server administration service, MobileFirst Server live update service and MobileFirst runtime.

    3. Exchange the signer certificates between all the servers in their respective truststores.

      This step is mandatory for the farms that use WebSphere Application Server full profile or Liberty as security must be enabled. In addition, for Liberty farms, the same LTPA configuration must be replicated on each server to ensure single-sign on capability. To do this configuration, follow the guidelines in step 6 of Configure a server farm manually.

  2. Configure the database for the administration service, the live update service, and the runtime.

    1. Decide which database that we want to use and choose the Ant file to create and configure the database in the mfp_install_dir/MobileFirstServer/configuration-samples directory:

      • For DB2®, use create-database-db2.xml.
      • For MySQL, use create-database-mysql.xml.
      • For Oracle, use create-database-oracle.xml.

      Note: Do not use the Derby database in a farm topology because the Derby database allows only a single connection at a time.

    2. Edit the Ant file and enter all the required properties for the database.

      To enable the configuration of the database that is used by the MobileFirst Server components, set the values of the following properties:

      • Set mfp.process.admin to true. To configure the database for the administration service and the live update service.
      • Set mfp.process.runtime to true. To configure the database for the runtime.

    3. Run the following commands from the mfp_install_dir/MobileFirstServer/configuration-samples directory where create-database-ant-file.xml must be replaced with the actual Ant file name that you chose:

      mfp_install_dir/shortcuts/ant -f create-database-ant-file.xml admdatabases

      mfp_install_dir/shortcuts/ant -f create-database-ant-file.xml rtmdatabases

      As the MobileFirst Server databases are shared between the application servers in a farm, these two commands must be run only once, whatever the number of servers in the farm.

    4. Optionally, if we want to install another runtime, we must configure another database with another database name or schema.

      To do so, edit the Ant file, modify the properties, and run the following command once, whatever the number of servers in the farm:

      mfp_install_dir/shortcuts/ant -f create-database-ant-file.xml rtmdatabases

  3. Deploy the administration service, the live update service, and the runtime on the servers and configure these servers as the members of a server farm.

    1. Choose the Ant file that corresponds to our application server and your database in the mfp_install_dir/MobileFirstServer/configuration-samples directory to deploy the administration service, the live update service, and the runtime on the servers.

      For example, choose the configure-liberty-db2.xml file for a deployment on Liberty server with the DB2 database. Make as many copies of this file as the number of members that you want in the farm.

      Note: Keep these files after the configuration as they can be reused for upgrading the MobileFirst Server components that are already deployed, or for uninstalling them from each member of the farm.

    2. Edit each copy of the Ant file, enter the same properties for the database that are used at step 2, and also enter the other required properties for the application server.

      To configure the server as a server farm member, set the values of the following properties:

      • Set mfp.farm.configure to true.
      • mfp.farm.server.id: An identifier that you define for this farm member. Make sure that each server in the farm has its own unique identifier. If two servers in the farm have the same identifier, the farm might behave in an unpredictable way.
      • mfp.config.service.user: The user name used to access the live update service. The user name must be the same for all the members of the farm.
      • mfp.config.service.password: The password used to access the live update service. The password must be the same for all the members of the farm.

      To enable the deployment of the WAR files of the MobileFirst Server components on the server, set the values of the following properties:

      • Set mfp.process.admin to true. To deploy the WAR files of the administration service and the live update service.
      • Set mfp.process.runtime to true. To deploy the WAR file of the runtime.

      Note: If we plan to install more than one runtime on the servers of the farm, specify the attribute id and set a value that must be unique for each runtime on the installmobilefirstruntime, updatemobilefirstruntime, and uninstallmobilefirstruntime Ant tasks. For example,

        <target name="rtminstall">
            <installmobilefirstruntime execute="true" contextroot="/runtime1" id="rtm1">

    3. For each server, run the following commands where configure-appserver-database-ant-file.xml must be replaced with the actual Ant file name that you chose:

      mfp_install_dir/shortcuts/ant -f configure-appserver-database-ant-file.xml adminstall

      mfp_install_dir/shortcuts/ant -f configure-appserver-database-ant-file.xml rtminstall

      These commands run the installmobilefirstadmin and installmobilefirstruntime Ant tasks. For more information about these tasks, see Ant tasks for installation of MobileFirst Operations Console, MobileFirst Server artifacts, MobileFirst Server administration, and live update services and Ant tasks for installation of MobileFirst runtime environments.

    4. Optionally, if we want to install another runtime, do the following steps:

      1. Make a copy of the Ant file that you configured at step 3.b.
      2. Edit the copy, set a distinct context root, and a value for the attribute id of installmobilefirstruntime, updatemobilefirstruntime, and uninstallmobilefirstruntime that is different from the other runtime configuration.
      3. Run the following command on each server on the farm where configure-appserver-database-ant-file2.xml must be replaced with the actual name of the Ant file that is edited:

        mfp_install_dir/shortcuts/ant -f configure-appserver-database-ant-file2.xml rtminstall

      4. Repeat this step for each server of the farm.
  4. Restart all the servers.

Parent topic: Install a server farm