asadmin> set-hazelcast-configuration --clustermode tcpip --tcpipmembers 192.168.0.104:4900,192.168.0.105:5900
Domain Data Grid Discovery Modes
Since Payara Server 5.181
The Domain Data Grid has the concept of discovery. When a Payara Server or Payara Micro instance starts it must discover other Data Grid nodes so that it can join the grid. Once an instance has connected to a Payara Instance that is already a member of the grid then it can become a member of the grid.
The Data Grid has 3 discovery modes domain, tcpip and multicast each of which is described here.
Domain Discovery Mode
Domain Discovery mode is the default mode for Payara Server. In this mode when a
Payara Server instance starts it uses information encoded into the
the node IP Address and ports of the other servers in the domain and the DAS to connect
to an existing member of the Data Grid. For a Payara Server instance the first server
it will try to connect to is the DAS if that fails it will then try each of the other
instances in turn. When the DAS starts it tries to connect to each instance in turn.
domain.xml is used to discover other members of the Data Grid no further user
configuration is usually necessary.
tcpip Discovery Mode
Tcpip discovery mode is an alternative discovery mode. In this mode the user specifies a comma separated list of IP addresses and ports that a Payara Server instance should try to connect to when it starts to find a member of the data grid.
|This discovery mode can be used to build a topology based on single instances of the DAS joining together to create the Data Grid. This is common in container based topologies with no central domain administration server.|
multicast Discovery Mode
Multicast discovery mode is an alternative discovery mode. In this mode the user specifies the multicast group and multicast port used to fina other members of the Data Grid. When a Payara Server instance configured with multicast discovery starts it broadcasts a message on the multicast group and port to discover other members of the data grid.
|This discovery mode can be used to also build a topology based on single instances of the DAS joining together to create the data grid. In this mode multicast must be supported on the network.|
|This mode is the default mode for Payara Micro and for Payara Server version 4.x|
|Also change the Data Grid group name and password to prevent other instances on the same LAN inadvertently joining your data grid.|
Configuration in the Administration Console
The domain discovery mode can be configured in the admnistration console under the Data Grid node. The discovery mode set applies domain wide.
Configuration via Asadmin
Discovery Mode can be set via Asadmin
set tcpip mode
When setting tcpip mode the list of ipaddress and ports of datagrid members must be specified.
set domain mode
asadmin> set-hazelcast-configuration --clustermode domain
set multicast mode
When setting multicast mode the multicast group and multicast port must be also specified. If not specified they will default to 188.8.131.52 and 54327
asadmin> set-hazelcast-configuration --clustermode multicast --multicastgroup 184.108.40.206 --multicastport 55000