+

Search Tips | Advanced Search

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


Build and running the MobileFirst Server

Use the scripts that are provided to build and run your customized server. We can find the scripts in the V8.0.0 package installation directory under mfpf-server-libertyapp/scripts.


Before you begin

Scripts can only be run from within the scripts folder. Do not modify the given folder structure.

The following methods are supported for passing parameters to the scripts:


Procedure

Based on the database type used we can follow one of the options below.

  1. Create a Bluemix® database service instance.

    We can create a database service instance on Bluemix in two ways:

    • Using the Bluemix dashboard.
    • Using the Cloud Foundry command line utility.

    To create a service instance of dashDB™ database on Bluemix, follow the next steps.

    1. Log in to Bluemix.
    2. Select the space name where we want to create the service instance (example: dev).
    3. Click USE SERVICES OR APIS.
    4. Search for dashDB, from the services catalog.
    5. Select a value of Leave unbound for the App field. Enter a name for the service instance in the Service name field. Select an Enterprise Transactional Plan for the service and click CREATE.

      Note:

      dashDB Enterprise Transactional Bluemix plans are the only dashDB plans supported. dashDB Transactional plans currently available are:

      • Enterprise Transactional 2.8.500
      • Enterprise Transactional 12.128.1400

      The dashDB database service instance is created on Bluemix.

    Using the Cloud Foundry command line utility:

    1. Log in to Bluemix by using the following command:

      cf login [-a API_URL] [-u USERNAME] [-p PASSWORD] [-o ORG] [-s SPACE]

      Where:

        -u user_name
        Your user name.
        -p password
        Your password.

        Security consideration: If you provide the password using the -p parameter, the password might be recorded in your command line history. If you do not want the password to be recorded, instead of using the -p parameter, consider entering the password when the command line interface prompts you, during the execution of the cf login command.

        -o organization_name
        The name of the organization that we want to log in to.
        -s space_name
        The name of the space that we want to log in to.
        -a https://api.DomainName
        The URL of the API endpoint of Bluemix. This parameter is optional.

    2. To create the service instance, run the following command:

      cf create-service service_name plan_name service_instance

      We can use one of the following examples:

      cf create-service dashDB EnterpriseTransactional2.8.500 mfpfdashdbservice

      cf create-service dashDB EnterpriseTransactional12.128.1400 mfpfdashdbservice

    Note: The deployment of the dashDB Enterprise Transactional plans may not be immediate. You might be contacted by the Sales team before the deployment of the service.

  2. Bring your own IBM DB2 database.

    We can choose to use your own instance of DB2 database, perform the following steps to configure DB2 database :

    1. Set up your DB2 server.
    2. Create a database on the DB2 server. We can refer to DB2® database and user requirements, for more information.
    3. Make a note of the following regarding your DB2 installation.

      Parameters Description
      Host Hostname where the DB2 is setup. This host should be accessible from the machine where the scripts are run, as well as from Bluemix where the MobileFirst Server server will be started.
      Database The database name.
      Port Port number for the database.
      Username Username for the database user. You will need to ensure that the user has correct permissions to create tables under the Schema name provided.
      Password Password for the database user.
      Schema name Name of the schema where you would like the scripts to create the database tables. If the schema does not already exist, the scripts will attempt to create it.

  3. Run the scripts in the order listed:

      initenv.sh
      This script logs in to the container service. You must run this script before we can run any subsequent scripts.
      Your Bluemix log-in credentials as well as the organization name and space name are required arguments.
      prepareserverdbs.sh

      This script prepares the dashDB database service instance by creating the required tables and also configures the MobileFirst Server to use the database.

      Supported options include dashDB service (Transactional Plans) or DB2 (bring your own DB2 database).

      If your choose dashDB, then Bluemix database service instance name Service name, created in Step 1, is supplied as an argument to this script.

      If you select to use IBM DB2, then make a note of the database details with you, to supply as input parameters to the script.

      We can optionally specify a database schema name. The default schema name is MFPDATA.

      prepareserver.sh
      This script builds the server application with the mfp-server-libertyapp customizations and pushes the application to IBM® Bluemix.
      Provide a value for the mandatory argument, -n|--name [APP_NAME]
      startserver.sh
      The script starts the Cloud Foundry application built and deployed in the previous step.

Parent topic: MobileFirst Server as Liberty for Java Cloud Foundry application on IBM Bluemix