Обсуждение: pgadmin4: not possible to create server

Поиск
Список
Период
Сортировка

pgadmin4: not possible to create server

От
robert rottermann
Дата:
Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
"PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4

I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


can anybody give me a hint, what to do?

thanks

robert


in /etc/postgresql/10/main/postgresql.conf

i have:

#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

listen_addresses = '*'          # what IP address(es) to listen on;
                                         # comma-separated list of 
addresses;


and this is my /etc/postgresql/10/main/pg_hba.conf

# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all             postgres peer

# TYPE  DATABASE        USER            ADDRESS METHOD

# "local" is for Unix domain socket connections only
local   all             all trust
# IPv4 local connections:
host    all             all             127.0.0.1/32 trust
# IPv6 local connections:
host    all             all             ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all peer
host    replication     all             127.0.0.1/32 md5
host    replication     all             ::1/128 md5





Re: pgadmin4: not possible to create server

От
Adrian Klaver
Дата:
On 02/06/2018 09:24 AM, robert rottermann wrote:
> Hi there,
> 
> I have installed pgadmin4 locally using its docker image.
> 
> this i did running the following command:
> 
> docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
> "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4
> 
> I then could access it and log into it.
> 
> However all my attempts end in:
> 
> Unable to connect to server:
> 
> could not connect to server: Connection refused
> Is the server running on host "localhost" (::1) and accepting
> TCP/IP connections on port 5432?
> could not connect to server: Connection refused
> Is the server running on host "localhost" (127.0.0.1) and accepting
> TCP/IP connections on port 5432?

So where is the Postgres server located?

> 
> 
> can anybody give me a hint, what to do?
> 
> thanks
> 
> robert
> 
> 
> in /etc/postgresql/10/main/postgresql.conf
> 
> i have:
> 
> #------------------------------------------------------------------------------ 
> 
> # CONNECTIONS AND AUTHENTICATION
> #------------------------------------------------------------------------------ 
> 
> 
> # - Connection Settings -
> 
> listen_addresses = '*'          # what IP address(es) to listen on;
>                                          # comma-separated list of 
> addresses;
> 
> 
> and this is my /etc/postgresql/10/main/pg_hba.conf
> 
> # DO NOT DISABLE!
> # If you change this first entry you will need to make sure that the
> # database superuser can access the database using some other method.
> # Noninteractive access to all databases is required during automatic
> # maintenance (custom daily cronjobs, replication, and similar tasks).
> #
> # Database administrative login by Unix domain socket
> local   all             postgres peer
> 
> # TYPE  DATABASE        USER            ADDRESS METHOD
> 
> # "local" is for Unix domain socket connections only
> local   all             all trust
> # IPv4 local connections:
> host    all             all             127.0.0.1/32 trust
> # IPv6 local connections:
> host    all             all             ::1/128 trust
> # Allow replication connections from localhost, by a user with the
> # replication privilege.
> local   replication     all peer
> host    replication     all             127.0.0.1/32 md5
> host    replication     all             ::1/128 md5
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com


Re: pgadmin4: not possible to create server

От
Murtuza Zabuawala
Дата:
Add following in your pg_hba.conf,

host    all             all             0.0.0.0/0 md5

restart your Postgres database server and try to connect again from pgAdmin4.

On Tue, Feb 6, 2018 at 10:54 PM, robert rottermann <robert@redcor.ch> wrote:
Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4

I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


can anybody give me a hint, what to do?

thanks

robert


in /etc/postgresql/10/main/postgresql.conf

i have:

#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

listen_addresses = '*'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;


and this is my /etc/postgresql/10/main/pg_hba.conf

# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all             postgres peer

# TYPE  DATABASE        USER            ADDRESS METHOD

# "local" is for Unix domain socket connections only
local   all             all trust
# IPv4 local connections:
host    all             all             127.0.0.1/32 trust
# IPv6 local connections:
host    all             all             ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all peer
host    replication     all             127.0.0.1/32 md5
host    replication     all             ::1/128 md5





Re: pgadmin4: not possible to create server

От
robert
Дата:

thanks
unfortunately id did not help

On 06.02.2018 18:29, Murtuza Zabuawala wrote:
Add following in your pg_hba.conf,

