hazelcast-clustering.rst 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. .. _hazelcast_clustering:
  2. Hazelcast based process status clustering
  3. =========================================
  4. Starting with version 2.7.0 GeoServer has a new WPS extension point allowing GeoServer nodes
  5. in the same cluster to share the status of current WPS requests.
  6. This is particularly important for asynchronous ones, as the client polling for the progress/results
  7. might not be hitting the same node that's currently running the requests.
  8. The Hazelcast based status sharing module leverages the Hazelcast library to share the information
  9. about the current process status using a replicated map.
  10. Installation
  11. ------------
  12. The installation of the module follows the usual process for most extensions:
  13. * Stop GeoServer
  14. * Unpack the contents of gs-wps-hazelcast-status.zip into the ``geoserver/WEB-INF/lib`` folder
  15. * Restart GeoServer
  16. Configuration
  17. -------------
  18. The module does not require any configuration in case the default behavior is suitable for the
  19. deploy environment.
  20. By default, the module will use multicast messages to locate other nodes in the same cluster
  21. and will automatically start sharing information about the process status with them.
  22. In case this is not satisfactory, a ``hazelcast.xml`` file can be created/edited in the
  23. root of the GeoServer data directory to modify the network connection methods.
  24. The file is not using a GeoServer specific syntax, it's instead a regular
  25. `Hazelcast configuration <https://docs.hazelcast.com/hazelcast/5.3/configuration/configuring-declaratively>`_
  26. file with a simple distributed map declaration:
  27. .. code-block:: xml
  28. <?xml version="1.0" encoding="UTF-8"?>
  29. <!--
  30. Configure Hazelcast for clustering GeoServer's WPS process status.
  31. For more information, see:
  32. https://docs.hazelcast.com/hazelcast/5.3/configuration/configuring-declaratively
  33. -->
  34. <hazelcast xmlns="http://www.hazelcast.com/schema/config"
  35. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  36. xsi:schemaLocation="http://www.hazelcast.com/schema/config
  37. https://hazelcast.com/schema/config/hazelcast-config-5.3.xsd">
  38. <cluster-name>gsWpsCluster</cluster-name>
  39. <!--
  40. Make Hazelcast use log4j2 just like GeoServer. Remember to add
  41. a Logger for com.hazelcast with the appropriate logging level
  42. in the geoserver logging configuration to see Hazelcast log messages
  43. -->
  44. <properties>
  45. <property name="hazelcast.logging.type">log4j2</property>
  46. </properties>
  47. <!-- Network section, by default it enables multicast, tune it to use tcp in case
  48. multicast is not allowed, and list the nodes that make up a reasonable core of the
  49. cluster (e.g., machines that will never be all down at the same time) -->
  50. <network>
  51. <port auto-increment="true">5701</port>
  52. <join>
  53. <multicast enabled="true">
  54. <multicast-group>224.2.2.3</multicast-group>
  55. <multicast-port>54327</multicast-port>
  56. </multicast>
  57. <tcp-ip enabled="false">
  58. <interface>127.0.0.1</interface>
  59. </tcp-ip>
  60. <aws enabled="false">
  61. <access-key>my-access-key</access-key>
  62. <secret-key>my-secret-key</secret-key>
  63. <region>us-east-1</region>
  64. </aws>
  65. </join>
  66. </network>
  67. <!-- The WPS status map -->
  68. <map name="wpsExecutionStatusMap">
  69. <indexes>
  70. <!-- Add indexes to support the two most common queries -->
  71. <index type="HASH">
  72. <attributes>
  73. <attribute>executionId</attribute>
  74. </attributes>
  75. </index>
  76. <index type="SORTED">
  77. <attributes>
  78. <attribute>completionTime</attribute>
  79. </attributes>
  80. </index>
  81. </indexes>
  82. </map>
  83. </hazelcast>
  84. In case a TCP based configuration is desired, one just needs to disable the multicast one,
  85. enable the tcp-ip one, and add a list of interface addresses in it that will form the core
  86. of the cluster.
  87. Not all nodes in the cluster need to be listed in said section, but a list long enough to ensure
  88. that not all the nodes in the list might go down at the same time: as long as at least one
  89. of said nodes lives, the cluster will maintain its integrity.