Use the scripts that are provided to build and run your customized server. You can find
the scripts in the V8.0.0 package
installation directory under mfpf-server-libertyapp/scripts.
Before you begin
- You finished customizing the server.
About this task
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 you can follow one of the options below.
- Create a Bluemix® database service instance.
You 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.
- Log in to Bluemix.
- Select the space name where you want to create the service instance (example:
dev).
- Click USE SERVICES OR APIS.
- Search for dashDB, from the services catalog.
- 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:
- 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 you want to log in to.
- -s space_name
- The name of the space that you want to log in to.
- -a https://api.DomainName
- The URL of the API endpoint of Bluemix. This parameter
is optional.
- To create the service instance, run the following command:
cf create-service
service_name
plan_name
service_instance
You 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.
- Bring your own IBM DB2 database.
You can choose to use your own instance of DB2 database, perform the following steps to configure
DB2 database :
- Set up your DB2 server.
- Create a database on the DB2 server. You can refer to DB2® database and user
requirements, for more
information.
- 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. |
- Run the scripts in the order listed:
- initenv.sh
- This script logs in to the container service. You must run this script before you 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.
You 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.