Enabling CP Subsystem

CP Subsystem is a component of a Hazelcast cluster that builds a strongly consistent layer for a set of distributed data structures. As well as network partitions, the CP Subsystem withstands server and client failures.

See CP Subsystem for more detailed information about the configuration and behavior of CP Subsystem component of Hazelcast.

Configuring CP Subsystem

To enable CP Subsystem you must configure the cpSubsystem section in the Hazelcast custom resource. All the cluster members will be configured as CP Members.

Example of CP Subsystem
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
  name: hazelcast
spec:
  clusterSize: 3
  repository: 'docker.io/hazelcast/hazelcast-enterprise'
  licenseKeySecretName: hazelcast-license-key
  cpSubsystem:
    sessionTTLSeconds: 30
    pvc:
      accessModes: ["ReadWriteOnce"]
      requestStorage: 8Gi

When CP subsystem is enabled, it always enables CP Subsystem Persistence. This means that a PVC must be configured before enabling CP Subsystem. When the pvc section is configured in cpSubsystem, a PVC is created and mounted for the CP Subsystem. If you want to use the same PVC for both Persistence and CP Subsytem, configure the Persistence but do not configure pvc for the CP Subsystem.

Example of CP Subsystem with Persistence
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
  name: hazelcast
spec:
  clusterSize: 3
  repository: 'docker.io/hazelcast/hazelcast-enterprise'
  licenseKeySecretName: hazelcast-license-key
  persistence:
    pvc:
      accessModes: ["ReadWriteOnce"]
      requestStorage: 8Gi
  cpSubsystem: {}
The cluster cannot be scaled up or down if the CP subsystem is enabled. However, you can pause the cluster by scaling it to 0 when starting the cluster. When scaling up again, you must only scale to the original cluster size or the cluster will fail to start. For example, after scaling a cluster with an original size of 3 to a size of 0, you can only scale it up to 3; if you scale up to a different size, the cluster will not start.