[Geoserver-users] Shared configurations on a cluster with GeoServer-2.1-RC2

Hi,

we'd like to install parallel instances of geoserver (accessed via load
balancer) with a shared GEOSERVER_DATA_DIR - now, is there some kind of
listener mechanism for a geoserver instance to reload the configurations
from the xml/property files if the configuration files have changed?

If not, my first idea would be to implement a GeoServerInitializer which
starts a custom file monitor which will reload the geoserver resources if a
configuration file changed... what do you think?

Kind regards
Martin Zeller

-----
torres.at
bestzeller.com
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Shared-configurations-on-a-cluster-with-GeoServer-2-1-RC2-tp6203453p6203453.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On 03/24/2011 10:56 AM, Martin Zeller wrote:

we'd like to install parallel instances of geoserver (accessed via load
balancer) with a shared GEOSERVER_DATA_DIR - now, is there some kind of
listener mechanism for a geoserver instance to reload the configurations
from the xml/property files if the configuration files have changed?

Not to my knowledge.

If not, my first idea would be to implement a GeoServerInitializer which
starts a custom file monitor which will reload the geoserver resources if a
configuration file changed... what do you think?

It sure could be useful... provided you have no more than tens of layers, otherwise the reload time may turn out to be unacceptably long.

The real solution to this issue would be the Hibernate catalog, which is on the back-burner at the moment.

Regards,

Luca Morandini
http://www.lucamorandini.it

Hi,

I created a quick solution now with an additional
org.geoserver.config.ConfigurationListener - when an instance submits a
change the other instance makes a getGeoServer().reset() and a
getGeoServer().reload() - but nevertheless it does not work, because there
is a problem with global.xml ! The other instance cannot use anymore the
status page and cannot save to global.xml - see stack traces below (please
say if you need the whole stacktraces).
When this error occurs I have to restart the tomcat to make status page work
with both instances.

Any ideas?

Stacktrace when submitting: ****************

org.geoserver.catalog.CatalogException: Error persisting
GeoServerInfoImpl[null] to ...\data\global.xml
  at
org.geoserver.config.GeoServerPersister.persist(GeoServerPersister.java:705)
  at
org.geoserver.config.GeoServerPersister.handlePostGlobalChange(GeoServerPersister.java:241)
  at
org.geoserver.config.impl.GeoServerImpl.fireGlobalPostModified(GeoServerImpl.java:154)
  at org.geoserver.config.impl.GeoServerImpl.save(GeoServerImpl.java:141)
  at org.geoserver.web.admin.ContactPage$1.onSubmit(ContactPage.java:39)
  at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1561)
......
Caused by: java.io.IOException: Could not delete: ...\data\global.xml
  at
org.geoserver.config.GeoServerPersister.rename(GeoServerPersister.java:665)
  at
org.geoserver.config.GeoServerPersister.persist(GeoServerPersister.java:698)

Stacktrace on StatusPage: ********************

org.apache.wicket.WicketRuntimeException: Can't instantiate page using
constructor public org.geoserver.web.admin.StatusPage()
  at
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)
  at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)
  at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
  at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)

......

Caused by: java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)
  ... 151 more
Caused by: java.lang.NullPointerException
  at org.geoserver.web.admin.StatusPage.updateModel(StatusPage.java:186)
  at org.geoserver.web.admin.StatusPage.(StatusPage.java:78)

-----
torres.at
bestzeller.com
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Shared-configurations-on-a-cluster-with-GeoServer-2-1-RC2-tp6203453p6204459.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On 03/24/2011 04:14 PM, Martin Zeller wrote:

Hi,

I created a quick solution now with an additional
org.geoserver.config.ConfigurationListener - when an instance submits a
change the other instance makes a getGeoServer().reset() and a
getGeoServer().reload() -

Have you tried to just invoke a "reload" via the ReST admin interface ?

Regards,

Luca Morandini
http://www.lucamorandini.it

Have you tried to just invoke a "reload" via the ReST admin interface ?

No, not yet, but I will try this. Thank you.

I found out that the error of my last post occurs with single instances
too!
I just click on "Configuration and catalog => reload" - when I go to
the
status page again the same error occurs! Maybe it is just a known bug?

org.apache.wicket.WicketRuntimeException: Can't instantiate page using
constructor public org.geoserver.web.admin.StatusPage() at
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:3

Caused by: java.lang.reflect.InvocationTargetException at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)
... 148 more Caused by: java.lang.NullPointerException at
org.geoserver.web.admin.StatusPage.updateModel(StatusPage.java:186) at
org.geoserver.web.admin.StatusPage.<init>(StatusPage.java:78) ... 153
more

On Thu, 24 Mar 2011 16:36:23 +0100, Luca Morandini
<lmorandini@anonymised.com> wrote:

On 03/24/2011 04:14 PM, Martin Zeller wrote:

Hi,

I created a quick solution now with an additional
org.geoserver.config.ConfigurationListener - when an instance submits a
change the other instance makes a getGeoServer().reset() and a
getGeoServer().reload() -

Have you tried to just invoke a "reload" via the ReST admin interface ?

Regards,

Luca Morandini
http://www.lucamorandini.it

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users