Managing clusters through configuration file

Feedback


The cluster configuration of SuperMap iServer is in iserver-system.xml. Please refer to iServer configuration file for more details. When a service in SuperMap iServer is launched, the GIS services and cluster services on this server are organized using the configuration information in the configuration file. Thus a user can directly manage and configure the services on the server by modifying the configuration information at the corresponding nodes.

The contents of this section are:

Cluster configuration overview

Cluster service configuration

The cluster service configuration in iserver-system.xml is located at the <clusterService> node, which has the following content:

 

Node name

Description

<clusterService> Root node for cluster service configuration.

<enabled>

(Child nodes of <clusterService>)

Whether the cluster service is available. If false, the cluster service cannot be used; if true, the cluster service can be enabled. Default is true.
<balancer>

This node is used to specify the load balancing algorithm for calculating the loads for the GIS services in the cluster service. The node needs to specify the type name of the algorithm, e.g., com.supermap.services.cluster.WeightedRoundBalancer.

To serve the clients, a cluster service calculates the GIS service with the minimum load using a load balancing algorithm. There are a number of load balancing algorithms, such as the Round Robin algorithm, and the Weighted Round Robin algorithm. Currently SuperMap iServer provides the Weighted Round Robin algorithm, whose type name is com.supermap.services.cluster.WeightedRoundBalancer.

<monitorPeriod> The time step for monitoring the nodes in a cluster service, in milliseconds.

 

Example:

<clusterService>

        <enabled>true</enabled>

        <monitorPeriod>5000</monitorPeriod>

        <balancer>com.supermap.services.cluster.WeightedRoundBalancer</balancer>

</clusterService>

Reporter configuration

The configuration of the reporter is located at the node in the iserver-system.xml file. The node has the following content:

Node name

Description

<reporters>

The root node for reporter configuration.

In SuperMap iServer, a reporter can be used to add the iServer service to the cluster service to improve the service's capacity. SuperMap Server also supports multi-level cluster services, in which a cluster service can be clustered by a higher-level cluster service. Thus the current status of a lower-level cluster service needs to be reported to a higher-level cluster service. This node is used to set the configuration information needed for reporting to the higher-level cluster service.

<reporter>

Reporter. A reporter is responsible for reporting the status to a higher-level cluster service. Therefore, the number of nodes to be created is the same as the number of the cluster services to which the iServer service is added.

Two child nodes need to be set for the <reporter> node: <enabled>, <address>.

<enabled> Whether the reporter is available. If false, the status of the cluster service is not reported to the higher-level cluster service at which this reporter is pointed, i.e., this cluster service is not be added to the higher-level cluster service at which the reporter is pointed; if true, the status of the cluster service is reported regularly to the higher-level cluster service at which the reporter is pointed, i.e., the cluster service is added to that higher-level cluster service. Default is false.
<address>

The address of the higher-level cluster service. If the cluster service is RESTful, this address will be the address of the root resource of the cluster service, e.g., <address>http://192.168.11.11:8090/iserver/services/cluster</address>.

<token>

The security Token to be set up after the parent node opens security control.

Enabling cluster

Clusters can be used to improve the capacity of a GIS server. The configuration of the cluster used is at the <cluster> node in the iserver-system.xml file. The configuration node has the following content:

Node name

Description

<cluster>

This node is a major node for the GIS service components to access the cluster. Through the configuration of its child nodes <enabled> and <address>, it can be specified whether the GIS service components in the GIS application are to access the cluster and retrieve the service providers.

<enabled>

Whether a cluster is to be used on this iServer server to improve its capacity. Default is false.

<address>

The address of a cluster service. The GIS service component will acquire the optimal service provider through the cluster service corresponding to this address.

<connectTimeout>

The connection timeout of child node. Unit is millisecond. Default is 2000ms, i.e., 2s.

<readTimeout>

The timeout to read a request returned from the child node. Unit is millisecond. Default is 12000ms, i.e., 2mins.

<useLocalCluster>

Labels whether to use the local cluster service. Default is false, i.e., not to use the local cluster service.

For example:

<cluster>

      <enabled>false</enabled>  

      <address>http://localhost:8090/iserver/services/cluster</address>

      <connectTimeout>2000</connectTimeout>

      <readTimeout>120000</readTimeout>

      <useLocalCluster>false</useLocalCluster>

</cluster>

Controlled cluster configuration

The child node in SuperMap iServer can be added in the cluster in a controlled way. In the system configuration file of the child node (iserver-system.xml), the <controllable> node can be used to configure the controlled cluster.

Node name

Description

<controllable> This node is a main node to configure iServer enabled in a controlled way. By configuring the child node, you can set whether to enable it in the controlled way, which parent node controls it, etc.
<address> Be controlled by which cluster server (parent node) when enabled in the controlled way.
<enabled> Whether to enable the service in the controlled way.
<token> The security Token to be set up after the parent node opens security control.
<isTileWorker> Whether to attend the distributed tiles. When it is true, the controlled node can join in the distrbuted tile.

For example:

<controllable>

      <address>http://clusterservice:8090/iserver/services/cluster</address>  

      <enabled>true</enabled>   

      <token>-71 90 -24 -17 -115 80 -56 -17</token>

      <isTileWorker>true</isTieWorker>

</controllable>

Configuration of cluster forward parameter

iServer supports the customized configuration cluster forward rule, to improve the efficience of cluster system forward request.

Node name

Instruction

<clusterRequestClientMode> Cluster request forward format: ASYNC is asynchronous mode, SYNC is synchronous mode, asynchronous mode is recommended for better efficient.
<asyncClientSetting> asynchronization client end configuration parameter
<ioReactorSelectInterval> IOReactor selection time interval.
<ioReactorIoThreadCount> IOReactor IO thread NO.
<ioReactorSoKeepAlive> IOReactor keeps connection or not.
<clientMaxConnTotal> Max connection NO. of client end
<clientMaxConnPerRoute> Max connection NO. of client end for each route.
<connectTimeout> Length of connection timeout.
<soTimeout> Length of socket timeout.

e.g.:

<clusterRequestClientSetting>

    <clusterRequestClientMode>ASYNC</clusterRequestClientMode>

    <asyncClientSetting>

        <ioReactorSelectInterval>30</ioReactorSelectInterval>

        <ioReactorIoThreadCount>200</ioReactorIoThreadCount>

        <ioReactorSoKeepAlive>true</ioReactorSoKeepAlive>

        <clientMaxConnTotal>10000</clientMaxConnTotal>

        <clientMaxConnPerRoute>10000</clientMaxConnPerRoute>

        <connectTimeout>120000</connectTimeout>

        <soTimeout>120000</soTimeout>

    </asyncClientSetting>

</clusterRequestClientSetting>