Use the scripts that are provided to build and run your
customized image. You can find the scripts in the V8.0.0 package
installation directory under mfpf-server/scripts.
Before you begin
- You finished customizing the image.
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
The first step describes how to retrieve the public IP
address to be bound with the container, which is a required argument
when you run the startserver.sh script (as described
in step 2).
- Retrieve and take note of a public IP address to bind to
the container.
To get IP information, use
Cloud Foundry CLI plug-in for
IBM® Containers
(
cf ic) commands.
- To retrieve the list of IP addresses that are potentially available to you (based on user ID),
run cf ic ip list.
The IP addresses that are listed with no corresponding
container ID are available for use.
An IP address with a corresponding container ID indicates
that the IP address is already in use. If all IP addresses are already in use, you can request a new
IP address.
- To request a new IP address, run cf ic ip request.
- 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.
Use one of the following methods to create the database
service instance.
Using the Bluemix dashboard:
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.
- 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.
- Your Bluemix database
service instance name Service name,
created in Step 2, is supplied as an argument to this script.
- You can optionally specify a database schema name. The default
schema name is MFPDATA.
- prepareserver.sh
- This script builds the server image with the mfp-server customizations
and sends the image to IBM Containers.
- The MobileFirst Server image
name is a required argument. Use the following format: BluemixRegistry/PrivateNamespace/ImageName:TagName.
Example: registry.ng.bluemix.net/PrivateNamespace/mfpserver
- startserver.sh
- The script runs the MobileFirst Server image
as a stand-alone container.
- The MobileFirst Server image
name, the container name, and the public IP address from which the
container is started (from step 1) are required arguments for running
the image as a container.
-
Tip: If you are running a startserver.sh or startservergroup.sh script
interactively and configuring an analytics image (by using MFPF_PROPERTIES),
you must provide the configuration information every time the script
is run, and for each runtime, to avoid losing the configuration. For
example, if you provided an analytics configuration (such as MFPF_PROPERTIES=mfp.analytics.url:http://127.0.0.1/analytics-service/rest,mfp.analytics.console.url:http://127.0.0.1/analytics/console for
the first runtime but did not provide it the next time that you ran
the script for a different runtime, the configuration for the MobileFirst Server would
be lost.
- startservergroup.sh
- The script runs the MobileFirst Server image
as a container group.
- Required arguments include: the MobileFirst Server image
name, the container group name, the minimum and maximum number of
container instances within the group, and the host name to which the
group must be mapped.