host    all             all             0.0.0.0/0 md5

restart your Postgres database server and try to connect again from pgAdmin4.
from pgadmin3 I can connect

any more ideas?
robert
On Tue, Feb 6, 2018 at 10:54 PM, robert rottermann <robert@redcor.ch> wrote:
Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4

I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


can anybody give me a hint, what to do?

thanks

robert


in /etc/postgresql/10/main/postgresql.conf

i have:

#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

listen_addresses = '*'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;


and this is my /etc/postgresql/10/main/pg_hba.conf

# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all             postgres peer

# TYPE  DATABASE        USER            ADDRESS METHOD

# "local" is for Unix domain socket connections only
local   all             all trust
# IPv4 local connections:
host    all             all             127.0.0.1/32 trust
# IPv6 local connections:
host    all             all             ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all peer
host    replication     all             127.0.0.1/32 md5
host    replication     all             ::1/128 md5






--
Robert Rottermann CEO

031 333 10 20
robert@redo2oo.ch
Sickingerstrasse 3, 3014 Bern

https://Redo2oo.ch
Ihr Partner wenn es um ERP Lösungen geht.

Re: pgadmin4: not possible to create server

От
robert
Дата:



On 06.02.2018 18:28, Adrian Klaver wrote:
On 02/06/2018 09:24 AM, robert rottermann wrote:
Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4

I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?

So where is the Postgres server located?
on my local desktop
robert

Re: pgadmin4: not possible to create server

От
robert
Дата:

thanks
unfortunately id did not help

On 06.02.2018 18:29, Murtuza Zabuawala wrote:
Add following in your pg_hba.conf,

host    all             all             0.0.0.0/0 md5

restart your Postgres database server and try to connect again from pgAdmin4.
from pgadmin3 I can connect

any more ideas?
robert
On Tue, Feb 6, 2018 at 10:54 PM, robert rottermann <robert@redcor.ch> wrote:
Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4

I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


can anybody give me a hint, what to do?

thanks

robert


in /etc/postgresql/10/main/postgresql.conf

i have:

#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

listen_addresses = '*'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;


and this is my /etc/postgresql/10/main/pg_hba.conf

# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all             postgres peer

# TYPE  DATABASE        USER            ADDRESS METHOD

# "local" is for Unix domain socket connections only
local   all             all trust
# IPv4 local connections:
host    all             all             127.0.0.1/32 trust
# IPv6 local connections:
host    all             all             ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all peer
host    replication     all             127.0.0.1/32 md5
host    replication     all             ::1/128 md5






Re: pgadmin4: not possible to create server

От
robert
Дата:

On 06.02.2018 18:28, Adrian Klaver wrote:
> On 02/06/2018 09:24 AM, robert rottermann wrote:
>> Hi there,
>>
>> I have installed pgadmin4 locally using its docker image.
>>
>> this i did running the following command:
>>
>> docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
>> "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4
>>
>> I then could access it and log into it.
>>
>> However all my attempts end in:
>>
>> Unable to connect to server:
>>
>> could not connect to server: Connection refused
>> Is the server running on host "localhost" (::1) and accepting
>> TCP/IP connections on port 5432?
>> could not connect to server: Connection refused
>> Is the server running on host "localhost" (127.0.0.1) and accepting
>> TCP/IP connections on port 5432?
>
> So where is the Postgres server located?
on my local desktop
robert


Re: pgadmin4: not possible to create server

От
Adrian Klaver
Дата:
On 02/06/2018 02:08 PM, robert wrote:
> 
> 
> On 06.02.2018 18:28, Adrian Klaver wrote:
>> On 02/06/2018 09:24 AM, robert rottermann wrote:
>>> Hi there,
>>>
>>> I have installed pgadmin4 locally using its docker image.
>>>
>>> this i did running the following command:
>>>
>>> docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
>>> "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4
>>>
>>> I then could access it and log into it.
>>>
>>> However all my attempts end in:
>>>
>>> Unable to connect to server:
>>>
>>> could not connect to server: Connection refused
>>> Is the server running on host "localhost" (::1) and accepting
>>> TCP/IP connections on port 5432?
>>> could not connect to server: Connection refused
>>> Is the server running on host "localhost" (127.0.0.1) and accepting
>>> TCP/IP connections on port 5432?
>>
>> So where is the Postgres server located?
> on my local desktop

