Use the IBM® Bluemix® utility
command-line integration tool to configure your Liberty server to use the Bluemix
Cloudant® service.
Before you begin
Before you configure your
Liberty server to use
Bluemix services, you must create an
account. See
Sign up for IBM
Bluemix to create your
Bluemix account.
About this task
Configure your Liberty server to
use the Cloudant service. For more
information about Cloudant, see Getting started with Cloudant NoSQL DB.
Additionally, your application must use the Ektorp library to access the Cloudant service. See Welcome to Ektorp for more
information.
Procedure
- Log in using the bluemixUtility login command. After your initial login, you
do not have to complete this step again.
- Run the bluemixUtility marketplace command to list details about all the Bluemix services that can be used with the
command-line utility. See the following example:
Service: cloudantNoSQLDB
Description: Cloudant NoSQL DB provides access to a fully managed NoSQL JSON data layer that's always on.
This service is compatible with CouchDB, and accessible through a simple to use HTTP interface for mobile
and web application models.
Documentation: https://www.ng.bluemix.net/docs/#services/Cloudant/index.html#Cloudant
Plans: Shared, Enterprise SMB, Enterprise Standard
Note: If you already created an instance, skip to step 4. You can also create an instance from the
Bluemix dashboard.
Run the bluemixUtility createService [options]
serviceType
servicePlan
serviceName command to create an instance of the Bluemix services that you want to use. See the following example and description of a service listed:
$ bluemixUtility createService cloudantNoSQLDB Shared myCloudantService
- Optional: Run the bluemixUtility listServices command to view the Name, Type, and Plan
of all the services instances that you created. See the following example:
myCloudantService cloudantNoSQLDB Shared
- Run the bluemixUtility import myCloudantService command to import the
configuration.
- Accept the license terms and conditions of the necessary libraries that are needed to access
the service.
- After the configuration is successfully imported, complete any additional steps to use the
imported configuration in your application, such as adding a classloader reference to the library.
For example, you must add the following classloader reference to your application to use the
Ektorp libraries that are downloaded.
<application id="myCloudantApp">
<classloader commonLibraryRef="cloudantNoSQLDB-library"/>
</application>
- Optional: Run the bluemixUtility listImports command to view the
service configurations that you imported.
The following IBM Bluemix service configurations have been imported:
myCloudantService
- Run the bluemixUtility bind [options]
serverName
serviceName to bind the configuration to a Liberty server. Accept the license terms
and conditions, if you are prompted. See the following example and description of a service listed:
$ bluemixUtility bind defaultServer myCloudantService
Checking if features required for the myCloudantService are installed.
All required features are installed.
The myCloudantService is now bound to defaultServer server.
The couchdb-1.0 feature is required. The default JNDI name for the Cloudant database is
couchdb/serviceName. If your application uses a different JNDI
name to access the database instance, use --vjndiName option to specify the JNDI
name. See the following example: $ bluemixUtility bind defaultServer myCloudantService --vjndiName=couchdb/connector
Results
You can now use
Cloudant
services with your
Liberty
server.