Using master/latest code on existing PostgreSQL 9.2 appliances


#1

We recently merged some pull requests to make PostgreSQL 9.4 the default database for new appliance builds and the code on Master is now expecting it.

If you want to run the latest master code on an old pg92 appliance, you are probably seeing this:

[root@localhost vmdb]# service evmserverd start

[root@localhost vmdb]# systemctl status evmserverd.service
evmserverd.service - EVM server daemon
   Loaded: loaded (/usr/lib/systemd/system/evmserverd.service; enabled)
   Active: failed (Result: exit-code) since Thu 2015-08-27 09:48:52 EDT; 10s ago
  Process: 32723 ExecStop=/bin/sh -c /bin/evmserver.sh stop (code=killed, signal=TERM)
  Process: 2599 ExecStart=/bin/sh -c /bin/evmserver.sh start (code=exited, status=1/FAILURE)
 Main PID: 14844 (code=exited, status=0/SUCCESS)

Aug 27 09:48:51 localhost.localdomain sh[2599]: /var/www/miq/vmdb/lib/tasks/evm_dba.rake:105:in `block (3 levels) in <top (required)>'
Aug 27 09:48:51 localhost.localdomain sh[2599]: /var/www/miq/vmdb/lib/tasks/evm_dba.rake:85:in `block (3 levels) in <top (required)>'
Aug 27 09:48:51 localhost.localdomain sh[2599]: /var/www/miq/vmdb/script/rake:15:in `<top (required)>'
Aug 27 09:48:51 localhost.localdomain sh[2599]: /var/www/miq/vmdb/script/rails:6:in `require'
Aug 27 09:48:51 localhost.localdomain sh[2599]: /var/www/miq/vmdb/script/rails:6:in `<main>'
Aug 27 09:48:51 localhost.localdomain sh[2599]: Tasks: TOP => evm:db:silent_start
Aug 27 09:48:51 localhost.localdomain sh[2599]: (See full trace by running task with --trace)
Aug 27 09:48:52 localhost.localdomain systemd[1]: evmserverd.service: control process exited, code=exited status=1
Aug 27 09:48:52 localhost.localdomain systemd[1]: Failed to start EVM server daemon.
Aug 27 09:48:52 localhost.localdomain systemd[1]: Unit evmserverd.service entered failed state.

Until we have a PG94 appliance uploaded and you upgrade to it, you can use the following workaround to temporarily keep using PG92 with master code.

  1. service evmserverd stop
  2. vmdb # cd to vmdb
  3. git stash # stash the v2_key local changes
  4. git pull # get latest manageiq code
  5. git stash pop # re-apply v2_key
  6. cd /var/www/manageiq-appliance/
  7. git stash
  8. git pull # get latest manageiq-appliance code
  9. git stash pop
    10 Modify the environment variables referencing pg94 to use pg92, see below:

vi LINK/etc/default/evm_postgres

Change postgresql94 paths back to postgresl92:

diff --git a/LINK/etc/default/evm_postgres b/LINK/etc/default/evm_postgres
index 816bdf9..b419db8 100644
--- a/LINK/etc/default/evm_postgres
+++ b/LINK/etc/default/evm_postgres
@@ -2,10 +2,10 @@
 # Description: Sets the PostgreSQL environment for scripts and console users
 #

-export APPLIANCE_PG_CTL=/opt/rh/rh-postgresql94/root/usr/bin/pg_ctl
-export APPLIANCE_PG_DATA=/var/opt/rh/rh-postgresql94/lib/pgsql/data
-export APPLIANCE_PG_SERVICE=rh-postgresql94-postgresql
-export APPLIANCE_PG_SCL_NAME=rh-postgresql94
+export APPLIANCE_PG_CTL=/opt/rh/postgresql92/root/usr/bin/pg_ctl
+export APPLIANCE_PG_DATA=/opt/rh/postgresql92/root/var/lib/pgsql/data
+export APPLIANCE_PG_SERVICE=postgresql92-postgresql
+export APPLIANCE_PG_SCL_NAME=postgresql92
 export APPLIANCE_PG_PACKAGE_NAME=${APPLIANCE_PG_SCL_NAME}-postgresql-server
  1. Then, apply this file as a symlink:
    ln -s /var/www/manageiq-appliance/LINK/etc/default/evm_postgres /etc/default

/etc/default/evm_postgres should now exist and contain the changes to use postgresql92.

  1. reboot