Creating Hazelcast Cluster in Docker Cloud

In this blog post, I am going to talk about how to create a Hazelcast cluster on Docker cloud platform. Also we will make scaling up/down operations and we will launch Hazelcast Management Center on Docker cloud platform.

Here requirements:

  • AWS account, ( we will need access-secret keys)
  • Docker cloud account

If you don’t have Docker cloud account, please create a Docker cloud account and add AWS cloud provider.

In order to create Hazelcast cluster and run management center, I have wrote very simple docker-cloud yaml file. You can find my file here: https://github.com/bilalyasar/hazelcast-docker-cloud

In the github repository you will see Deploy to Cloud button, click it.

Hazelcast Docker

After clicking that button, following page will be open:

Hazelcast Docker Code

Here I have defined 2 services. One is hz and the other service is management-center in order to ensure connection between members i have opened 5701 port. Also we will connect management center via 8080 port.

Please click Create & Deploy button, this button will create 2 services then deploy them to AWS cloud.

Then please click, services tab, you will see 2 services ( hz and management center).

hz and management center

You can click on the service name and see some details about the service. Also you can see the logs. Please click hz service and then click logs.

services/details

As you see, an Hazelcast member is started. Lets, go to management center and connect to management center.

Services -> Management Center

You will see an endpoint which is management center url. Please click that url and add mancenter to end of the URL.

mancenter

In the management center screen, you need to enter cluster url. You can find that endpoint under hz service.

memory utilization

Here, I have connected to cluster.

Lets scale the cluster now. Go to Services -> hz then scale the number of containers from 1 to 2.

get help

After clicking scale, just wait 5-10 seconds 🙂

Docker cloud automatically scale hz service.

Go to management center and look at hazelcast nodes.

Memory Utilization

Now, there are 2 hazelcast members 🙂

You can scale down in the same manner also.

Thanks for reading this blog post. You can see docker-cloud.yml file here:

https://github.com/bilalyasar/hazelcast-docker-cloud

Don’t forget to deploy cloud 🙂 it is just one click.