Get Started with Management Center Using Docker Compose
In this tutorial, you’ll start up an instance of Management Center that automatically connects to a Hazelcast cluster, using a Docker container. To get up and running as quickly as possible, an example docker-compose.yml
is provided. No other configuration or dependencies are required.
You’ll complete the following steps:
-
Create a
docker-compose.yml
to run a Hazelcast environment from a Docker container on your local machine. -
Start up Management Center and a Hazelcast cluster, using Docker Compose.
-
Launch Management Center from a browser to view cluster details.
-
Create a map using the SQL browser.
-
Monitor the map.
-
Shut down your Hazelcast environment.
Before You Begin
To complete this tutorial, you need the following:
Prerequisites | Useful resources |
---|---|
Docker Compose |
Step 1. Start Management Center
-
Check that Docker Compose is installed correctly.
If you do not see a version number, see the Docker docs for troubleshooting information.
-
Create a new directory on your local machine. In the directory, create a file named
docker-compose.yml
and copy in the following details:You can preconfigure a cluster connection in Management Center by setting the following environment variables:
-
MC_DEFAULT_CLUSTER: The cluster name that Management Center connects to.
-
MC_DEFAULT_CLUSTER_MEMBERS: A comma-separated list of the cluster member addresses or host names.
-
-
To pull the required images, and to start up a Management Center instance already connected to a Hazelcast cluster, run the following:
Wait until you see the following message in the console:
Hazelcast Management Center successfully started at http://localhost:8080
.Followed by:
MC Client connected to cluster dev.
Step 2. Launch Management Center
Now that Management Center is connected to a running cluster, you can start to explore.
-
In a web browser, go to
localhost:8080
. Details of the Hazelcast cluster that Management Center connected to during startup are displayed.×Management Center is running in dev mode. This mode is a special security provider that allows you to evaluate Management Center, without needing login credentials or authentication tokens for the REST API. For details about security providers, see Security Providers.
-
Click View Cluster to see the cluster’s dashboard.
×
Step 3. Create a Map
Management Center comes with a variety of tools for communicating with clusters. In this step, you’ll use the SQL browser to create a map in the cluster and put some data in it.
-
Click SQL Browser in the toolbar.
After each of the following SQL queries, click Execute Query.
-
Create a map called
my_distributed_map
. -
Put some data into the map.
-
Now you can query the data you have written:
SELECT * FROM my_distributed_map;
Step 4. Monitor the Map
Go to back the cluster’s dashboard and select Storage > Maps, and then select my_distributed_map from the list of maps. You can now see the statistics of your map:
Next Steps
If you have an Enterprise license or you want to learn about Enterprise features, see Enterprise Licenses.
To serve Management Center over HTTPS instead of HTTP, see Serve Management Center over HTTPS.
For the options you can provide when starting Management Center, see System Properties and Environment Variables.