Configuring a database instance on IBM Cloudant

You can configure a IBM MobileFirst™ Platform Foundation container to use a database instance on Cloudant®.com.

Before you begin

To configure your container to use a database instance that is hosted on Cloudant.com, you need your Cloudant user name and password and the URL of the database instance.

This type of database configuration does not require that you run the mfpf-server/scripts/prepareserverdbs.sh script.

Procedure

  1. Using the example code snippet, create an XML configuration file for the MobileFirst Server administration database and place it in the mfpf-server/usr/config folder. Make sure to customize the example code with your Cloudant.com account information and URL.
    <?xml version="1.0" encoding="UTF-8"?><server description="new server">
    <jndiEntry jndiName="${env.MFPF_ADMIN_ROOT}/mfp.db.cloudant.username" value="cloudant_username"/>
    <jndiEntry jndiName="${env.MFPF_ADMIN_ROOT}/mfp.db.cloudant.password" value="cloudant_password"/>
    <jndiEntry jndiName="${env.MFPF_ADMIN_ROOT}/mfp.db.cloudant.url" value="cloudant_db_url"/>
    </server>
  2. Using the example code snippet, create an XML runtime database configuration file for each runtime project to be deployed using MobileFirst Server and place the files in the mfpf-server/usr/config folder. Make sure to customize the example code with your project name and your Cloudant.com account information and URL.
    <?xml version="1.0" encoding="UTF-8"?><server description="new server">
    <jndiEntry jndiName="<project_name/mfp.db.cloudant.username" value="<cloudant_username"/>
    <jndiEntry jndiName="project_name/mfp.db.cloudant.password" value="cloudant_password"/>
    <jndiEntry jndiName="project_name/mfp.db.cloudant.url" value="<cloudant_db_url"/>
    <application id="project_name" location="project_name.war" name="project_name" type="war">
    <classloader delegation="parentLast">
    <privateLibrary id="worklightlib_project_name">
    <fileset dir="${shared.resource.dir}/lib" includes="worklight-jee-library.jar"/>
    <fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.crypto.passwordutil*.jar"/>
    </privateLibrary>
    </classloader>
    </application>
    </server>

What to do next

After the XML configuration file is in place, continue with the container set up process. The next step is to run the mfpf-server/scripts/prepareserver.sh script. The XML file you created gets used by the script for database configuration.