Skip to content
François Prunayre edited this page Jan 13, 2014 · 12 revisions
Date 30 November 2013 Contacts Francois Prunayre / Jesse Eichar
Status Motion passed - Done Release 2.12
Resources Available Ticket # See PR
Source code https://github.com/jesseeichar/core-geonetwork/tree/feature/multinode
Funding BRGM

Overview

The multinodes mode add the capability to setup more than one catalog using the same web application. Each catalogs have its own:

  • data directory (index, files)
  • databases
  • overrides

This simplify catalog updates for users maintaining a set of catalogs. It also save resources by sharing some resources. Eg. all catalogs share the same schemas and thesaurus (to save memory). This could be configured.

User can only login in one node at a time in the same browser (only one session allowed). When identified, if user tries to switch to another node, the catalog propose:

  • to log out and continue to the requested node
  • to return to previous node

Multinode change node alert

Technical Details:

Multinode mode

By default, only one node is available. The node named is "srv". In WEB-INF/config-security-config-security-core, the multiNodeAuthenticationFilter filter take care of user authentication.

Configuration

Register new node manually

Each node will have its own URL eg. http://localhost:8080/geonetwork/geosource-8/eng/find.

Registering a new node is a 2 steps process. First declare the new node in web.xml in order to declare the URL mapping:

<servlet-mapping>
  <servlet-name>gn-servlet</servlet-name>
  <url-pattern>/geosource-8/*</url-pattern>
</servlet-mapping>

Then define its configuration in config-node/<node_id>.xml. The configuration defines:

  • the node identifier (and if the node is the default one)
  • the db connection to use
<?xml version="1.0" encoding="UTF-8"?>
<beans default-lazy-init="true"
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context">

    <import resource="classpath*:/config-spring-geonetwork.xml"/>
    <import resource="../config-db/database_migration.xml"/>

    <context:property-override properties-ref="geosource-8-configuration-overrides" />

    <bean id="nodeInfo" class="org.fao.geonet.NodeInfo">
        <property name="id" value="geosource-8" />
        <property name="defaultNode" value="false" />
    </bean>

    <bean id="geosource-8-configuration-overrides"
        class="org.springframework.beans.factory.config.PropertiesFactoryBean">
        <property name="properties">
            <props>
                <prop key="jdbcDataSource.username">www-data</prop>
                <prop key="jdbcDataSource.password">www-data</prop>
                <prop key="jdbcDataSource.maxActive">2</prop>
                <prop key="jdbcDataSource.maxIdle">2</prop>
                <prop key="jdbcDataSource.initialSize">2</prop>
                <prop key="jdbcDataSource.Url">jdbc:postgresql://localhost:5432/db_8</prop>
            </props>
        </property>
    </bean>

    <import resource="../config-db/postgres.xml"/>

</beans>

Theming

A custom styling could be defined for each node. Add a .css file in catalog/style folder.

Utility scripts

In WEB-INF/node-utils, some utility scripts help adding new node. For example, to add a node with id geosource-1044 connecting to postgres database db_1044 with a pool size of 2 connections, use:

./node-mgr.sh www-data www-data geosource-1044 jdbc:postgresql://localhost:5432/db_1044 postgres 2

Custom data directory configuration

The data directory contains one folder per node.

<init-param>
  <param-name>geonetwork.dir</param-name>
  <param-value>/application/nodes-data/data</param-value>
</init-param>
<init-param>
  <param-name>geonetwork.schema.dir</param-name>
  <param-value>/application/webapp/geonetwork/WEB-INF/data/config/schema_plugins</param-value>
</init-param>
<init-param>
  <param-name>geonetwork.codeList.dir</param-name>
  <param-value>/application/webapp/geonetwork/WEB-INF/data/config/codelist</param-value>
</init-param>
        

Proposal Type:

  • Type: Server
  • Module: Webapp

Voting History

  • Vote Proposed: 17 December 2013
  • +1 Francois, Jesse, Jeroen, Patrizia (PSC)
  • +1 Florent (Committer)

Participants

  • Jesse Eichar
  • Francois Prunayre
  • Etienne Taffoureau

Based on previous work made on Jeevlet (https://github.com/geosource-catalogue/jeevlet/) and draft multinode implementation (https://github.com/geosource-catalogue/core-geonetwork/tree/feature/multisite) by:

  • Mathieu Coudert
  • Thierry Chevalier
  • Jean Pascal Boignard
Clone this wiki locally