This is a simple example of Hazelcast usage. It explains how to run a Hazelcast cluster using a Docker container provided by Hazelcast. Furthermore, it explains how to connect to the cluster and how to use the Hazelcast client to store and retrieve data with both Python and SQL.
All information is based on the official Hazelcast documentation. If there are any issues, please refer to the official documentation.
- To run the application, you need to have Docker installed and running. If you don't have Docker installed, please follow the instructions on the official website. Please check with following command:
docker versionIf you do not see a version number, see the Docker docs for troubleshooting information.
- Pull the Hazelcast Docker image from Docker Hub.
docker pull hazelcast/hazelcast:5.3.6- Create a network for the Hazelcast Docker container.
docker network create hazelcast-network- Run the Hazelcast Docker container.
WARING: Run Docker container in PowerShell with admin rights to avoid issues!
docker run -it --network hazelcast-network --rm -e HZ_NETWORK_PUBLICADDRESS=10.0.75.1:5701 -e HZ_CLUSTERNAME=DB2 -p 5701:5701 hazelcast/hazelcast:5.3.6You should see your cluster name in the console along with the IP address of the Docker host:
The project was created with PyCharm and tested on a Windows 11 machine with Docker Desktop 4.26.0 and Python 3.11. Any other environment was not tested and may not work as expected.
This example was created by Mick Eisebraun, Timo Feucht, Lea Gastgeb and Louis Schaak for the course "Datenbanken 2: Aktuelle Datenbanken Architekturen und Technologien". The course is part of the Bachelors's program "Informatik" at the DHBW. The course is taught by Rykarda Heim.
