Get Started with Predix Search

Predix Search Service Setup

Before you can use Predix Search, you must create an instance of the service, bind the instance to your application, and enable authentication and authorization of the service instance.

Authentication and authorization are controlled by the User Account and Authentication (UAA) web service. You must set up a UAA service instance as a designated trusted issuer before creating your Predix Search service instance. For information about authentication and authorization in Predix services, see the UAA Service Overview.

Task Roadmap

Note: If you have used other services from the Predix catalog, you probably already have UAA services set up. If so, you can start with Task 4 below to create your Predix Search service instance.
TaskReferences
1Configure your proxy settings.Depending on your location and network configuration, you may need to configure your proxy settings to access remote resources.

See t_defining_proxy_connections_to_remote_resources.html#task_97cc6304-e168-459d-9952-a45708ff8361.

2Deploy your application to Cloud Foundry.See Creating and Deploying a Simple Web App to Cloud Foundry.
3Create a UAA service instance.See Creating a UAA Service Instance.
4Create a Predix Search service instance.

See Create a Predix Search Service Instance.

5Bind your application to the Predix Search service instance.See Bind an Application to a Predix Search Service Instance.

See also Unbind a Predix Search Service Instance.

6Create an OAuth2 client for the Predix Search service instance.The OAuth2 client enables the Predix Search service to make protected resource requests on behalf of the resource owner with the authorization of the resource owner.

See Creating an OAuth2 Client.

7Use the Predix Search service instance.See Index and Query the Predix Search Cluster.

Create a Predix Search Service Instance

A Predix Search service instance gives your application indexing and search capabilities.

Before You Begin

You must have a Predix account. See Registering for a Predix Account.

Procedure

  1. Sign into your Predix account at https://www.predix.io.
  2. In the main navigation bar, select Catalog.
  3. Select the Predix Cloud Services tab.
  4. Select the Predix Cloud Connect tile.
  5. Select Subscribe.
  6. Complete the entries on the New Service Instance page:
    FieldDescription
    ORGSelect your organization (if you belong to more than one org).
    SPACESelect the space for your application.
    USER ACCOUNT & AUTHENTICATION (UAA)Choose an existing UAA instance or create a new instance of UAA.

    See Creating a UAA Service Instance.

    SERVICE INSTANCE NAMESpecify a unique name for your instance.
    SERVICE PLANSelect a plan.
  7. Select Subscribe to service.

What To Do Next

Bind the Predix Search service instance to your application, after which you can retrieve service instance details from the VCAP_SERVICES environment variable for your application. See Bind an Application to a Predix Search Service Instance.

Use the cf CLI to Create a Predix Search Service Instance

The Cloud Foundry command line interface (cf CLI) enables you to create a Predix Search service instance and examine its settings.

Before You Begin

Bind the instance of your trusted issuer (UAA service) to your application. See Connecting Your Application to a Platform Service Instance.

The binding enables you to obtain the UAA service instance details, including issuerId, from the VCAP_SERVICES environment variable for your application.

About This Task

Note: Cloud Foundry CLI syntax can differ between Windows, Linux, and Macintosh operating systems. See the Cloud Foundry Help for the appropriate syntax for your operating system; for example, to see help for the create-service, or cs, command, run the command cf help cs.

Procedure

  1. Use the cf CLI to log into Cloud Foundry.
    cf login
    Enter your username and password when prompted by Cloud Foundry.
  2. Create a Predix Search service instance.
    cf cs predix-search <plan_name> <instance_name> -c '{"trusted_issuer_ids":["<trusted_issuer_id>"], "enable_dedicated_master":"<enable_dedicated_master>", "enable_multi_az":"<enable_multi_az>", "data_node_count":"<data_node_count>"}'
    • <plan_name> — Specify the service plan, such as Dedicated-E10.
    • <instance_name> — Provide a unique name for the service instance.
    • <trusted_issuer_id> — Substitute the issuerID of your trusted issuer (UAA instance); for example, https://bc199ceb-7ef6-4783-a0c6-2d8aa7ce3300.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token. Use a comma-separated list to specify multiple trusted issuers. You can obtain the issuerId from the VCAP_SERVICES environment variable for your application (if you have bound a UAA instance to your application).
    • <enable_dedicated_master> — Enter true or false to specify whether your service instance includes a dedicated master cluster. You can omit the enable_dedicated_master parameter, in which case the default is false.
      Note: A dedicated master cluster is mandatory if the number of data nodes is more than 10. See Predix Search Clusters.
    • <enable_multi_az> — Enter true or false to specify whether your service instance includes multiple availability zones. You can omit the enable_multi_az parameter, in which case the default is false.
    • <data_node_count> — Enter a integer value to specify the number of nodes in your Predix Search service cluster. If Multi-AZ is enabled, the data node count must be an even number. You can omit the data_node_count parameter, in which case the default is 1, unless Multi-AZ is enabled, in which case the default is 2.
      Note: Predix Search supports 10 data nodes for the Dedicated-E10 plan and up to 20 nodes for all other plans. See Predix Search Clusters.