So you pgAdmin4 running in a container on your local machine and 
Postgres running in the native OS(the OS is?) on your local machine. Is 
the Docker container set up to 'see' the local machine?

> robert
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com


Re: pgadmin4: not possible to create server

От
robert
Дата:

On 06.02.2018 23:12, Adrian Klaver wrote:
> On 02/06/2018 02:08 PM, robert wrote:
>>
>>
>> On 06.02.2018 18:28, Adrian Klaver wrote:
>>> On 02/06/2018 09:24 AM, robert rottermann wrote:
>>>> Hi there,
>>>>
>>>> I have installed pgadmin4 locally using its docker image.
>>>>
>>>> this i did running the following command:
>>>>
>>>> docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
>>>> "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4
>>>>
>>>> I then could access it and log into it.
>>>>
>>>> However all my attempts end in:
>>>>
>>>> Unable to connect to server:
>>>>
>>>> could not connect to server: Connection refused
>>>> Is the server running on host "localhost" (::1) and accepting
>>>> TCP/IP connections on port 5432?
>>>> could not connect to server: Connection refused
>>>> Is the server running on host "localhost" (127.0.0.1) and accepting
>>>> TCP/IP connections on port 5432?
>>>
>>> So where is the Postgres server located?
>> on my local desktop
>
> So you pgAdmin4 running in a container on your local machine and 
> Postgres running in the native OS(the OS is?) on your local machine. 
> Is the Docker container set up to 'see' the local machine?


Re: pgadmin4: not possible to create server

От
robert
Дата:

On 06.02.2018 23:12, Adrian Klaver wrote:
> On 02/06/2018 02:08 PM, robert wrote:
>>
>>
>> On 06.02.2018 18:28, Adrian Klaver wrote:
>>> On 02/06/2018 09:24 AM, robert rottermann wrote:
>>>> Hi there,
>>>>
>>>> I have installed pgadmin4 locally using its docker image.
>>>>
>>>> this i did running the following command:
>>>>
>>>> docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
>>>> "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4
>>>>
>>>> I then could access it and log into it.
>>>>
>>>> However all my attempts end in:
>>>>
>>>> Unable to connect to server:
>>>>
>>>> could not connect to server: Connection refused
>>>> Is the server running on host "localhost" (::1) and accepting
>>>> TCP/IP connections on port 5432?
>>>> could not connect to server: Connection refused
>>>> Is the server running on host "localhost" (127.0.0.1) and accepting
>>>> TCP/IP connections on port 5432?
>>>
>>> So where is the Postgres server located?
>> on my local desktop
>
> So you pgAdmin4 running in a container on your local machine and 
> Postgres running in the native OS(the OS is?) on your local machine. 
> Is the Docker container set up to 'see' the local machine?

what do you mean by see?



Re: pgadmin4: not possible to create server

От
Adrian Klaver
Дата:
On 02/06/2018 02:19 PM, robert wrote:
> 
> 
> On 06.02.2018 23:12, Adrian Klaver wrote:
>> On 02/06/2018 02:08 PM, robert wrote:
>>>
>>>
>>> On 06.02.2018 18:28, Adrian Klaver wrote:
>>>> On 02/06/2018 09:24 AM, robert rottermann wrote:
>>>>> Hi there,
>>>>>
>>>>> I have installed pgadmin4 locally using its docker image.
>>>>>
>>>>> this i did running the following command:
>>>>>
>>>>> docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
>>>>> "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4
>>>>>
>>>>> I then could access it and log into it.
>>>>>
>>>>> However all my attempts end in:
>>>>>
>>>>> Unable to connect to server:
>>>>>
>>>>> could not connect to server: Connection refused
>>>>> Is the server running on host "localhost" (::1) and accepting
>>>>> TCP/IP connections on port 5432?
>>>>> could not connect to server: Connection refused
>>>>> Is the server running on host "localhost" (127.0.0.1) and accepting
>>>>> TCP/IP connections on port 5432?
>>>>
>>>> So where is the Postgres server located?
>>> on my local desktop
>>
>> So you pgAdmin4 running in a container on your local machine and 
>> Postgres running in the native OS(the OS is?) on your local machine. 
>> Is the Docker container set up to 'see' the local machine?
> 
> what do you mean by see?

