For examples, there are two Payara Micro instances and we will create a cluster of them using unicast.
- Server A : 192.168.10.1/24
- Server B : 192.168.10.2/24
The simplest way is to use 'domain' discovery mode using `--clustermode` option as follows;
[On 192.168.10.1]
$ java -jar payara-micro.jar --clustermode domain:192.168.10.1:6900
[On 192.168.10.2]
$ java -jar payara-micro.jar --clustermode domain:192.168.10.1:6900
At first, run one of them configured to use unicast and assumed it as DAS. In case of Payara Micro, the listen port is 6900 in default. Next, the other instances configured to discover the first instance already running.
You may use 'tcpip' discovery mode if you don't need to run Payara Server (true DAS) instead of 'domain' mode.
Using range of IP address instead of specific one
If you create a cluster without DAS, you can set discovery mode to 'tcpip' mode. Then, you can also set the destination not only specific IP address but also range of IP addresses. (e.g. subnet) because 'tcpip' mode enables you setting as Hazelcast configuration. For examples;
$ java -jar payara-micro.jar --clustermode tcpip:192.168.10.1:6900,192.168.10.2:5900
$ java -jar payara-micro.jar --clustermode tcpip:192.168.10.1-2:6900
If you want to set an address not specific but subnet because of some reasons, you may use range of addresses.
Add Comment
Comments
Please sign in to leave a comment.