Bug 1285598 - [Docs] [SHE] Document a procedure for migrating the engine and other databases to a separate host
[Docs] [SHE] Document a procedure for migrating the engine and other database...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: Documentation (Show other bugs)
3.5.5
Unspecified Unspecified
high Severity medium
: ovirt-3.5.7
: 3.5.7
Assigned To: Andrew Burden
Lucy Bopf
docs
:
Depends On: 1285145
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-25 21:04 EST by Andrew Dahms
Modified: 2016-02-10 13:56 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-22 19:28:49 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Docs
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andrew Dahms 2015-11-25 21:04:50 EST
A procedure must be added to the Installation Guide that outlines how to migrate the engine database, and optionally the reports and DWH databases to a machine other than the Manager in a self-hosted engine environment.
Comment 1 Andrew Burden 2015-11-26 04:19:38 EST
Workflow as tested on 3.5 standard install:
On Manager:
# service ovirt-engine stop
# su - postgres -c 'pg_dump -F c engine -f /tmp/engine.dump'
# scp /tmp/engine.dump root@new.server.com:/tmp/engine.dump (target directory needs to allow write access for postgres user)

On DB Server:
# yum install postgresql-server
# service postgresql initdb
# service postgresql start
# chkconfig postgresql on
# su postgres
$ psql
postgres=# create role engine with login encrypted password '[engine password]';
* engine password retrieved from '/etc/ovirt-engine/engine.conf.d/10-setup-database.conf' file on Manager
postgres=# create database engine owner engine template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
postgres=# \q
$ exit
* In /var/lib/pgsql/data/postgresql.conf 
listen_addresses='*'
* In /var/lib/pgsql/data/pg_hba.conf:
host    engine    engine    [Manager IP]/32  md5
host    engine    engine    ::0/0      md5
# iptables -I INPUT 5 -p tcp --dport 5432 -j ACCEPT
# service iptables save
# service postgresql restart
# su - postgres -c 'pg_restore -d engine /tmp/engine.dump'

On Manager again:
* In /etc/ovirt-engine/engine.conf.d/10-setup-database.conf:
-ENGINE_DB_HOST="localhost"
+ENGINE_DB_HOST="[DB Server IP]"
# service ovirt-engine start

Note: It took about 90 seconds for the Web admin portal to come online. 

Building hosted-engine environment overnight to test; I don't foresee the workflow being any different but for restricting engine vm migration during procedure.
Comment 3 Andrew Burden 2015-11-30 01:56:54 EST
Testing complete with success on 3.5 hosted engine; including dwhd db migration. As expected, the procedure is the same as above (with additional db considerations for dwhd) but for the need to disable the HA agent on host.
This content is being developed to be included in 3.5 publication.
Comment 7 Lucy Bopf 2015-11-30 23:39:59 EST
Updated Target Milestone. Moving back to ON_QA.
Comment 13 Andrew Burden 2015-12-02 03:55:59 EST
Hi Takahashi-san,

The engine db migration is now published and can be found here:
http://documentation-devel.engineering.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.5/html/Installation_Guide/Migrating_the_Self-Hosted_Engine_Database_to_a_Remote_Server_Database.html

I'm still working on verifying the procedure for the dwh and reports dbs. I will update this bug with the correct procedure upon verification, and this will be included in documentation.

Thank you,
Andrew
Comment 14 Andrew Burden 2015-12-03 07:35:38 EST
Hello Takahashi-san,

I've verified the reports db migration procedure. It is not yet in publishable state but the workflow is as follows:
On Manager:
# service ovirt-engine-reportsd stop
# su - postgres -c 'pg_dump -F c ovirt-engine-reports -f /tmp/ovirt-engine-reports.dump'
# scp /tmp/ovirt-engine-reports.dump root@new.server.com:/tmp/ovirt-engine-reports.dump (target directory needs to allow write access for postgres user)

On DB Server:
# yum install postgresql-server
# service postgresql initdb
# service postgresql start
# chkconfig postgresql on
# su postgres
$ psql
postgres=# create role ovirt-engine-reports with login encrypted password '[ovirt-engine-reports password]';
* ovirt-engine-reports password retrieved from '/var/lib/ovirt-engine-reports/build-conf/master.properties' file on Manager
postgres=# create database ovirt-engine-reports owner ovirt-engine-reports template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
postgres=# \q
$ exit
* In /var/lib/pgsql/data/postgresql.conf 
listen_addresses='*'
* In /var/lib/pgsql/data/pg_hba.conf:
host    ovirt-engine-reports    ovirt-engine-reports    [Manager IP]/32  md5
# iptables -I INPUT 5 -p tcp --dport 5432 -j ACCEPT
# service iptables save
# service postgresql restart
# su - postgres -c 'pg_restore -d ovirt-engine-reports /tmp/ovirt-engine-reports.dump'

On Manager again:
* In /var/lib/ovirt-engine-reports/build-conf/master.properties:
-dbHost=localhost
+dbHost=[DB Server IP]
# engine-setup

There continues to be an issue with migrating the dwh db. We are collaborating with engineering to arrive at the solution.

Note You need to log in before you can comment on or make changes to this bug.