Cluster States
Overview
An Ignite cluster can be in one of the three states: ACTIVE
, ACTIVE_READ_ONLY
, and INACTIVE
.
When you start a pure in-memory cluster (no persistent data regions) for the first time, the cluster is in the ACTIVE
state.
When you start a cluster with persistent data regions for the first time, the cluster is INACTIVE
.
-
INACTIVE
: All operations are prohibited.When you change the cluster state from active to
INACTIVE
(deactivation), the cluster deallocates all memory resources.WarningDeactivation deallocates all memory resources, including your application data, on all cluster nodes and disables public cluster API. If you have in-memory caches that are not backed up by a persistent storage (neither native persistent storage nor external storage), you will lose the data and will have to repopulate these caches. The non-persistent system caches are cleared too.
-
ACTIVE
: This is the normal mode of the cluster. You can execute any operation. -
ACTIVE_READ_ONLY
: The read-only mode. Only read operations are allowed.Any attempt to create a cache or modify the data in an existing cache results in an
IgniteClusterReadOnlyException
exception. DDL or DML statements that modify the data are prohibited as well.
Changing Cluster State
You can change the cluster state in multiple ways:
-
control.sh --set-state ACTIVE_READ_ONLY
-
http://localhost:8080/ignite?cmd=setstate&state=ACTIVE_READ_ONLY
-
Programmatically:
Ignite ignite = Ignition.start(); ignite.cluster().state(ClusterState.ACTIVE_READ_ONLY);
-
JMX Bean:
- Mbean’s Object Name:
group="Kernal",name=IgniteKernal
Operation Description clusterState()
Get the current cluster state.
clusterState(String, boolean)
Set the cluster state.
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.