Skip to content

Latest commit

 

History

History
34 lines (30 loc) · 4.36 KB

es-setup.md

File metadata and controls

34 lines (30 loc) · 4.36 KB

Install Elasticsearch & Schedule a Cluster

Step 1: Elasticsearch can be installed via the Universe. However, we will NOT be installing it via Universe as we need to make a small modification to Elasticsearch that is unfortunately not exposed by the Elasticsearch package parameters.

Step 2: The small modification that is needed is to enable Cross-Origin Resource Sharing (CORS) so that the JavaScript web map app (that we will use in later steps) can establish a line of communication with Elasticsearch. A Docker image amollenkopf/elasticsearch has been created and provided for you to work with that has the appropriate configuration in place. If you prefer to create your own Docker image instead of using the provided one, see the How to create your own Elasticsearch docker image with CORS enabled instructions.

Step 3: To establish an Elasticsearch cluster with the CORS setting in place we will make use of the amollenkopf/elasticsearch:2.3.2 Docker image and schedule the cluster to run via Marathon. Prior to doing this lets review the contents of the file we will submit to Marathon elasticsearch-marathon.json.

Properties worth a more detailed review include:

  • "id": the name of the Elasticsearch workers that will be shown in the DC/OS Service listing.
  • "args": "--elasticsearchNodes": the # of Elasticsearch data nodes you would like your cluster to be provisioned with.
  • "args": "--elasticsearchClusterName": the name that you would like to give your Elasticsearch cluster.
  • "args": "--elasticsearchCpu": the amount of cores that you would like to allocate per Elasticsearch data node.
  • "args": "--elasticsearchDisk": the amount of disk that you would like to allocate per Elasticsearch data node.
  • "args": "--elasticsearchRam": the amount of memory that you would like to allocate per Elasticsearch data node.
  • "args": "--elasticsearchDockerImage": the Elasticsearch image to utilize when provisioning data nodes.
  • "args": "--executorName": the name that you would like to give to the Elasticsearch executor, shown in the Application listing of Marathon.

Step 4: To schedule an Elasticsearch cluster with Marathon on DC/OS submit the following command via the DC/OS CLI: 'dcos marathon app add elasticsearch-marathon.json'.



Step 5: The progress of the Elasticsearch executor scheduling can be seen by navigating to the Marathon UI.



Step 6: Once the Elasticsearch executor has been scheduled it will show as running in the Marathon UI.



Step 7: Navigating to the DC/OS Service tab we can now see a service for 'elasticsearch'. Hovering over the text of the 'elasticsearch' service presents a popout icon that we can click on to view more details of Elasticsearch cluster in a new browser tab.



Step 8: Here we see a dashboard of our 5-node Elasticsearch cluster.



Step 9: Clicking on the Tasks tab of the Elasticsearch dashboard we can see the State as well as the hostname and IP addresses of each data node.



Step 10: If you wanted to scale-out (add additional nodes) the # of data nodes on the Elasticsearch cluster it is possible by typing your new desired horizontal scaling value and clicking the 'Scale' button.



Congratulations: You now have an Elasticsearch cluster installed with five data nodes ready to store data on the DC/OS cluster. Next, we will walk through how to Schedule a Load Balancer (marathon-lb) to run on Public Agents.