Skip to main content
Version: 6.0-SNAPSHOT

Hazelcast Configuration

To configure a Hazelcast cluster or client, you can choose either static or dynamic configuration. Explore the options and decide which one is best for your application.

tip

Before configuring Hazelcast, we recommend trying the defaults, which are set in the hazelcast-default.xml and hazelcast-client-default.xml file of your Hazelcast package.

Static Configuration​

Static configuration allows you to configure Hazelcast members and client before runtime by providing either configuration files or using the API.

To use static configuration, you have the following options:

The following topics are also relevant to static configuration:

note

Hazelcast performs schema validation through the hazelcast-config-6.0-SNAPSHOT.xsd file, which comes with Hazelcast libraries. If an error occurs in declarative or programmatic configuration, Hazelcast throws a meaningful exception.

Static configuration cannot be changed at runtime. To update static configuration, you must restart the cluster. However, you can add dynamic configuration for some features.

Configuration Precedence​

Hazelcast members and clients looks for static configuration options in the following order:

OrderMemberClient
1Config object provided by programmatic configurationConfig object provided by programmatic configuration
2hazelcast.config system propertyhazelcast.client.config system property
3hazelcast.xml declarative configuration file in the working directoryhazelcast-client.xml declarative configuration file in the working directory
4hazelcast.xml declarative configuration file on the classpathhazelcast-client.xml declarative configuration file on the classpath (Java)
5hazelcast.yaml declarative configuration file in the working directoryhazelcast-client.yaml declarative configuration file in the working directory
6hazelcast.yaml declarative configuration file on the classpathhazelcast-client.yaml declarative configuration file on the classpath (Java)

If Hazelcast does not find any of these configuration options, it loads the default configuration file (hazelcast-default.xml), which comes with your Hazelcast package.

Dynamic Configuration​

Dynamic configuration allows you to add configuration blocks for some features at runtime.

For more information, see Dynamic Configuration for Members.