When the template matches with a pod, there are two available actions:
preHook
Provides a command or sequence of commands that quiesce the database application and write its data to disk in preparation for the backup.
postHook
Provides a command or sequence of commands that unquiesce the database application and restore normal operation.
MySQL application templates come with default values for these actions:
DefaultMySQLQuiesce and
DefaultMySQLUnquiesce.
MongoDB application templates come with default values for these actions:
DefaultMongoDBQuiesce and
DefaultMongoDBUnquiesce.
PostgreSQL application templates come with default values for these actions:
DefaultPostgresqlQuiesce and
DefaultPostgresqlUnquiesce.
For PostgreSQL, the prehook action does not quiesce the database. Rather, the action places the database into hot backup mode. Similarly, the posthook action removes the database from hot backup mode.
Cassandra application templates come with a default value for these actions:
DefaultCassandraFlush.
For Cassandra, the prehook action flushes the database to disk. The database provides neither explicit quiescing during the prehook, nor a corresponding unquiesce command for a posthook action.
When the PVCs covered by the template belong to PowerFlex and use the same volume group,
PowerProtect Data Manager concurrently runs pre-hooks for these PVCs, uses the
volumegroup snapshot to snapshot all of these PVCs together, and then concurrently runs post-hooks.
These default values are reserved keywords in the YAML file. Creating an application template from the YAML file replaces these keywords with relatively safe and standard sequences that quiesce and unquiesce supported database applications, where applicable.
The other parameters that are associated with these default values are:
Timeout defaults to 30 s.
Container defaults to the first container in the pod.
OnError defaults to
Fail. The possible values are
Fail and
Continue.
You can replace these default hooks with sequences of commands that are specific to the database application environment. All values other than the defaults are treated as commands to run.
You can also replace the default parameters with new values, such as the name of a different container or a longer timeout.
Example
An application template applies to a MySQL database that resides in a pod. The following template fragment provides custom commands for quiescing and unquiescing the database.
Pod:
preHook:
command: "[\"/bin/sh\", \"-c\", \"mysql -uroot -p$MYSQL_ROOT_PASSWORD -e \\\"FLUSH TABLES WITH READ LOCK; FLUSH LOGS;SELECT SLEEP(100);\\\" >/tmp/quiesce.log 2>&1 & for i in 1..10; do sleep 1; mysql -root -p$MYSQL_ROOT_PASSWORD -e \\\"SHOW PROCESSLIST\\\" | grep \\\"SLEEP(100)\\\" > /tmp/sleep.pid ; if [ $? -eq 0 ]; then exit 0; fi; done; exit 1\"]"
postHook:
command: "[\"/bin/sh\", \"-c\", \"SLEEPPID=`cut -f1 /tmp/sleep.pid` ; mysql -uroot -p$MYSQL_ROOT_PASSWORD -e \\\"KILL $SLEEPPID\\\" ; rm /tmp/sleep.pid\"]"
Data is not available for the Topic
Please provide ratings (1-5 stars).
Please provide ratings (1-5 stars).
Please provide ratings (1-5 stars).
Please select whether the article was helpful or not.
Comments cannot contain these special characters: <>()\