使用engine-backup程序备份数据库及配置文件
-
engine-backup是将备份和恢复统一到一起的程序,根据用户的参数而做区别。
-
先来查看engine-backup的使用帮助:
engine-backup --help engine-backup: backup and restore ovirt-engine environment USAGE: /usr/bin/engine-backup [--mode=MODE] [--scope=SCOPE] [--file=FILE] [--log=FILE] MODE is one of the following: backup backup system into FILE restore restore system from FILE SCOPE is one of the following: all complete backup/restore (default) db database only --file=FILE file to use during backup or restore --log=FILE log file to use --change-db-credentials activate the following options, to restore the database to a different location etc. If used, existing credentials are ignored. --db-host=host set database host --db-port=port set database port --db-user=user set database user --db-passfile=file set database password - read from file --db-password=pass set database password --db-password set database password - interactively --db-name=name set database name --db-secured set a secured connection --db-secured-validation validate host
-
以下是使用全部参数的例子:
engine-backup --mode=backup --scope=all --file=backup --log=backup.log --change-db-credentials --db-host=localhost --db-port=5432 --db-user=engine --db-password=ffdC9lhX --db-name=engine Backing up... Done.
这是官网的使用说明,但是在安装report的engine程序是无法通过上面的过程恢复的,因为engine-backup程序中关于report的参数选项并没有开放出来,下面就是report数据库备份恢复的参数:
--dwh-db-host=host set dwh database host
--dwh-db-port=port set dwh database port
--dwh-db-user=user set dwh database user
--dwh-db-passfile=file set dwh database password - read from file
--dwh-db-password=pass set dwh database password
--dwh-db-password set dwh database password - interactively
--dwh-db-name=name set dwh database name
--dwh-db-secured set a secured connection for dwh
--dwh-db-secured-validation validate host for dwh
--change-reports-db-credentials activate the following options, to restore
the Reports database to a different location
etc. If used, existing credentials are ignored.
--reports-db-host=host set reports database host
--reports-db-port=port set reports database port
--reports-db-user=user set reports database user
--reports-db-passfile=file set reports database password - read from file
--reports-db-password=pass set reports database password
--reports-db-password set reports database password - interactively
--reports-db-name=name set reports database name
--reports-db-secured set a secured connection for reports
--reports-db-secured-validation validate host for reports
以下是使用全部参数的例子:
engine-backup --mode=restore --file=backup.data --log=backup.log --change-db-credentials --db-host=localhost --db-name=engine --db-user=engine --db-password=engine --change-dwh-db-credentials --dwh-db-host=localhost --dwh-db-name=ovirt_engine_history --dwh-db-user=engine --dwh-db-password=engine --change-reports-db-credentials --reports-db-host=localhost --reports-db-user=engine --reports-db-name=ovirt_engine_reports --reports-db-password=engine