Re: remote connection error:could not connect to server: Connection refused

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: remote connection error:could not connect to server: Connection refused
Дата
Msg-id 7096.1448120877@sss.pgh.pa.us
обсуждение исходный текст
Ответ на remote connection error:could not connect to server: Connection refused  (Alex Luya <alexander.luya@gmail.com>)
Список pgsql-general
Alex Luya <alexander.luya@gmail.com> writes:
> My postgresql 9.4 is installed in centos 6.7,and I have followed this:
> http://www.cyberciti.biz/faq/postgresql-remote-access-or-connection/

> 1,cd /usr/pgsql-9.4/share/
> 2,cp  postgresql.conf.sample postgresql.conf
> 3,sudo vi postgresql.conf and add two lines,and save it:
> *listen_addresses = "*"tcpip_socket = true*

Since your netstat results show that the postmaster is still listening
only on "localhost" (the default), the most obvious theory is that you
failed to edit the configuration file that's actually being used.
Assuming you can connect at all, "show config_file;" would be a reliable
way of identifying which file that is.  (Almost certainly, it won't be
in /usr/pgsql-9.4/share.)

Also, I do not know what reference you are looking at that suggests
setting "tcpip_socket", but no such configuration parameter has existed
in Postgres in a very long time.  If you had edited the active config
file like that, Postgres would have refused to start.  Setting
listen_addresses = "*" should be sufficient.

BTW, I do *not* recommend overwriting the config file generated by initdb
with some sample file like that.  You'll lose the configuration values
selected by initdb, which typically isn't a good idea.

            regards, tom lane


В списке pgsql-general по дате отправления:

Предыдущее
От: Alex Luya
Дата:
Сообщение: remote connection error:could not connect to server: Connection refused
Следующее
От: Alexander Shereshevsky
Дата:
Сообщение: Re: [ADMIN] How to drop stats on table