Add and remove hosts
This section describes how to add and remove hosts from clusters.
Add and remove hosts
The MarkLogic Helm Chart creates one MarkLogic "host" per Kubernetes pod in a StatefulSet. To add a new MarkLogic host to an existing cluster, simply increase the number of pods in your StatefulSet.
For example, to change the host count of an existing MarkLogic cluster from 2 to 3, follow these steps:
Enter this Helm command:
helm upgrade release-name marklogic/marklogic --version <version> --namespace <release-namespace> -set replicaCount=3
Once this deployment is complete, the new MarkLogic host joins the existing cluster.
To track deployment status, use the
kubectl get pods
command.
Note
This procedure does not automatically create forests on the new host. If the host will be managing forests for a database, create the forests using MarkLogic's Admin UI or APIs once the pod is up and running.
Remove hosts
When scaling down a StatefulSet, Kubernetes attempts to stop one or more pods in the set to achieve the desired number of pods. However, the storage attached to the pod remains until the persistent volume claims are deleted.
Shutting down a pod from Kubernetes does not modify the MarkLogic cluster configuration; it merely stops the pod. Stopping the pod causes the MarkLogic host to go offline. If there are forests assigned to the stopped hosts, the associated forests will go offline.
Scale down the MarkLogic hosts
The procedure to scale down the number of MarkLogic hosts in a cluster varies depending on whether forests are assigned to the hosts and whether the hosts will be permanently removed from the MarkLogic cluster.
For example, after migrating forest data from the third MarkLogic host, change the host count on an existing MarkLogic cluster from 3 to 2 by running the following Helm command:
helm upgrade release-name marklogic/marklogic --version <version> --namespace <release-namespace> --set replicaCount=2
Before Kubernetes stops the pod, it makes a call to the MarkLogic host to shut down with the fastFailOver
flag set to true
. This tells the remaining hosts in the cluster that this host is shutting down. It also triggers failover for any replica forests available on this host. There is a two-minute grace period to allow MarkLogic to shut down cleanly before Kubernetes kills the pod.
Track shutdown progress
To track the host shutdown progress, run this command:
kubectl logs pod/terminated-host-pod-name -n <release-namespace>
Permanently remove the host
If the host should be permanently removed from the MarkLogic cluster, once the pod is terminated, follow the procedure in "Recovery - Step 3: Remove dead host configuration" in the MarkLogic Knowledgebase article Replacing a failed MarkLogic node in a cluster: a step by step walkthrough.
Warning
Before attempting to scale the hosts in the StatefulSet back up, persistent volume claims and persistent volumes must be manually deleted using the Kubernetes API.
To delete the persistent volumes and persistent volume claims of the terminated host, follow these steps:
Get the persistent volume claims:
kubectl get pvc datadir-<terminated-host-pod-name> -n <release-namespace>
Delete the persistent volume:
kubectl delete pv <volume name from get pvc command>
Delete the persistent volume claims:
kubectl delete pvc datadir-<terminated-host-pod-name> -n <release-namespace>
Enable SSL over XDQP
To enable SSL over XDQP, set enableXdqpSsl
to true
either in the values.yaml
file or by using the --set
flag. All communications to and from hosts in the cluster will be secured. With this setting enabled, default SSL certificates will be used for XDQP encryption. By default, SSL over XDQP is activated in the Helm Chart.
Note
To enable other XDQP/SSL settings, like xdqp ssl allow sslv3
, xdqp ssl allow tls
, and xdqp ssl ciphers
, use the MarkLogic REST Management API.