Hazelcast Docker Compose - padogrid/padogrid GitHub Wiki

◀️ Hazelcast OpenShift 🔗 Hazelcast Desktop App ▶️


This page describes how to create a Docker environment and launch a Hazelcast cluster using docker-compose.

❗ You must first install Docker and Docker Compose. See References for download links.

Create PadoGrid Docker Cluster

# Create Hazelcast cluster with 2 members (default)
create_docker -cluster mydocker

By default, the create_docker command adds two (2) Hazelcast servers (members) in the cluster. You can change the number of servers using the -count option. For example, the following command adds four (4) servers.

# Create Hazelcast cluster with 4 members
create_docker -cluster mydocker -count 4

Configure the Cluster Environment

cd_docker mydocker

Edit the .env file as needed.

vi .env

There are three (3) Hazelcast configuration files as follows. Edit them as needed.

Configuration File Cluster Type
padogrid/etc/hazelcast.xml IMDG, Jet
padogrid/etc/hazelcast-jet.xml Jet
padogrid/etc/hazelcast-client.xml Jet

❗By default, the cluster name is hard-coded in the padogrid/etc/hazelcast.xml file as dev, even though the Docker cluster name is mydocker in our example. If you want to keep the Hazelcast cluster name same as the Docker cluster name then uncomment the padogrid.cluster-name system property in the padogrid/etc/hazelcast.xml file.

❗ For Jet Management Center, the cluster member addresses are listed in the padogrid/etc/hazelcast-client.xml file using the HOSTNAME_FOR_CLIENTS value set in the .env file. If you change the value of HOSTNAME_FOR_CLIENTS then you must also make the same change in the padogrid/etc/hazelcast-client.xml file.

vi padogrid/hazelcast.xml

Place your application jar files in the padogrid/plugins directory, which already contains PadoGrid test jar for running perf_test.

ls padogrid/plugins

Start Cluster

docker-compose up

Management Center

Management Center URLs are as follows:

URL Cluster Type
http://localhost:8080/hazelcast-mancenter IMDG
http://localhost:8081 Jet

❗ If you have not changed the Hazelcast cluster name, then keep in mind that the Hazelcast cluster name is set to dev by default as mentioned earlier. When you add a cluster config in Hazelcast Management Center 4.x, you must set the member addresses with the host IP address, and not localhost.

Run perf_test

If you have not changed the Hazelcast cluster name, you can run perf_test as is without modifications.

create_app
cd_app perf_test; cd bin_sh
./test_ingestion -run

If you have changed the Hazelcast cluster name, then add the <cluster-name> element in the etc/hazelcast-client.xml file as follows:

<hazelcast...>
...
   <cluster-name>mydocker</cluster-name>
...
</hazelcast>

Teardown

Ctrl-C from the docker-compose up command and prune the containers.

docker-compose down
docker container prune

References

  1. Install Docker, https://docs.docker.com/install/.
  2. Install Docker Compose, https://docs.docker.com/compose/install/.

◀️ Hazelcast OpenShift 🔗 Hazelcast Desktop App ▶️

⚠️ **GitHub.com Fallback** ⚠️