Ce contenu n'est pas disponible dans la langue sélectionnée.
2.5. Creating an offline backup (OpenShift)
Overview Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
When using Red Hat JBoss A-MQ on Red Hat OpenShift Container Platform 3.x, you can create an offline backup of your A-MQ container for the KahaDB message store. An offline backup is the safest way to backup your data because it avoids the risk of copying data that might be in the process of being updated.
Prerequisites Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
Before you begin, you should be familiar with the OpenShift Container Platform command line interface (CLI). See the OpenShift Container platform documentation (https://docs.openshift.com/index.html), specifically the Developer’s Guide and the CLI Reference.
Procedure Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
To create an offline backup for the KahaDB message store, follow these steps:
Procedure 2.1. Creating an offline backup
- Use the
oc scalecommand to stop the A-MQ broker pod to make sure that no writes occur during the backup process:oc scale <object_type> <object_name> --replicas=<#_of_replicas>
oc scale <object_type> <object_name> --replicas=<#_of_replicas>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the following example, deployment configuration (dc) is the object-type and broker-amq is the object-name, and the number of replicas is set to zero:oc scale dc broker-amq --replicas=0
oc scale dc broker-amq --replicas=0Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create and run a no-op container to use for the backup process. In the following example,
tempis the name of the no-op container andregistry.access.redhat.com/rhel7is the image for the container to run. The--tail -foption specifies to send logs about theruncommand to a local/dev/nullfolder and keeps the container running by preventing the replication process from closing it prematurely.oc run temp --image=registry.access.redhat.com/rhel7 --tail -f /dev/null
oc run temp --image=registry.access.redhat.com/rhel7 --tail -f /dev/nullCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Mount the A-MQ broker’s persistent volume claims (PVC) to the no-op container by using the
oc volume addcommand as shown in the following example:oc volume dc/temp --add -t pvc --name=broker-amq-claim --claim-name=broker-amq-claim --mount-path=/opt/amq/old-data
oc volume dc/temp --add -t pvc --name=broker-amq-claim --claim-name=broker-amq-claim --mount-path=/opt/amq/old-dataCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the the A-MQ broker’s data from the no-op container to a local directory (for example
/opt/amq/old-data):oc rsync temp-2-b5p6d:/opt/amq/old-data
oc rsync temp-2-b5p6d:/opt/amq/old-dataCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the no-op container:
oc delete dc temp
oc delete dc tempCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the
oc scalecommand to start the A-MQ broker pod:oc scale dc broker-amq --replicas=1
oc scale dc broker-amq --replicas=1Copy to Clipboard Copied! Toggle word wrap Toggle overflow