# Cluster Membership

**URL:** <https://forums.percona.com/t/cluster-membership/19651>\
**Category:** Percona XtraDB Cluster 8.x\
**Created:** [January 16, 2023, 4:38pm UTC](https://forums.percona.com/t/cluster-membership/19651 "2023-01-16T16:38:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikejohnhathaway](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mikejohnhathaway](https://forums.percona.com/u/mikejohnhathaway)\
**Post date:** [January 16, 2023, 4:38pm UTC](https://forums.percona.com/t/cluster-membership/19651/1 "2023-01-16T16:38:51Z")

</div>

Hi Percona XtraDB Cluster Community!

How can I verify cluster membership and who is the primary?? I have tried the sql from the following blog, but for my 2 node cluster I get “Empty set” returned??

I know this blog is more related to setting the weighting for the primary but I would have thought that the sql to show the cluster members should work:

```auto
mysql> select member_host,member_state,member_role,member_version from performance_schema.replication_group_members;
Empty set (0.00 sec)

```

> **[MySQL Group Replication - How to Elect the New Primary Node - Percona...](https://www.percona.com/blog/2021/01/11/mysql-group-replication-how-to-elect-the-new-primary-node/)**
>
> The different ways of electing the PRIMARY node in MySQL group replication.

Thanks in advance

Mike

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [January 16, 2023, 4:58pm UTC](https://forums.percona.com/t/cluster-membership/19651/2 "2023-01-16T16:58:24Z")

</div>

Hi @mikejohnhathaway thanks for posting to the Percona forums!

You’ve posted to the Percona XtraDB Cluster forum… but your query and link relate to Group Replication. Which technology are you in fact looking for assistance on?

---

<div class="post-metadata">

**Author:** ![mikejohnhathaway](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mikejohnhathaway](https://forums.percona.com/u/mikejohnhathaway)\
**Post date:** [January 16, 2023, 5:07pm UTC](https://forums.percona.com/t/cluster-membership/19651/3 "2023-01-16T17:07:30Z")

</div>

Hi @Michael_Coburn,

Thanks for the reply, this may be why the query isnt helping, this is for a Percona XtraDB cluster, I am trying to work out which node thinks is the primary, the following query on either of the two nodes indicates Primary on node 1 and 2??

`show status like 'wsrep%';`

Thx

Mike

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [January 17, 2023, 2:52pm UTC](https://forums.percona.com/t/cluster-membership/19651/4 "2023-01-17T14:52:05Z")

</div>

Hi @mikejohnhathaway thanks for clarifying 🙂 Yes that query is not going to work to get you information for PXC.

The simplest way to see the health of a node is to use PMM and you’ll see on the PXC/Galera Node Summary dashboard a Local State and Cluster Status box at the top which will give you membership and primary/non-primary status of the member.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/9/91b400c72b06a8b91e243d94f5437e61bde6a1a5.png)

If you want to do it from the command line:  
**Local State**  
You want to confirm your node is a member of the cluster and is up to date, this is reflected in the `wsrep_local_state_comment` by the value `Synced`  
[https://galeracluster.com/library/documentation/galera-status-variables.html#wsrep-local-state-comment](https://galeracluster.com/library/documentation/galera-status-variables.html#wsrep-local-state-comment)  
**Cluster Status**  
Whether the member is part of the `PRIMARY` or `NON_PRIMARY` component is reflected in the value of `wsrep_cluster_status`  
[https://galeracluster.com/library/documentation/galera-status-variables.html#wsrep-cluster-status](https://galeracluster.com/library/documentation/galera-status-variables.html#wsrep-cluster-status)
