Using Aerospike EE OnDemand Service for Pivotal Platform

This topic describes how to use Aerospike EE OnDemand Service for Pivotal Platform.

After installing and configuring the Aerospike EE OnDemand Service for Pivotal Platform tile, developers can create service instances of Aerospike service plans and bind them to their apps using the Cloud Foundry Command Line Interface (cf CLI). Binding an Aerospike service instance to an app provides the app with information it can use to store and retrieve information in an Aerospike database.

When creating an Aerospike service instance, the tile will also create an Aerospike Management Console (AMC) that can be used to monitor the health and activity on the Aerospike cluster.

Create and Bind a Service Instance Using the cf CLI

To create an Aerospike service instance using the cf CLI, perform the following steps:

  1. Set your API endpoint to the Cloud Controller of your deployment.

    $ cf api api.YOUR-SYSTEM-DOMAIN
    Setting api endpoint to api.YOUR-SYSTEM-DOMAIN...
    OK
    API endpoint:  https://api.YOUR-SYSTEM-DOMAIN (API version: 2.59.0)
    Not logged in. Use 'cf login' to log in.
    

  2. Log in to your deployment and select an org and a space.

    $ cf login
    API endpoint: https://api.YOUR-SYSTEM-DOMAIN
    Email> user@example.com
    Password>
    

  3. List the Marketplace services and locate the Aerospike service. The service plans match the namespaces that have been configured on the Aerospike database.

    $ cf marketplace
    Getting services from marketplace in org system / space apps-manager as admin...
    OK

    service plans description aerospike-on-demand small, medium, large An enterprise-class NoSQL database providing speed at scale

    TIP: Use 'cf marketplace -s SERVICE' to view descriptions of individual plans of a given service.

  4. Create an instance of the Aerospike service, specifying both the name of the service plan and the name of the service instance. This example uses the small plan.

    $ cf create-service aerospike-on-demand small YOUR-SERVICE-INSTANCE -c YOUR-EXTRA-CONFIG
    

    YOUR-EXTRA-CONFIG must be well formed JSON adhering to the schema and can be either inline or a file. At miniumum you must configure cluster_name and one namespace block.

    Example:

    cf create-service aerospike-on-demand small my-cluster -c '{"namespaces": [{"name":"test", "storage_type": "memory", "memory_size": "500M"}], "cluster_name": "my-cluster"}'
    
    See here for a description of the possible values (based on the schema)

  5. Bind the instance to an app, adding a parameter with name setname, and set the value to the name of the set in the Aerospike database that this app should use to store its data.

    $ cf bind-service YOUR-APP YOUR-SERVICE-INSTANCE
    Binding service YOUR-SERVICE-INSTANCE to app YOUR-APP in org example / space development as user@example.com...
    OK
    TIP: Use 'cf restage YOUR-APP' to ensure your env variable changes take effect
    

  6. Restage the app for the binding to take effect.

    $ cf restage YOUR-APP
    
    The app now has all the credentials required to connect to the Aerospike database in the VCAP_SERVICES environment variable.

Updating a Service Instance Using the cf CLI

If you have a service running but need to change some of the configuration you may use the update-service command. This command also takes extra config but with a slightly different schema.

$ cf update-service aerospike-on-demand YOUR-SERVICE-INSTANCE -c YOUR-EXTRA-CONFIG

See here for a description of the possible values for an update (based on the schema)

Enabling TLS

see https://www.aerospike.com/docs/guide/security/tls.html

TLS is optional but may be configured via extra config. To enable full tls:

  1. tls_enable must be set to true
  2. tls_private_key must be provided
  3. tls_public_key must be provided
  4. tls_ca_cert must be provided.

Enabling XDR

see https://www.aerospike.com/docs/architecture/xdr.html

XDR allows you to synchronize clusters on a per-namespace basis. Aerospike clusters within pivotal may ship data to up to 5 different destinations.

