Version: 5.17
Scale a Hazelcast deployment
To scale an existing Hazelcast deployment, there are two options:
-
Modify the YAML definition you used to deploy Hazelcast cluster by updating
clusterSizefield and re-apply it again:For example, if the existing configuration has a cluster size of three:
yamlapiVersion: hazelcast.com/v1alpha1kind: Hazelcastmetadata:name: hazelcast-samplespec:clusterSize: 3You can scale your deployment to five replicas by updating the
clusterSizefield and applying:yamlapiVersion: hazelcast.com/v1alpha1kind: Hazelcastmetadata:name: hazelcast-samplespec:clusterSize: 5
For Kubernetes
shell
kubectl apply -f hazelcast-sample.yaml
For Openshift
shell
oc apply -f hazelcast-sample.yaml
-
Alternatively, you can use the
scalecommand:shellkubectl scale hazelcast <name> --replicas <replica-count>For example:
shellkubectl scale hazelcast hazelcast-sample --replicas 5
Check the cluster status
You can check that the operation has completed by checking the cluster status:
- Kubernetes
- Openshift
shell
kubectl get hazelcast
shell
oc get hazelcast
NAME STATUS MEMBERS
hazelcast-sample Running 5/5