Install an HA MSR deployment¶
Note
The instruction herein is a supplement to the MSR installation procedure detailed at Installation Guide.
Kubernetes deployments¶
High availability (HA) MSR deployments require a Kubernetes environment that have:
At least two different nodes on which to run an MSR deployment
An additional node on which to replicate the RethinkDB cluster, to ensure fault tolerance
To install an HA MSR deployment using the MSR Operator:
Modify your
cr-sample-manifest.yaml
file to includes the values contained in the following YAML example:spec: podAntiAffinityPreset: hard rethinkdb: cluster: replicaCount: 3 proxy: replicaCount: 2 enzi: api: replicaCount: 2 worker: replicaCount: 2 nginx: replicaCount: 2 garant: replicaCount: 2 api: replicaCount: 2 jobrunner: deployments: default: replicaCount: 2 notarySigner: replicaCount: 2 notaryServer: replicaCount: 2 registry: replicaCount: 2
Note
You can edit the replica counts in the custom resource manifest, but be aware that
rethinkdb.cluster.replicaCount
must always be an odd number. Refer to the RethinkDB scaling chart for details.Invoke the following command to run the webhook health check and apply the changes to the custom resource:
kubectl wait --for=condition=ready pod -l \ app.kubernetes.io/name="msr-operator" && kubectl apply -f cr-sample-manifest.yaml
Verify completion of the reconciliation process for the custom resource:
kubectl get msrs.msr.mirantis.com kubectl get rethinkdbs.rethinkdb.com
To troubleshoot the reconciliation process, run the following commands:
kubectl describe msrs.msr.mirantis.com kubectl describe rethinkdbs.rethinkdb.com
Review the MSR Operator Pod logs for more detailed results:
kubectl logs <msr-operator-pod-name>
Optional. Another way to troubleshoot the reconciliation process is to monitor the cluster scaling in the RethinkDB admin console.
To install an HA MSR deployment using a Helm chart:
Create an
ha.yaml
file with the following content:global: nodeSelector: msr: enabled podAntiAffinityPreset: hard rethinkdb: cluster: replicaCount: 3 proxy: replicaCount: 2 enzi: api: replicaCount: 2 worker: replicaCount: 2 nginx: replicaCount: 2 garant: replicaCount: 2 api: replicaCount: 2 jobrunner: deployments: default: replicaCount: 2 notarySigner: replicaCount: 2 notaryServer: replicaCount: 2 registry: replicaCount: 2
Note
You can edit the replica counts in the
ha.yaml
file. However, you must make sure thatrethinkdb.cluster.replicaCount
is always an odd number. Refer to the RethinkDB scaling chart for details.Use Helm to apply the YAML file to a new installation:
helm install msr msrofficial/msr -f ha.yaml
Swarm deployments¶
You must have at least three worker nodes to run a robust and fault-tolerant high availability (HA) MSR deployment.
Note
The procedure that follows is supplementary to the MSR installation procedure. Refer to Install MSR online for the comprehensive installation instructions.
SSH into a manager node.
Obtain a list of non-manager nodes along with their node IDs:
docker node ls --format "{{ .ID }}" --filter "role=worker"
Specify in the
values.yml
file the node IDs of the workers that will run MSR.Install an HA deployment:
docker run \ --rm \ -it \ -v /var/run/docker.sock:/var/run/docker.sock \ -v <path-to-values.yml>:/config/values.yml \ registry.mirantis.com/msr/msr-installer:<msr-version> \ apply \ --https-port 443 \ --http-port 80
Important
For MSR 3.1.4 or earlier use the install command instead of the apply command.
You must install MSR onto an odd number of worker nodes, the reason for which is that RethinkDB uses a raft consensus algorithm to ensure data consistency and fault tolerance.
Review the status of the deployed services:
docker stack services msr