Parameterizing Geoserver at start up

197 views
Skip to first unread message

djerrard

unread,
Jun 13, 2021, 10:45:50 PM6/13/21
to geoserver-osm-styling
I've been enjoying using this project - congratulations and thankyou!

As I'm now looking towards pipeline deployments, the use of parameterised data store details (database connection strings, etc) is very appealing. But I think I'm missing something.

I refer to the project readme page: 

I have included JAVA_OPTS parameters when starting up my Tomcat Geoserver instance, and I can confirm that all parameters appear in  the "System Properties" section of the detailed status page (http://localhost:8600/geoserver/rest/about/status(I am assuming that this them makes them accessible as environment variables, as required...??)
 e.g. 
...
user.name=geoserveruser
file.encoding=UTF8
POSTGRES_ENPOINT=osm-pgr
jnidispatch.path=/home/geoserveruser/.cache/JNA/temp/jna13123538368933583000.tmp
java.vendor.version=18.9
...

However this seems insufficient to replace the parameterised values in the "osm" data store connection strings.  When I change ALL parameters to the actual values required for my postgres database, everything works fine.  When I attempt to change just one value (as a test) I see the following log errors:

2021-06-14 02:21:04,091 DEBUG [geotools.jdbc] - CREATE CONNECTION
2021-06-14 02:21:04,120 WARN [data.store] - Error obtaining datastore with the modified values
java.io.IOException
at org.geoserver.catalog.ResourcePool.getDataStore(ResourcePool.java:666)
...
... 141 more
Caused by: java.net.UnknownHostException: ${POSTGRES_ENPOINT}
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:220)
...
... 149 more

To my untrained eye, it seems that Geoserver (or Tomcat? Or something...) is unable to interpret the environment variable syntax...  Am I missing something obvious?

This is running on a Linux docker container, by the way.

Thanks in anticipation!

Cheers,
David

Reply all
Reply to author
Forward
0 new messages