恢复原来的环境

若数据库是从来未使用过的或者全新安装的,请使用如下命令初始化数据库服务:

  1. # service postgresql initdb
  2. # service postgresql start
  3. # chkconfig postgresql on
  4. #su postgres
  5. $dropdb engine;

创建数据库用户以及数据库:

  1. postgres=# create role [user name] with login encrypted password '[password]';
  2. postgres=# CREATE DATABASE [database name] OWNER [user name] template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
  3. # [password] 是/etc/ovirt-engine/engine.conf.d/10-setup-database.conf中的数据库密码.
  4. # [database name] 和 [user name] 默认情况下是engine

如果数据库是全新安装的或者之前未曾配置该步骤的的,编辑文件
/var/lib/pgsql/data/pg_hba.conf,并在紧接着以 Local
开头的那一行下面添加如下内容:

  1. host [database name] [user name] 0.0.0.0/0 md5
  2. host [database name] [user name] ::0/0 md5

恢复数据库:

  1. #service postgresql restart
  2. #cd [your backup parent directory]
  3. #engine-backup --mode=restore --file=backup --log=engine-backup.log --change-db-credentials --db-host=localhost --db-name=[database name] --db-user=[user name] --db-password

恢复配置文件:

  1. #tar -jxvf backup
  2. #cd files
  3. #mv /etc/pki/ovirt-engine/ /etc/pki/ovirt-engine.backup
  4. #cp -rvcpf pki/ovirt-engine/ /etc/pki/
  5. #mv /etc/httpd/conf.d/ conf.d.backup
  6. # cp -vrcpf httpd/conf.d/ /etc/httpd/
  7. #mv /etc/ovirt-engine ovirt-engine.backup
  8. #cp -vrcfp ovirt-engine /etc/
  9. #service ovirt-engine restart
  10. #service httpd restart