[Spacewalk-list] Migrated postgresql database to separate box, but rhn-search doesn't know about it

Ian Forde ianforde at gmail.com
Wed Jul 18 01:00:48 UTC 2012


As the subject alludes, I recently migrated the postgresql database
from the Spacewalk server to a separate box.  Checking the list
archives, I was under the impression that all I had to do was:

Stop Spacewalk
Dump the database
Restore the database onto the new box
Stop the old database
Change /etc/rhn/rhn.conf to have 'db_host = newhost'
Start Spacewalk

And while that seems to work for the majority of Spacewalk
functionality, rhn-search, used in Channels/Package Search doesn't
like it.  I keep getting "Could not execute query 'packagename'"
errors in a red bar at the top of the page.

Looking further, I see that even doing a 'service rhn-search
cleanindex' bombs out with the following at the bottom:


	at java.sql.DriverManager.getConnection(DriverManager.java:620)
	at java.sql.DriverManager.getConnection(DriverManager.java:200)
	at com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java:580)
	at com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java:222)
	at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)
	at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)
	at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:78)
	... 6 more
Caused by: java.net.ConnectException: Connection refused
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
	at java.net.Socket.connect(Socket.java:546)
	at java.net.Socket.connect(Socket.java:495)
	at java.net.Socket.<init>(Socket.java:392)
	at java.net.Socket.<init>(Socket.java:206)
	at org.postgresql.core.PGStream.<init>(PGStream.java:62)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
	... 21 more
Starting rhn-search...

Following this, I ran it again under 'strace -f', which was showing
failed attempts to query localhost on port 5432, which is the
postgresql port.  At first, it they were ipv6 addresses, so I disabled
ipv6 in /etc/sysctl.conf, rebooted the box, and tried again.  Same
problem, but this time with:


[pid  3981] connect(30, {sa_family=AF_INET, sin_port=htons(5432),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection
refused)

That's from the strace output.

I've already checked for a comparable parameter in
/usr/share/rhn/config-defaults/*.conf, but couldn't find anything.
Can someone tell me what, if anything, I'm missing here?

Version info: Spacewalk 1.7 on CentOS 6.3.  Database for this is
postgresql 8.4 stock from CentOS 6.3.  It's also happening on another
Spacewalk 1.7 instance on CentOS 5.8 (db server is postgresql 8.4 on
CentOS 6.3) that I maintain, though I've done my debugging on the 6.3
set of systems.

  -Ian




More information about the Spacewalk-list mailing list