What is the best way to manage the configurations of Geoserver for different environments?
In our case, the data dir (GEOSERVER_DATA_DIR) has to be identical for all our environments (local / dev / staging / prod) except for the datastore.xml files : the databases url and credentials.
Ideally, I would like a way to only externalize those database informations (for exemple, in a xml/properties file outside the data dir) while keeping a common data directory for all environments.
If no externalization of this kind is possible, how can we “switch” from one store information to another, depending on the environment Geoserver is running ?
Should we have a custom deployment script that will “tweak” the data directory and build a custom war, depending on the target environment?
What would you suggest for the deployment process vs. what is commited in the source control?
Thanks in advance!
Julien
This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.
···
Hi Julien,
The GEOSERVER_DATA_DIR is very poorly named. It points to the GeoServer Configuration files (those XML files you’re referencing).
You don’t actually need to store the data itself (shape files, GeoTiffs, whatever) within that structure.
Using that knowledge you can split the actual data from the configuration.
However, if I’m understanding your email correctly, you want to share most of the configuration between systems, but not the database credentials. In that case what I’d probably do is make the database credentials files read-only and then use something like xcopy/robocopy/rsync to copy the configurations between systems on a regular basis.
There may be more elegant solutions though; hopefully others will chip it.
(All that said, GeoWebCache is different again; it stores it config in the GEOWEBCACHE_CACHE_DIR directory, which can be different on each machine.)
Cheers,
Jonathan
On 11 July 2014 14:51, electrotype <electrotype@anonymised.com> wrote:
What is the best way to manage the configurations of Geoserver for different environments?
In our case, the data dir (GEOSERVER_DATA_DIR) has to be identical for all our environments (local / dev / staging / prod) except for the datastore.xml files : the databases url and credentials.
Ideally, I would like a way to only externalize those database informations (for exemple, in a xml/properties file outside the data dir) while keeping a common data directory for all environments.
If no externalization of this kind is possible, how can we “switch” from one store information to another, depending on the environment Geoserver is running ?
Should we have a custom deployment script that will “tweak” the data directory and build a custom war, depending on the target environment?
What would you suggest for the deployment process vs. what is commited in the source control?
Thanks in advance!
Julien
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
For database connection you could use a JNDI data source in your J2EE container. The datastore.xml file only stores the JNDI name which is common for each geoserver installation.
···
Cheers
Christian
Thanks Jonathan and Chistian.
I think JNDI is the way to go, indeed!
Julien
On 7/11/2014 10:10 AM, Christian Mueller wrote:
For database connection you could use a JNDI data source in your J2EE container. The datastore.xml file only stores the JNDI name which is common for each geoserver installation.
Cheers
Christian
I have been able to make JNDI work using Tomcat, but not using the embedded Jetty server.
I followed this : http://docs.geoserver.org/latest/en/developer/eclipse-guide/#configuring-jndi-resources-in-jetty
But I think the "jetty.config.file" argument is not used. In fact, I checkouted Geoserver source, and I only fond "jetty.config.file" string instances in tests ( For example : src\web\app\src\test\java\org\geoserver\web\Start.java ).
Am I missing something?
Julien
On 7/11/2014 10:10 AM, Christian Mueller wrote:
For database connection you could use a JNDI data source in your J2EE container. The datastore.xml file only stores the JNDI name which is common for each geoserver installation.
Cheers
Christian
On Fri, Jul 11, 2014 at 8:56 PM, electrotype <electrotype@anonymised.com> wrote:
I have been able to make JNDI work using Tomcat, but not using the
embedded Jetty server.
I followed this :
http://docs.geoserver.org/latest/en/developer/eclipse-guide/#configuring-jndi-resources-in-jetty
But I think the "jetty.config.file" argument is not used. In fact, I
checkouted Geoserver source,
and I only fond "jetty.config.file" string instances in tests ( For
example :
src\web\app\src\test\java\org\geoserver\web\Start.java ).
Am I missing something?
Not sure, but I would not recommend using the Jetty embedded server for
production use,
it's old (and slower, at least on windows I hear). It is really meant only
for demo purposes,
the production setup should be done with Tomcat.
Cheers
Andrea
--
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
We indeed only use the embedded Jetty server for development.
But I’d still like it to use JNDI so the “data” directory would be the same than on other environments.
Julien
···
On 7/11/2014 3:34 PM, Andrea Aime wrote:
On Fri, Jul 11, 2014 at 8:56 PM, electrotype <electrotype@anonymised.com> wrote:
I have been able to make JNDI work using Tomcat, but not using the embedded Jetty server.
I followed this :
http://docs.geoserver.org/latest/en/developer/eclipse-guide/#configuring-jndi-resources-in-jetty
But I think the “jetty.config.file” argument is not used. In fact, I checkouted Geoserver source,
and I only fond “jetty.config.file” string instances in tests ( For example :
src\web\app\src\test\java\org\geoserver\web\Start.java ).
Am I missing something?
Not sure, but I would not recommend using the Jetty embedded server for production use,
it’s old (and slower, at least on windows I hear). It is really meant only for demo purposes,
the production setup should be done with Tomcat.
Cheers
Andrea
–
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it