For fuller explanation see:


https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com


Re: pgadmin4: not possible to create server

От
Adrian Klaver
Дата:
On 02/06/2018 02:19 PM, robert wrote:
> 

>> So you pgAdmin4 running in a container on your local machine and 
>> Postgres running in the native OS(the OS is?) on your local machine. 
>> Is the Docker container set up to 'see' the local machine?
> 
> what do you mean by see?


Meant to ask earlier, why you are using the Docker image instead of one 
of the binaries listed here:

https://www.pgadmin.org/download/


-- 
Adrian Klaver
adrian.klaver@aklaver.com


solution: Re: pgadmin4: not possible to create server

От
robert
Дата:
Adrian


>>> So you pgAdmin4 running in a container on your local machine and 
>>> Postgres running in the native OS(the OS is?) on your local machine. 
>>> Is the Docker container set up to 'see' the local machine?
>>
>> what do you mean by see?
>
> For fuller explanation see:
>
>
https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach

>
>>
your hint pointed in the right direction:
it is not localhost, on which the server is running, because localhost 
is relative to the container, so it is in effect the container itself.
Postgres is running on the gatway of the containers network.
This I found out by issuing:
docker inspect reverent_volhard (where reverent_volhard is the 
containers name in which pgadmin4 runs)
this providest:
...
           "Networks": {
                 "bridge": {
                     "IPAMConfig": null,
                     "Links": null,
                     "Aliases": null,
                     "NetworkID": 
"df33249ff65c37ea1ca1f142b4a74283c4429c44c3ed1eb5ea80c695c87ab86d",
                     "EndpointID": 
"905c0c78145ef1847854f221200d8e4a7788f99b901030460111258ab9156b29",
                     "Gateway": "172.17.0.1",
                     "IPAddress": "172.17.0.2",
                     "IPPrefixLen": 16,
                     "IPv6Gateway": "",
                     "GlobalIPv6Address": "",
                     "GlobalIPv6PrefixLen": 0,
                     "MacAddress": "02:42:ac:11:00:02",
                     "DriverOpts": null
                 }

so postgres runs on 172.17.0.1

and bingo, it works

thanks again
robert


Re: pgadmin4: not possible to create server

От
robert
Дата:

On 06.02.2018 23:33, Adrian Klaver wrote:
> On 02/06/2018 02:19 PM, robert wrote:
>>
>
>>> So you pgAdmin4 running in a container on your local machine and 
>>> Postgres running in the native OS(the OS is?) on your local machine. 
>>> Is the Docker container set up to 'see' the local machine?
>>
>> what do you mean by see?
>
>
> Meant to ask earlier, why you are using the Docker image instead of 
> one of the binaries listed here:
>
> https://www.pgadmin.org/download/
>
i tried to install pgadmin4 some 10 months ago and found it confusing 
with the server and desktop mode


Re: pgadmin4: not possible to create server

От
Adrian Klaver
Дата:
On 02/06/2018 03:11 PM, robert wrote:
> 
> 
> On 06.02.2018 23:33, Adrian Klaver wrote:
>> On 02/06/2018 02:19 PM, robert wrote:
>>>
>>
>>>> So you pgAdmin4 running in a container on your local machine and 
>>>> Postgres running in the native OS(the OS is?) on your local machine. 
>>>> Is the Docker container set up to 'see' the local machine?
>>>
>>> what do you mean by see?
>>
>>
>> Meant to ask earlier, why you are using the Docker image instead of 
>> one of the binaries listed here:
>>
>> https://www.pgadmin.org/download/
>>
> i tried to install pgadmin4 some 10 months ago and found it confusing 
> with the server and desktop mode

When I was kicking the tires on pgAdmin4 I found the easiest way to use 
it was to install the Python wheel into a Python virtual environment:

https://www.pgadmin.org/download/pgadmin-4-python-wheel/

I have not played with for a while though as a find psql is the better 
interface.


-- 
Adrian Klaver
adrian.klaver@aklaver.com