NOTE: The destination cluster in an xdr setup must be already deployed in Pivotal Platform. If a source cluster must be created before the destination cluster it must be created and then updated as a second step.

To enable xdr you must set at the top level:

  1. xdr_enable must be set to true at the top level.
  2. xdr_deployments must be configured with the names of all of the service instances to be used by any of the namespaces (MAX 5)

And for each namespace xdr shipping is desired:

  1. xdr_enable must be set to true to enable xdr for that namespace
  2. xdr_endpoints must be set with at least one of the configured xdr_deployments values.

Complete example of two clusters with TLS and two way XDR

In this example we would be deploying two clusters each with TLS and XDR shipping bidirectionally (active-active) for the test namespace. Note this must be done in 3 steps.

Deploy first cluster:

This is the file containing the extra configuration. Note in this first cluster there is no xdr information

cluster1deployconfig.json

{
  "tls_ca_cert": "-----BEGIN CERTIFICATE-----\nMIIEZTCCAs2gAwIBAgIQdHIKbqSUoVdJd+hHDyjLRDANBgkqhkiG9w0BAQsFADA8\nMQwwCgYDVQQGEwNVU0ExFjAUBgNVBAoTDUNsb3VkIEZvdW5kcnkxFDASBgNVBAMT\n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wQ0f85s8gZoo8iniFf7rkpWmdG3wkvdUhg\nrTq8SjrnVElLkQNs8+TEKls3SQXajaOCBiGpOnlEmNNHo88wpja1oUf+px3Yxvm9\noya61H5c09trrihqdGgRV2sM4/ywhQPBhIXkTcvYB9kCgcEA1CQqckotCCjWaktI\nQtvYMYVbALCIjwHTe9aSfMcCBXvpxAohAp0n0G81RqFnSTuqVC/+/6pJThjNR7F6\ng1JL3owJIOcrASjWOrYUxOlJt/oX0cjrG67qbouabqGGrdrzW55/fgVPblH/mOq9\nFyB6eiaaqil2wBV5U9ikflrmd3rNXiVG8uEDi+bv09q3AQzP/4d2V5itDnx07DEa\n6vTeOlrlc3+1wEaVyWrGXq858pVgJeV3D3DZW4UkBr1ciYb9AoHBAKG8fdnULvwS\nw4GJVKt1h4AKlu14GGvDxzxai0jM502UZ9izJ/kdh16n/TSNDLPCcoBhy2qZu/6E\nbMoBbgbP5KFYPSGiJoH6vmRgbzBQQ7XigjcwIs7vkTDNVomqADpFf08SvPMtIHuS\nEwQHGSrOnF+pWjlAKwhyJkks3dvQMsTJbNpmJWTHAf8Irqc484uc4RWZfzMb5a3E\nNgx8bTw+JeMn4QnZWyYFCj4fTNIqqI+hfRCNtml09WJHL6GZWzd15Q==\n-----END RSA PRIVATE KEY-----\n",
  "tls_enable": true,
  "tls_public_key": "-----BEGIN CERTIFICATE-----\nMIIEdDCCAtygAwIBAgIQX5QSEqs2S6t6OWsZffTZcTANBgkqhkiG9w0BAQsFADA8\nMQwwCgYDVQQGEwNVU0ExFjAUBgNVBAoTDUNsb3VkIEZvdW5kcnkxFDASBgNVBAMT\nC2Flcm9zcGlrZWNhMB4XDTE5MDgwNzIxMjEwMVoXDTIwMDgwNjIxMjEwMVowOTEM\nMAoGA1UEBhMDVVNBMRYwFAYDVQQKEw1DbG91ZCBGb3VuZHJ5MREwDwYDVQQDEwhj\nbHVzdGVyMTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAMhzsdffdJTT\ngv8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Rh89gFW40i1UvC5sne3aNB+kDygaadNRWIzuwb56lxQuMHTUvyd\n9mQq16rMRWw5eIkbtuCdmH5Pg5syPsOWiELfxdnE4GyAs8hQReZKc3yo16f3ktqG\nsySaDfYtKwESWiSOkYK6Z4JcDZKfwMd1kYx2UoCpaFaX7i9z0KA37Q==\n-----END CERTIFICATE-----\n",
  "cluster_name": "cluster1",
  "namespaces": [
    { "storage_type": "memory", "memory_size": "500M", "name": "test" }
  ]
}

 cf create-service aerospike-on-demand small cluster1 -c cluster1deployconfig.json

