Client and server nodes can be accessed through the predefined forClients() and forServers() methods of IgniteCluster. First, get the IgniteCluster:
IgniteCluster cluster = ignite.cluster();
Invoke the forClients() method of the cluster to get all client nodes:
ClusterGroup clientGroup = cluster.forClients();
Invoke the forServers() method of the cluster to get all server nodes:
ClusterGroup serverGroup = cluster.forServers();