Applying a new plan: Resize and add high availabilityedit

In an earlier example, we created a simple deployment called My First Deployment that included only a small Elasticsearch cluster with a single node in a single availability zone. This Elasticsearch cluster in our deployment is very small with only 1024 MB of RAM. Any serious indexing activity will likely require more capacity, so let’s change memory_per_node to 4096. To make the cluster in our deployment highly available, let’s also change the value of zone_count to 3, which will create Elasticsearch nodes across three availability zones.

Before you beginedit

This example requires a deployment with an Elasticsearch cluster to work with that is not being used for anything important. If you don’t already have one, you can follow our My First Deployment example to create one.

To make the cluster highly available, your Elastic Cloud Enterprise installation must include more than one availability zone, which is something you control with the --availability-zone parameter when you install Elastic Cloud Enterprise on additional hosts. If you don’t have additional availability zones to work with, you can perform just a resize operation.

Stepsedit

To resize a deployment and add high availability:

  1. Obtain the existing configuration plan for My First Deployment and save the output to a file, here my-first-deployment.json:

    curl -k -X GET -u USER:PASSWORD https://COORDINATOR_HOST:12443/api/v1/clusters/elasticsearch/ELASTICSEARCH_CLUSTER_ID/plan >my-first-deployment.json
    ELASTICSEARCH_CLUSTER_ID
    The Elasticsearch cluster ID as shown in the Cloud UI or obtained via the API
  2. Edit the my-first-deployment.json file in your favorite editor and change the value of memory_per_node to 4096 and the value of zone_count to 3:

    {
      "cluster_topology": [
          {
              "node_type": {
                  "data": true,
                  "master": true,
                  "ingest": true
              },
              "instance_configuration_id": "data.default",
              "zone_count": 3,
              "size": {
                  "resource": "memory",
                  "value": 4096
              }
          }
      ],
      "elasticsearch": {
          "version": "6.5.4"
      }
    }
  3. Apply the updated cluster configuration to the deployment with a POST request:

    curl -k -X POST -u USER:PASSWORD https://COORDINATOR_HOST:12443/api/v1/clusters/elasticsearch/$ELASTICSEARCH_CLUSTER_ID/plan -H 'content-type: application/json' -d @my-first-deployment.json

After the plan gets applied successfully, the Elasticsearch cluster in your deployment provides 4096 MB of memory and is highly available, which you can verify by checking in the Cloud UI or performing another GET request on the /api/v1/clusters/elasticsearch/$ELASTICSEARCH_CLUSTER_ID/plan endpoint.