Distributed System Membership Information

The SYS.MEMBERS table provides information about all peers and servers that make up a GemFire XD distributed system. You can use different queries to obtain details about individual members and their role in the cluster.

Determining Cluster Membership

To display a list of all members that participate in a given cluster, simply query all ID entries in sys.members. For example:

select ID from SYS.MEMBERS;
ID
-------------------------------------
vmc-ssrc-rh154(21046)<v3>:42445/43015
vmc-ssrc-rh156(18283)<v2>:28299/41236
vmc-ssrc-rh154(21045)<v3>:15459/55080
vmc-ssrc-rh156(18284)<v2>:43070/57131
vmc-ssrc-rh156(18285)<v1>:23603/44410
vmc-ssrc-rh154(20904)<v0>:11368/40245

6 rows selected

The number of rows returned corresponds to the total number of peers, servers, and locators in the cluster.

To determine each member's role in the system, include the KIND column in the query:

select ID, KIND from SYS.MEMBERS;
ID                                          |KIND
-------------------------------------------------------------
vmc-ssrc-rh154(26615)<v0>:31141/53707       |accessor(normal)
vmc-ssrc-rh154(26739)<v3>:9287/48842        |datastore(norma&
vmc-ssrc-rh156(23870)<v1>:23802/60824       |datastore(norma&
vmc-ssrc-rh154(26751)<v4>:42054/49195       |datastore(norma&
vmc-ssrc-rh156(23897)<v2>:37163/43747       |datastore(norma&
vmc-ssrc-rh156(23882)<v2>:26779/35052       |accessor(normal)

6 rows selected

Data store members host data in the cluster, while accessor members do not host data. This role is determined by the host-data boot property. If a cluster contains only a single data store, its KIND is listed as "datastore(loner)."

Determining Server Group Membership

GemFire XD peers and servers that host data can participate in one or more server groups. You can use server group membership to specify how individual tables are partitioned or replicated across the cluster. You can also use server groups to target event listeners and other GemFire XD features. To display the server group membership for each cluster member, query the SERVERGROUPS column. For example:

select ID, SERVERGROUPS from SYS.MEMBERS;
ID                                          |SERVERGROUPS
----------------------------------------------------------
vmc-ssrc-rh154(26615)<v0>:31141/53707       |
vmc-ssrc-rh154(26739)<v3>:9287/48842        |SG2
vmc-ssrc-rh156(23897)<v2>:37163/43747       |SG1
vmc-ssrc-rh156(23882)<v2>:26779/35052       |SG1
vmc-ssrc-rh156(23870)<v1>:23802/60824       |SG2
vmc-ssrc-rh154(26751)<v4>:42054/49195       |SG1

6 rows selected

Data stores that you start without specifying a server group name are added to the default server group, and have a null value for the SERVERGROUPS column.

As an alternative, you use the GROUPSINTERSECT function to determine which members are part of the server group(s) that you specify in the function. Note that if you specify a comma-separated list, GROUPSINTERSECT requires the list to be sorted. For example:

select ID, SERVERGROUPS from SYS.MEMBERS where GROUPSINTERSECT(SERVERGROUPS, 'SG1,SG2');
ID                                           |SERVERGROUPS
------------------------------------------------------------------------
vmc-ssrc-rh156(23897)<v2>:37163/43747        |SG1
vmc-ssrc-rh154(26751)<v4>:42054/49195        |SG1
vmc-ssrc-rh156(23882)<v2>:26779/35052        |SG1
vmc-ssrc-rh156(23870)<v1>:23802/60824        |SG2
vmc-ssrc-rh154(26739)<v3>:9287/48842         |SG2

5 rows selected