Deploy second cluster:

This is the file containing the extra configuration for cluster two. In this one we are able to add in all of the xdr links since we already have the first cluster up.

WARNING: You must wait for the first cluster to successfully deploy before deploying the second cluster.

cluster2deployconfig.json

{
  "cluster_name": "cluster2",
  "tls_ca_cert": "-----BEGIN CERTIFICATE-----\nMIIEZTCCAs2gAwIBAgIQdHIKbqSUoVdJd+hHDyjLRDANBgkqhkiG9w0BAQsFADA8\nMQwwCgYDVQQGEwNVU0ExFjAUBgNVBAoTDUNsb3VkIEZvdW5kcnkxFDASBgNVBAMT\nC2Flcm9zcGlrZWNhMB4XDTE5MDgwNzIxMjEwMVoXDTIwMDgwNjIxMjEwMVowPDEM\nMAoGA1UEBhMDVVNBMRYwFAYDVQQKEw1DbG91ZCBGb3VuZHJ5MRQwEgYDVQQDEwth\nZXJvc3Bpa2VjYTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBANJcN4/b\nX4TyC/K2Uzd/nhB53/UwKOoNmOrzXmNjWwICehLVa+YHDOVNenifSTz45rAYHR/f\nUMaNqgN26FB19To7qsdfwPmF0xoKtAwUltdxYt3RnnssFJNGHdpdFNOZU09eKJG0\nqyGJ2FhyhokZV9TZLr/u5n34CPkdgdPIchraqEVs2r0xsdQp/Cdj7SgqL9+LCD+E\ncDACWxpUGbTBRHkEKCMsj+ukapF6Sg5DffQbQGOzGyROmHRLPOQNDTw0ovj03Yb+\n12F3f2v1sqHG+a9HyjnY0tBiRj4dX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4jtOH2OtKzIvJbqRDW42n7+5zFWp5sTX0IO\nQvu+7AIis4N093hRhLIs5EYf5ILaCVQrpYtgN+e4jPJCdqPeCy4+PI0hYJvXwq9T\nvxJ/XBs+yQHZXJHoC4/bn9A2MuPPkXjl+UzSdkiqyIoqItJPG6RVWxWhFtYatYsn\nZZNKimpTnsnLruyNdmxIS/Uoo15Hoig8VOvw6cj+t2+HN2ogwN/VBQ==\n-----END RSA PRIVATE KEY-----\n",
  "namespaces": [
    {
      "memory_size": "500M",
      "xdr_enable": true,
      "xdr_endpoints": [
        "service-instance_20ebaec2-c718-4816-bfbe-111111111111"
      ],
      "storage_type": "memory",
      "name": "test"
    }
  ],
  "tls_public_key": "-----BEGIN CERTIFICATE-----\nMIIEdTCCAt2gAwIBAgIRAKf/HIJQTtHyBuJNvqWDBVIwDQYJKoZIhvcNAQELBQAw\nPDEMMAoGA1UEBhMDVVNBMRYwFAYDVQQKEw1DbG91ZCBGb3VuZHJ5MRQwEgYDVQQD\nEwthZXJvc3Bpa2VjYTAeFw0xOTA4MDcyMTIxMDJaFw0yMDA4MDYyMTIxMDJaMDkx\nDDAKBgNVBAYTA1VTQTEWMBQGA1UEChMNQ2xvdWQgRm91bmRyeTERMA8GA1UEAxMI\nY2x1c3RlcjIwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC9yQWFeOPS\nZAiWzbzaeKS5m620O3npTXhHh3w2zIKHfb8Y4SH13kNX7mPizmT6g/Hs0M6TL5Ij\nGFPowDU6PvGVHDZYt+vnY5JOCdsTPFdjy4K5Z+dMwZBUtPcTnR/kzG0E2RHhczBf\noK3xgctgYLQQVsEq/uML6JxKfTpYzw2tfSwGAbo7ssP3wMjrbvGqf2lNL4YDLfKl\nHwyC+yklBCPHZj6+c3Op6djG6hUB4cCUPXnU2BMhNKwOuWTFspndTsWqnrgyTsh6\np9oYLm9axTmtzMXUxCK+q15f0S1ZXIN7i/xOOqtOSoHKcHw5BEmlGlZr67az94Va\n/jjkmz7b4zTYn+sC9u5fQXFd7ZjGS1WCuU/lrliAqPKUZnix2CdhYx1iG/8XfXND\nYw2scC4H3Nbf6+j/cfJM+HogwUbIWrfsgP/wZkO3mG6JACZqkv8ATp3MqgZY8ety\nDFdbuWcBmudziiENY9zx+uLsBFcgY7VePLxLLDznDzYIknouioknlLcCAwEAAaN1\nMHMwDgYDVR0PAQH/BAQDAgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB\n/wQCMAAwHQYDVR0OBBYEFDDjq4yScaVqLljA+wmBaPgsrQj+MB8GA1UdIwQYMBaA\nFHqDwH+tkYt8SfZB71nauFmd+Gy4MA0GCSqGSIb3DQEBCwUAA4IBgQDSJw4sQ2N9\n0TqmBUagghILJx7+1QYywvsZOJwMmlSv46+GVGC/925AFo4n4x8qzQBqP5UoVoHu\nGIN7mVfyB2q+vBy5IjemlaXAiiTDOqI9qK+VmENDW4CJ1yC/bcO8XTTW8fPY5v+r\nHmhGLh13nZ18faRGbcCs2TbsTY+O5X9mDCrVrTvhTarGc3hmZ0ScUXgdNz8mK5bi\nbASTb2DitUu/ez0HDkBG0bPDKR04/hKE795uuyk8o7xHZFOiSDz+oznp2fogbK7C\nA6hHw/r+Sc/DjHqc356WI3pz9Nb48KH7PN5k7slLr++SNb8C7f29o5/EAxohkKMJ\nrCSHuIlxd73znC5Se5vK/vZ2/WL72jinHvxL5NEwiuvKN0QFXn2FAR92emLdB5Kb\nKr8CjtQ2yiWYqIJZbKX1DSkvhaMQpdAzvoVLu5pB0+z3f2dIySdTeKfLpkHm4aQD\nKPSx4RI6VEj72HY99gA3kolEnIv602k7zLUIzR72pC6h05y68Tz8SQg=\n-----END CERTIFICATE-----\n",
  "xdr_enable": true,
  "xdr_deployments": ["service-instance_20ebaec2-c718-4816-bfbe-111111111111"],
  "tls_enable": true
}

 cf create-service aerospike-on-demand small cluster2 -c cluster2deployconfig.json

Update cluster1 to xdr to cluster2

cluster1updateconfig.json

{
  "xdr_enable": true,
  "xdr_deployments": ["service-instance_20ebaec2-c718-4816-bfbe-222222222222"],
  "ns_xdr_endpoints": [
    {
      "xdr_enable": true,
      "xdr_endpoint_deployments": ["service-instance_20ebaec2-c718-4816-bfbe-222222222222"],
      "namespace": "test"
    }
  ]
}

 cf update-service cluster1 -c cluster1updateconfig.json