[GeoNode-users] GeoNode-Project Docker Postgres Access

Julierme Pinheiro juliermeopensourcedeveloper at gmail.com
Mon Jan 14 07:09:03 PST 2019


Trying to answer question 3, I ran a test:
psql -h 172.21.14.02 -U geonode -d geonode

psql: could not connect to server: No route to host
    Is the server running on host "172.21.14.02" and accepting
    TCP/IP connections on port 5432?

Though /var/lib/postgresql/data/pg_hba.conf is set to trust (see bellow), I
can not understand why the connection to postgres is not successful.

local   all             all                                     trust

Any comment on this matter will be very appreciated.

Kind regards

Julierme


On Mon, Jan 14, 2019 at 12:30 PM Julierme Pinheiro <
juliermeopensourcedeveloper at gmail.com> wrote:

> Regarding my previous questions:
> 1 - When installing geonode-project via docker, is postgres configuration
> set automatically as in here
> <http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/create_geonode_db.html>
> ?
>
> I think so. Because I found all the databases and user configured into
> db4my_geonode container.
>
> 2 - Could the error in the log file (geonode-project server 172.21.14.02)
> be related to  pg_hba.conf file (local connections)?
>
> I do not think so. Because looking at
> /var/lib/postgresql/data/pg_hba.conf  in db4my_geonode, the cofiguration is
> set as:
>
> local   all             all                                     trust
>
> Within these two answers I should not have gotten any problem by
> configuring HOST: '172.21.14.02' in local_settings / DATABASES: {...}
>
> I am still thinking about question 3:
>
> Is there any postgres (db4my_geonode container) configuration in
> geonode-project server 172.21.14.02 that I must do, before using it as HOST
> value in local_settings / DATABASES = {...}?
>
> Thank you for your time in advance
>
> Kind regards
>
> Julierme
>
>
>
> On Mon, Jan 14, 2019 at 12:01 PM Julierme Pinheiro <
> juliermeopensourcedeveloper at gmail.com> wrote:
>
>> Deal all,
>>
>> This is not an issue, but a question regarding postgres configuration in
>> GeoNode-Project Docker installation.
>>
>> I have 2 servers and 1 client server.
>>
>> Server 1: postgres server - IP: 172.21.14.01
>>
>>  I installed postgres in Server 1 (172.21.14.01) and I configured
>> postgres as in here
>> <http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/create_geonode_db.html>.
>> I created in postgres:
>>
>> a user: geonode with password osgeo;
>> a db: geonode owned by geonode user;
>> a db: geonode_data owned by geonode user;
>> and so on.
>>
>> Server 2 (CentOS7): geonode-project server - IP: 172.21.14.02
>>
>> I installed geonode-project at 2.8 via Docker in server 2 and changed
>> localhost to 172.21.14.02 in docker-compose.override.yml file in order to
>> access the geonode site from the client server.
>>
>> Client server: my_workstation - IP: 172.21.14.03
>>
>> GeoNode-Project installation via Docker is successful if I change
>> localhost to 172.21.14.01 (postgres remote server) as in:
>> # Backend
>> DATABASES = {
>>     'default': {
>>         'ENGINE': 'django.db.backends.postgresql_psycopg2',
>>         'NAME': 'geonode',
>>         'USER': 'geonode',
>>         'PASSWORD': 'geonode',
>>         'HOST': '172.21.14.01',
>>         'PORT': '5432',
>>         'CONN_TOUT': 900,
>>     },
>>     # vector datastore for uploads
>>     'datastore': {
>>         'ENGINE': 'django.contrib.gis.db.backends.postgis',
>>         # 'ENGINE': '', # Empty ENGINE name disables
>>         'NAME': 'geonode_data',
>>         'USER': 'geonode',
>>         'PASSWORD': 'geonode',
>>         'HOST': '172.21.14.01',
>>         'PORT': '5432',
>>         'CONN_TOUT': 900,
>>     }
>> }
>>
>> However if I configure HOST:'172.21.14.02' or HOST: 'localhost',
>> geonode-project django and celery container will not go up and the log file
>> says respectively for HOST:'172.21.14.02' and HOST: 'localhost'
>> configuration:
>>
>> django4my_geonode |     Is the server running on host "172.21.14.45" and
>> accepting
>> django4my_geonode |     TCP/IP connections on port 5432?
>>
>> django4my_geonode |     Is the server running on host "localhost" (::1)
>> and accepting
>> django4my_geonode |     TCP/IP connections on port 5432?
>>
>> Though geonode-project installation is successful, by using postgres
>> remote server IP: 172.21.14.01, configured manually, I do not want to use
>> it.
>>
>> I want to use geonode-project server IP:172.21.14.02.  Said that, I came
>> out with  the following questions:
>>
>> 1 - When installing geonode-project via docker, is postgres configuration
>> set automatically as in here
>> <http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/create_geonode_db.html>
>> ?
>>
>> 2 - Could the error in the log file (geonode-project server 172.21.14.02)
>> be related to  pg_hba.conf file (local connections)?
>>
>> 3 - Is there any postgres (geonode/postgis container) configuration in
>> geonode-project server 172.21.14.02 that I must do, before using it as HOST
>> value in local_settings / DATABASES = {...}?
>>
>> My apologies for the long e-mail and thank you very much for your time
>> and patience.
>>
>> Kind regards
>>
>> Julierme
>>
>>
>>
>>
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20190114/07347ccb/attachment-0001.html>


More information about the geonode-users mailing list