[Spacewalk-list] upgrading postgres (8.4 > 9.x) on the spacewalk server ?

Andy Ingham andy.ingham at duke.edu
Thu Jul 17 15:25:25 UTC 2014


So I attempted the postgres 8.4 > 9.3 upgrade this morning (for the local
db on my SW 2.0 server)

Everything seemed to go pretty smoothly (thanks, Paul for the tips below!)

BUT...

The spacewalk instance is unable to connect to the upgraded database.

I have confirmed that the pgsql user / password are valid and allow
connecting from the local system (via the psql CLIENT)

But yet when I try to start spacewalk, it consistently says:

Starting httpd:                                            [  OK  ]
Starting osa-dispatcher: Spacewalk 28090 2014/07/17 11:16:43 -04:00:
('Error caught:',)
Spacewalk 28090 2014/07/17 11:16:43 -04:00: ('Traceback (most recent call
last):\n  File "/usr/share/rhn/osad/jabber_lib.py", line 117, in main\n
self.setup_config(config)\n  File "/usr/share/rhn/osad/osa_dispatcher.py",
line 112, in setup_config\n    rhnSQL.initDB()\n  File
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/__init__.py",
line 102, in initDB\n    __init__DB(backend, host, port, username,
password, database)\n  File
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/__init__.py",
line 55, in __init__DB\n    __DB.connect()\n  File
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql
.py", line 174, in connect\n    return self.connect(reconnect=0)\n  File
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql
.py", line 163, in connect\n    password=str(self.password))\n  File
"/usr/lib64/python2.6/site-packages/psycopg2/__init__.py", line 164, in
connect\n    conn = _connect(dsn, connection_factory=connection_factory,
async=async)\nSQLConnectError: (None, None, \'spaceschema\', \'Attempting
Re-Connect to the database failed\')\n',)



Any particular ideas on what I'm missing?

TIA,
Andy

Andy Ingham
IT Infrastructure
Fuqua School of Business
Duke University







On 7/14/14, 5:01 PM, "Paul Robert Marino" <prmarino1 at gmail.com> wrote:

I Know of a few gotchas

essentially the database upgrade itself is easy just do a full dump and
reload.
here are the gotchas

1) be sure to follow the steps here
http://www.postgresql.org/docs/9.3/static/upgrading.html including the
file system backup first. If there is a failure in the restore it can
be a nightmare to fix if you didn't make a copy of the database files
before you upgrade.

2) If you are using custom table spaces like I am make sure you make
backup copies of those as well. also recreate them on the new database
 before the restore. I use custom table spaces because I hate putting
entire databases in /var so my journal is in the default location and
my data is on a different partition. if you intend to use custom table
spaces this is probably the best time to make that change its painful
otherwise.

3) if you are doing this on EL 6 you need to update a symlink for jdbc.
here is the default
"
~]# ls -L /usr/share/java/postgresql-jdbc.jar
lrwxrwxrwx. 1 root root 44 Nov  5  2012
/usr/share/java/postgresql-jdbc.jar ->
/usr/share/java/postgresql-8.4-703.jdbc4.jar
"
you need to make sure you have the correct PostgreSQL 9 jdbc file
installed and /usr/share/java/postgresql-jdbc.jar is pointed to the
one for 9 instead of 8.
This one is critical or you will experience a whole lot of weird
issues and possibly even database corruption especially with
Taskomatic.

3) I haven't had time to track this down yet however I did create a
bug ticket. I found that rhnsearchd is still ignoring the IP address
in the configuration and connecting to local host. I do not know if
its due to some remnant someplace left over from upgrades or if it is
a real bug in rhnsearchd itself.




On Mon, Jul 14, 2014 at 11:35 AM, Boyd, Robert
<Robert.Boyd at peoplefluent.com> wrote:
> Andy,
>
> When you do the upgrade I'd like to hear what if any details you
>discover that you have to work through that deviate from the postgres
>docs.  I'd like to make the same upgrade.  I looked at it a few months
>ago and decided to wait a while before tackling it.
>
> Thanks,
>
> Robert Boyd
> Sr. Systems Engineer
> PeopleFluent
> e. Robert.Boyd at PeopleFluent.com
>
> Visit: www.peoplefluent.com | Read: Peoplefluent Blog | Follow:
>@peoplefluent | Download: iPad App
>
> -----Original Message-----
> From: spacewalk-list-bounces at redhat.com
>[mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Andy Ingham
> Sent: Monday, July 14, 2014 10:02 AM
> To: spacewalk-list at redhat.com
> Subject: [Spacewalk-list] upgrading postgres (8.4 > 9.x) on the
>spacewalk server ?
>
> Folks --
>
> Any particular gotchas about attempting to upgrade the postgresql server
>for our spacewalk installation?  It's at version 8.4 and we'd like to get
>it into the 9.x series.
>
> I'm assuming it should just be done according to the postgres docs?
>
> TIA,
> Andy
>
>
> Andy Ingham
> IT Infrastructure
> Fuqua School of Business
> Duke University
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list





More information about the Spacewalk-list mailing list