Question & Answer
Question
Cause
- Server maintenance
- Planned power outage or unplanned battery backup enabled
- Work that requires the server hosts to be powered off
Answer
If you are not willing to restore the Cluster, do not shut it down.
Shutdown Procedures
- Log in to the Red Hati OpenShifti Cluster:
oc login -u ADMIN https://CONSOLE:PORT
- Verify nodes are in Ready status:
oc get nodes
-
Validate all Cluster Operators are all available True and degraded False:
-
oc get clusteroperators
- Check etcd for the controller nodes:
oc get pods -n openshift-etcd | grep -v etcd-quorum-guard | grep etcd
3/3
and running. - Select the first etc node from previous step:
oc rsh -n openshift-etcd etcd-cp4s-lab-control-1
- Validate that etcd is in sync and there are no issues:
etcdctl member list -w table
-
- Make an etcd backup:
a) Make note of the first node with role controller:
oc get nodes
b) Replace NODE_NAME with previous steps noted name:
oc debug node/NODE_NAME
c)
Obtain node bash prompt:
chroot /host
d) Now run the backup script to start the backup:
/usr/local/bin/cluster-backup.sh LOCATION
e) Verify the return was successful with:snapshot db and kube resources are successfully saved to LOCATION
exit
g)exit
- Make an etcd backup:
-
- Make a CP4S backup:
NOTE: Creating a backup takes at least 20 minutes.
a) Enter the project CP4S is located or specify the -n:oc get pods | grep cp4s-backup-restore
oc exec BACKUP-RESTORE-PODNAME -- /opt/bin/backup-cp4s.sh -p ENCRYPTION_PASSWORD
CP4S Backup Procedure Complete
oc cp BACKUP-RESTORE-PODNAME:/opt/data/backup ./backup
- Make a CP4S backup:
-
- Initiate the Graceful Shutdown of the Red Hati OpenShifti Cluster:
a) Execute in shell:
eval "$(ssh-agent -s)"
ssh-add /root/RHOCP/SSH-KEY/rhocp.key
nodes=$(oc get nodes -o jsonpath='{.items[*].metadata.name}')
for node in ${nodes[@]}; do echo "Shutting down $node"; ssh core@$node sudo shutdown -h; done
oc get nodes
- Initiate the Graceful Shutdown of the Red Hati OpenShifti Cluster:
Startup Procedures
NOTE: A prerequisite is that Red Hati OpenShifti Cluster was previously gracefully shut down.
-
- Start the supporting Red Hati OpenShifti resources in the following order:
a) Gateway: DHCP
b) Bastion Host
c) Service Host: DNS, haproxy
d) NFS Storage: nfsd
- Start the supporting Red Hati OpenShifti resources in the following order:
-
- Verify all resources are working correctly:
a) On services host:
systemctl status named systemctl status haproxy
exportfs systemctl status nfs-server.service
- Verify all resources are working correctly:
- Start the Control servers
- Once the command prompt is available on each control server proceed
- Start the worker|processor servers
- Once the command prompt is available on each processor server proceed
-
- Verify all servers are working correctly:
a) Login to the Red Hati OpenShifti Cluster:
oc login -u ADMIN https://CONSOLE:PORT
b) Verify nodes are in Ready status:oc get nodes
oc get clusteroperators
oc get pods -n openshift-etcd | grep -v etcd-quorum-guard | grep etcd
3/3
and running. e) Select the first etc node from previous step:oc rsh -n openshift-etcd etcd-cp4s-lab-control-1
f) Validate that etcd is in sync and there are no issues:etcdctl member list -w table
exit
h)exit
- Verify all servers are working correctly:
-
- If there are certificates pending, validate:
a) Check for new certificates:
oc get csr
oc describe csr CSR_NAME
c) If the certificate is valid, approve it:oc adm certificate approve CSR_NAME
- If there are certificates pending, validate:
- Log in to the Red Hati OpenShifti Admin UI
NOTE: You might need to clear browser cache for correct functionality. - Verify all of the Pods are started
NOTE: If a pod is misbehaving, delete that pod and give more time.
- Red Hat®, JBoss®, OpenShift®, Fedora®, Hibernate®, Ansible®, CloudForms®, RHCA®, RHCE®, RHCSA®, Ceph®, and Gluster® are trademarks or registered trademarks of Red Hat, Inc. or its subsidiaries in the United States and other countries.
Was this topic helpful?
Document Information
Modified date:
26 July 2023
UID
ibm16853549