Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Two or more configuration servers can be set up as a cluster, one running as a master and all others as slaves.

Drawio
baseUrlhttps://ceptor.atlassian.net/wiki
diagramNameCluster_example.drawio
tempPreviewCluster_example.png
width500
zoom1
pageId852083
custContentId1030553601
lbox1
contentVer1
height500
revision1

As above example shows, dispatcher 1 and web server 1 servers, are connected to config server 2, configured as a slave, and PTS server 1 and statistics server and config server 2 is connected to config server 1, where config server 1 is configured as a master.

...

Code Block
<system name="Ceptor PortalProtect" version="6.0.0">
copyright="(c) 2001-2017, Asseco Denmark">
	<server name="	<server name="configserver1" type="config" description="master config server" extends="configservers">
		<group name="cluster" description="cluster server configuration">
			<property name="cluster.server" value="master" valid="master|slave" description="valid values=&quot;master&quot; and &quot;slave&quot;"/>
			<property name="cluster.server.master" value="nios://localhost:21233?validateservercert=false" description="host and port of master server"/>
		</group>
		<group name="general" description="general configuration">
			<property name="list.log.directories" value="${portalprotect.home}/logs,PortalProtect Logs" description="List of log directories from which logfiles can be downloaded via the admin GUI"/>
			<property name="server.listenurls" value="local://21233;nios://21233" description="URLs to listen for connection"/>
			<property name="statistics.server" value="statisticsserver1" description="name of the statistics server"/>
			<property name="statistics.server.listenurls" value="local://21112" description="Listen URL for connection from statistics server"/>
		</group>
	</server>
	<server name="configservers" type="abstract" description="config servers shared configuration" extends="">
		<group name="consul" description="Consul Service lookup">
			<property name="consul.alloweduripattern" value="/v1/catalog/service/app*" description="Used to restrict which services an agent can lookup"/>
			<property name="consul.pollinterval" value="10" description="Cache lookups in consul for 10 seconds"/>
			<property name="consul.servers" value="" description="Consul servers to lookup services within - e.g. http://192.168.160.132:8500"/>
		</group>
		<group name="security" description="security configuration">
			<property name="access.control.configuration" value="${portalprotect.home}/config/portalprotect-security.xml" description="access control definitions"/>
			<property name="access.controller" value="dk.itp.security.accesscontrol.AccessControlListXMLImpl" description="config server access controller implementation"/>
			<property name="remote.servers" value="localhost,192.168.255.255,10.255.255.255" description="allowed remote servers, host:port separated by ,;"/>
		</group>
	</server>
</system>

...

Take this example:

Code Block
languagejs
titleParent
{
  "key1": "a",
  "key2", "b",
  "key3": [
    "a",
    "b",
  ]
}


Code Block
languagejs
titleParent
{
  "key1": "1",
  "key3": [
    "c"
  ],
  "key4": "d"
}

The result is then:

Code Block
languagejs
titleResult
{
  "key1": "1",
  "key2", "b",
  "key3": [
    "a",
    "b",
    "c"
  ],
  "key4": "d"
}

...

But, it is also possible to change this behavior - if the child contains the array json.config.override  then the behavior changes and instead we start with the parent but then completely override the specified elements, adding any new elements - meaning the result becomes like this:


Code Block
languagejs
titleParent
{
  "key1": "a",
  "key2", "b",
  "key3": [
    "a",
    "b",
  ]
}


Code Block
languagejs
titleParent
{
  "config.override": [
    "key3"
  ],
  "key1": "1",
  "key3": [
    "c"
  ],
  "key4": "d"
}

The result is then:

Code Block
languagejs
titleResult
{
  "key1": "a",
  "key2", "b",
  "key3": [
    "c"
  ],
  "key4": "d"
}

When json.config.override exists, the regular merging of arrays does not take place, and only keys specifically mentioned in the override array are replacing the corresponding elements in the parent.

You can find an example of this in the default distribution, where you have gateways as a parent, and gateway1  and gateway2  that as children each reuse the full configuration from the parent, except for the listener  settting which they optionally overrides.