Configuring Liberty for Bluemix Cloudant services

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.

Procedure

  1. Log in using the bluemixUtility login command. After your initial login, you do not have to complete this step again.
  2. 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 is a fully managed data layer designed for modern web and mobile applications that leverages a flexible JSON schema. 
    Cloudant is built upon and compatible with Apache CouchDB and accessible through a secure HTTPS API, which scales as your application grows. 
    Cloudant is ISO27001 and SOC2 Type 1 certified, and all data is stored in triplicate across separate physical nodes in a cluster for HA/DR within a data center.
    Documentation: https://console.ng.bluemix.net/docs/#services/Cloudant/index.html#Cloudant
    Plans: Standard, Lite
  3. Note: If you already created an instance, skip to the next step. 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 Lite myCloudantService
  4. 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 Lite
  5. Run the bluemixUtility import myCloudantService --pversion=v2 command to import the configuration.
    Important: The --pversion=v2 option installs the cloudant-1.0 feature and downloads the official Cloudant library for Java. For API information, see the official Cloudant Java library API documentation. If you omit the --pversion=v2 option, the couchdb-1.0 feature is installed and Ektorp libraries are used instead to communicate with the Cloudant instance.
    1. Accept the license terms and conditions of the necessary libraries that are needed to access the service.
    2. 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 downloaded libraries.
      <application id="myCloudantApp">
               <classloader commonLibraryRef="cloudantNoSQLDB-library"/>
      </application>
  6. Optional: Run the bluemixUtility listImports command to view the service configurations that you imported.
    The following IBM Bluemix service configurations have been imported:
    myCloudantService
  7. 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.
    If you imported the service with the --pversion=v2 option to use the official Cloudant Java libraries, the default JNDI name for the Cloudant database is cloudant/serviceName. If you did not specify that option, the default JNDI name is couchdb/serviceName. If your application references the database by using a different JNDI name, use --vjndiName option to specify the JNDI name.
    bluemixUtility bind defaultServer myCloudantService --vjndiName=couchdb/connector

Results

You can now use Cloudant services with your Liberty server.

Icon that indicates the type of topic Task topic

File name: twlp_config_blmx_cloudant.html