On 19-08-16 16:25, David Haynes II wrote: > Thanks Daniel, that's not exactly what I am looking for does this clear > it up? > > We have an instance of GeoServer that serves up layers through a > particular database. That database is also used, primarily, by another > application (this other application might be thought of as the 'owner' > of the database). This other application employs an A/B set of > databases. That is, we build database A, and point our application and > GeoServer at this database. In the mean time, we are working on data > updates, meta data changes and the like in our B database. When we are > comfortable with where B is at, we point our application and GeoServer > at the B database. > > Is there a way to dynamically have GeoServer "lookup" it's connection > information? We're looking to have GeoServer automatically pickup that > the application is now using "B" and appropriately switch over itself to > using "B"
JNDI comes to mind, but I think geoserver initializes the connections during startup so a geoserver restart would probably be necessary, while pointing your application to another database seems manual you could probably switch over the connection behind the JNDI lookup as well; it depends on your servlet container how dynamic ths actually is; it may need to be restarted as well. > On Fri, Aug 19, 2016 at 8:13 AM, Daniel Araujo Miranda > <miranda....@dpf.gov.br <mailto:miranda....@dpf.gov.br>> wrote: > > Hi David, > I am not sure I quite understood your use case, but here's an idea: > > You may point you datasources to a local host address defined in > /etc/hosts (for example: "geoserverdatabase"), preferably one that > is not resolvable by your internal dns. > To change between demo/staging/live db servers, you just have to > change the address that your "geoserverdatabase" server points to in > /etc/hosts, without changes to your application code or geoserver > configuration. > I have just tested this here and it works. > > Best, > Daniel > > Em 18/08/2016 18:37, David Haynes II escreveu: > > Hello Everyone, > > This isn't necessarily a Geoserver question, but I am hoping to > get some advice from this group on what tools and tips will make > this work. I have a web application that consumes wms produced > by Geoserver. Currently we have a large number of layers and > view that connect directly to the PostGIS database. Generally > speaking our applications using Ruby on Rails for connecting to > the database. > > As the database changes the applications reflect these changes. > We have three ruby environments (demo, staging, live) each with > multiple database, which may or may not be serving the active > application. I want to abstract out the connection logic when > defining a layers/view so that and when they are when created > they look to the environment not the actual database. Is anyone > doing something like this and can offer some ideas. > > > -- > David Haynes, Ph.D. > Research Associate Terra Populus > Minnesota Population Center > 612-626-3933 <tel:612-626-3933> > www.terrapop.org <http://www.terrapop.org> <http://www.terrapop.org> > > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Geoserver-users mailing list > Geoserver-users@lists.sourceforge.net > <mailto:Geoserver-users@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/geoserver-users > <https://lists.sourceforge.net/lists/listinfo/geoserver-users> > > > > > > -- > David Haynes, Ph.D. > Research Associate Terra Populus > Minnesota Population Center > 612-626-3933 > www.terrapop.org <http://www.terrapop.org> > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Geoserver-users mailing list > Geoserver-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geoserver-users > ------------------------------------------------------------------------------ _______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users