What To Do Next

Bind the Predix Search service instance to your application, after which you can retrieve service instance details from the VCAP_SERVICES environment variable for your application. See Bind an Application to a Predix Search Service Instance below.

Bind an Application to a Predix Search Service Instance

Binding your application to a Predix Search service instance adds the service connection details to the VCAP_SERVICES environment variable.

About This Task

The Cloud Foundry runtime uses the VCAP_SERVICES environment variable to communicate with a deployed application about its environment. You can retrieve the following Predix Search service instance details from the VCAP_SERVICES environment variable:
  • Authorization credentials
  • HTTP header information for the service instance
  • URI of the service instance

Before You Begin

Your application must be available in Cloud Foundry. To learn about deploying your application to Cloud Foundry, see t_Deploying_an_App_to_Cloud_Foundry.html#task_xwn_lvb_vx.

Procedure

  1. Bind your application to a Predix Search service instance.
    cf bind-service <app-name> <instance-name>

    For example:

    
    $ cf bind-service sample_app_name test_instance_name
    Binding service test_instance_name to app sample_app_name in org predix-search / space search as [email protected]...
    OK
    TIP: Use 'cf restage sample_app_name' to ensure your env variable changes take effect
  2. Verify the binding and retrieve the Predix Search service instance credentials.
    cf env <app-name>

    For example:

    
    $ cf env sample_app_name
    Getting env variables for app sample_app_name in org predix-search / space search as [email protected]...
    OK
    "VCAP_SERVICES": {
      "predix-search": [
       {
        "credentials": {
         "data_node_count": 1,
         "dedicated_master_enabled": false,
         "zone_id": "8a350557-3f87-4222-84f9-b016cbe36fb1",
         "multi_az_enabled": false,
         "url": "https://predix-search-auth-app-prefectorial-dt.run.aws-usw02-dev.ice.predix.io"
        },
        "label": "predix-search",
        "name": "test_instance_name",
        "plan": "es-small",
        "provider": null,
        "syslog_drain_url": null,
        "tags": [
         "Predix-Search",
         "ES"
        ],
        "volume_mounts": []
       }
      ]

Unbind a Predix Search Service Instance

Unbind a Predix Search service instance to dissociate it from your application.

Procedure

To unbind a Predix Search service instance from an application, run the following command:
cf unbind-service <app-name> <instance-name>

Update a Predix Search Service Instance

Update a Predix Search service instance to modify the specifications for the dedicated master cluster, availability zones, and number of data nodes.

Procedure

  1. Modify the dedicated master cluster specification.
    cf update-service <instance-name> -c '{"enable_dedicated_master":"<true or false>"}'
    Note: A dedicated master cluster is mandatory if the number of data nodes is more than 10.
  2. Modify the availability zone specification.
    cf update-service <instance-name> -c '{"enable_multi_az":"<true or false>"}'
  3. Modify the data node count.
    cf update-service <instance-name> -c '{"data_node_count":"<node_count>"}'

    The data node count must be an integer value. If Multi-AZ is enabled, the data node count must be an even number.

    Note:
    • You can increase but not decrease the data_node_count value for a Predix Search service instance.
    • The maximum value for data_node_count for the Dedicated-E10 plan is 10; for all other plans, 20.

Delete a Predix Search Service Instance

Delete a Predix Search service instance when it is no longer needed.

Procedure

To delete a Predix Search service instance, run the following command:
cf delete-service <instance-name>

Authorities and Scopes Required for Predix Search

The OAuth2 client for your Predix Search service instance requires special parameters, including authorities and scopes, to enable the client to access the Predix Search cluster.

Required parameters:
  • Authorized Grant Typesrefresh_token, client_credentials, password
  • Scopesuaa.none
  • Authoritiesuaa.none, predix-search.zones.<zone_id>.user
  • Allowed Providersuaa