<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">Hi Julierme,
<div><br /></div>
<div>Where are you trying to run the test? Is the  container related to the service “db” running? What’s the output of docker-compose ps?</div>
</div>
<div name="messageReplySection">Il 14 gen 2019, 16:09 +0100, Julierme Pinheiro <juliermeopensourcedeveloper@gmail.com>, ha scritto:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Trying to answer question 3, I ran a test:<br /></div>
<div>psql -h 172.21.14.02 -U geonode -d geonode</div>
<div><br /></div>
<div>psql: could not connect to server: No route to host<br />
    Is the server running on host "172.21.14.02" and accepting<br />
    TCP/IP connections on port 5432?<br />
<br /></div>
<div>Though <cite>/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.</cite></div>
<div><br /></div>
<div><cite>local   all             all                                     trust</cite></div>
<div><cite><br /></cite></div>
<div><cite>Any comment on this matter will be very appreciated.</cite></div>
<div><cite><br /></cite></div>
<div><cite>Kind regards<br /></cite></div>
<div><cite><br /></cite></div>
<div><cite>Julierme<br /></cite></div>
<div><br /></div>
</div>
</div>
</div>
<br />
<div class="gmail_quote">
<div dir="ltr">On Mon, Jan 14, 2019 at 12:30 PM Julierme Pinheiro <<a href="mailto:juliermeopensourcedeveloper@gmail.com">juliermeopensourcedeveloper@gmail.com</a>> wrote:<br /></div>
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Regarding my previous questions:</div>
<div>1 - When installing geonode-project via docker, is postgres configuration set automatically as in <a href="http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/create_geonode_db.html" target="_blank">here</a>?</div>
<div><br /></div>
<div>I think so. Because I found all the databases and user configured into db4my_geonode container.</div>
<div><br /></div>
<div>2 - Could the error in the log file (geonode-project server 172.21.14.02) be related to  <cite>pg_hba.conf file (local connections)?</cite></div>
<div><cite><br /></cite></div>
<div><cite>I do not think so. Because looking at /var/lib/postgresql/data/pg_hba.conf  in db4my_geonode, the cofiguration is set as:<br /></cite></div>
<div><cite><br /></cite></div>
<div><cite>local   all             all                                     trust<br /></cite></div>
<div><cite><br /></cite></div>
<div><cite>Within these two answers I should not have gotten any problem by configuring HOST: '172.21.14.02' in local_settings / DATABASES: {...}</cite></div>
<div><cite><br /></cite></div>
<div><cite>I am still thinking about question 3:</cite></div>
<div><cite><br /></cite></div>
<div><cite>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 = {...}?</cite></div>
<div><cite><br /></cite></div>
<div><cite>Thank you for your time in advance</cite></div>
<div><cite><br /></cite></div>
<div><cite>Kind regards</cite></div>
<div><cite><br /></cite></div>
<div><cite>Julierme<br /></cite></div>
<div><br /></div>
<div><br /></div>
</div>
</div>
</div>
<br />
<div class="gmail_quote">
<div dir="ltr">On Mon, Jan 14, 2019 at 12:01 PM Julierme Pinheiro <<a href="mailto:juliermeopensourcedeveloper@gmail.com" target="_blank">juliermeopensourcedeveloper@gmail.com</a>> wrote:<br /></div>
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Deal all,</div>
<div><br /></div>
<div>This is not an issue, but a question regarding postgres configuration in GeoNode-Project Docker installation.</div>
<div><br /></div>
<div>I have 2 servers and 1 client server.</div>
<div><br /></div>
<div>Server 1: postgres server - IP: 172.21.14.01</div>
<div></div>
<div></div>
<div><br /></div>
<div> I installed postgres in Server 1 (172.21.14.01) and I configured postgres as in <a href="http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/create_geonode_db.html" target="_blank">here</a>. I created in postgres:</div>
<div><br /></div>
<div>a user: geonode with password osgeo;<br /></div>
<div>a db: geonode owned by geonode user;</div>
<div>a db: geonode_data owned by geonode user;</div>
<div>and so on.</div>
<div><br /></div>
<div>Server 2 (CentOS7): geonode-project server - IP: 172.21.14.02</div>
<div><br /></div>
<div>I installed geonode-project@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.<br /></div>
<div><br /></div>
<div>Client server: my_workstation - IP: 172.21.14.03</div>
<div><br /></div>
<div>GeoNode-Project installation via Docker is successful if I change localhost to 172.21.14.01 (postgres remote server) as in:</div>
<div># Backend<br />
DATABASES = {<br />
    'default': {<br />
        'ENGINE': 'django.db.backends.postgresql_psycopg2',<br />
        'NAME': 'geonode',<br />
        'USER': 'geonode',<br />
        'PASSWORD': 'geonode',<br />
        'HOST': '172.21.14.01',<br />
        'PORT': '5432',<br />
        'CONN_TOUT': 900,<br />
    },<br />
    # vector datastore for uploads<br />
    'datastore': {<br />
        'ENGINE': 'django.contrib.gis.db.backends.postgis',<br />
        # 'ENGINE': '', # Empty ENGINE name disables<br />
        'NAME': 'geonode_data',<br />
        'USER': 'geonode',<br />
        'PASSWORD': 'geonode',<br />
        'HOST': '172.21.14.01',<br />
        'PORT': '5432',<br />
        'CONN_TOUT': 900,<br />
    }<br />
}<br />
<br /></div>
<div>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:</div>
<div><br /></div>
<div>django4my_geonode |     Is the server running on host "172.21.14.45" and accepting<br />
django4my_geonode |     TCP/IP connections on port 5432?<br /></div>
<div><br /></div>
<div>django4my_geonode |     Is the server running on host "localhost" (::1) and accepting<br />
django4my_geonode |     TCP/IP connections on port 5432?<br /></div>
<div><br /></div>
<div>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.<br /></div>
<div><br /></div>
<div>I want to use geonode-project server IP:172.21.14.02.  Said that, I came out with  the following questions:</div>
<div><br /></div>
<div>1 - When installing geonode-project via docker, is postgres configuration set automatically as in <a href="http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/create_geonode_db.html" target="_blank">here</a>?</div>
<div><br /></div>
<div>2 - Could the error in the log file (geonode-project server 172.21.14.02) be related to  <cite>pg_hba.conf file (local connections)?<br /></cite></div>
<div> </div>
<div>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 = {...}?</div>
<div><br /></div>
<div>My apologies for the long e-mail and thank you very much for your time and patience.</div>
<div><br /></div>
<div>Kind regards</div>
<div><br /></div>
<div>Julierme<br /></div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
_______________________________________________<br />
geonode-users mailing list<br />
geonode-users@lists.osgeo.org<br />
https://lists.osgeo.org/mailman/listinfo/geonode-users<br /></blockquote>
</div>
</body>
</html>