Обсуждение: cannt setup postgresql database for my opennms
I am using linux Red Hat 8 OS, it may be 2 old now, ^_^ I have just installed my opennms by rpm package, and now i am running the installer to setup the PostgreSQL database: # $OPENNMS_HOME/bin/install -disU but some exception happens: ============================================================================== OpenNMS Installer Version $Id: Installer.java 3056 2006-03-26 19:39:16Z djgregor $ ============================================================================== Configures PostgreSQL tables, users, and other miscellaneous settings. Exception in thread "main" org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:204) at org.postgresql.Driver.connect(Driver.java:139) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.opennms.install.Installer.databaseConnect(Installer.java:613) at org.opennms.install.Installer.install(Installer.java:195) at org.opennms.install.Installer.main(Installer.java:2450) i have just now checked my postgre with command "netstat -anp | grep "post"" and they are right: udp 0 0 127.0.0.1:32968 127.0.0.1:32968 ESTABLISHED 5850/postmaster unix 2 [ ACC ] STREAM LISTENING 123166 5850/postmaster /tmp/.s.PGSQL.5432 why dont my opennms setup datebase successfully on my postgresql?
"=?utf-8?B?5p6X6bub546J?=" <blackjadelin@gmail.com> writes: > Exception in thread "main" org.postgresql.util.PSQLException: > Connection refused. Check that the hostname and port are correct and > that the postmaster is accepting TCP/IP connections. > i have just now checked my postgre with command "netstat -anp | grep > "post"" and they are right: > udp 0 0 127.0.0.1:32968 127.0.0.1:32968 > ESTABLISHED 5850/postmaster > unix 2 [ ACC ] STREAM LISTENING 123166 > 5850/postmaster /tmp/.s.PGSQL.5432 > why dont my opennms setup datebase successfully on my postgresql? I believe Java requires a TCP connection to postgres; you appear to not have enabled TCP connections. You'll need to adjust the postmaster's listen_addresses or tcpip_socket setting (depending on what PG version this is) and restart it. regards, tom lane
I have configured my postgresql fonfigure files, postgresql.conf: ...... tcpip_socket = true ssl = true ...... pg_hba.conf: ...... local all trust host all trust ...... and i restart my computer, then i try again to let opennms connect to postgresql, but the same error once more, so nice fuzzy Tom Lane wrote: > "=?utf-8?B?5p6X6bub546J?=" <blackjadelin@gmail.com> writes: > > Exception in thread "main" org.postgresql.util.PSQLException: > > Connection refused. Check that the hostname and port are correct and > > that the postmaster is accepting TCP/IP connections. > > > i have just now checked my postgre with command "netstat -anp | grep > > "post"" and they are right: > > udp 0 0 127.0.0.1:32968 127.0.0.1:32968 > > ESTABLISHED 5850/postmaster > > unix 2 [ ACC ] STREAM LISTENING 123166 > > 5850/postmaster /tmp/.s.PGSQL.5432 > > why dont my opennms setup datebase successfully on my postgresql? > > I believe Java requires a TCP connection to postgres; you appear to not > have enabled TCP connections. You'll need to adjust the postmaster's > listen_addresses or tcpip_socket setting (depending on what PG version > this is) and restart it. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org
Hopefully your pg_hba.conf files look more like:
local all all trust
host all all 192.168.10.0/24 trust
host pgbench all 192.168.3.0/24 trust
local all all trust
host all all 192.168.10.0/24 trust
host pgbench all 192.168.3.0/24 trust
On 27 Sep 2006 21:02:47 -0700, blackjadelin < blackjadelin@gmail.com> wrote:
I have configured my postgresql fonfigure files,
postgresql.conf:
......
tcpip_socket = true
ssl = true
......
pg_hba.conf:
......
local all trust
host all trust
......
and i restart my computer, then i try again to let opennms connect to
postgresql, but the same error once more, so nice fuzzy
Tom Lane wrote:
> "林黛玉" < blackjadelin@gmail.com> writes:
> > Exception in thread "main" org.postgresql.util.PSQLException:
> > Connection refused. Check that the hostname and port are correct and
> > that the postmaster is accepting TCP/IP connections.
>
> > i have just now checked my postgre with command "netstat -anp | grep
> > "post"" and they are right:
> > udp 0 0 127.0.0.1:32968 127.0.0.1:32968
> > ESTABLISHED 5850/postmaster
> > unix 2 [ ACC ] STREAM LISTENING 123166
> > 5850/postmaster /tmp/.s.PGSQL.5432
> > why dont my opennms setup datebase successfully on my postgresql?
>
> I believe Java requires a TCP connection to postgres; you appear to not
> have enabled TCP connections. You'll need to adjust the postmaster's
> listen_addresses or tcpip_socket setting (depending on what PG version
> this is) and restart it.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend