Adding and removing an index from a replication cluster

ALTER CLUSTER <cluster_name> ADD <index_name> adds an existing local index to the cluster. The node which receives the ALTER query sends the index to the other nodes in the cluster. All the local indexes with the same name on the other nodes of the cluster get replaced with the new index.

ALTER CLUSTER click_query ADD clicks_daily_index

ALTER CLUSTER <cluster_name> DROP <index_name> forgets about a local index, i.e., it doesn't remove the index files on the nodes but just makes it an active non-replicated index.

ALTER CLUSTER posts DROP weekly_index

Managing replication nodes

ALTER CLUSTER <cluster_name> UPDATE <nodes> statement updates node lists on each node of the cluster to include every active node in the cluster. See Joining a cluster for more info on node lists.


For example, when the cluster was initially created, the list of nodes used for rejoining the cluster was, Since then other nodes joined the cluster and now we have the following active nodes:,,,

But the list of nodes used for rejoining the cluster is still the same. Running the ALTER CLUSTER ... UPDATE nodes copies the list of active nodes to the list of nodes used to rejoin on restart. After this, the list of nodes used on restart includes all the active nodes in the cluster.

Both lists of nodes can be viewed using Cluster status statement (cluster_post_nodes_set and cluster_post_nodes_view).

Replication cluster status

Node status outputs, among other information, cluster status variables.

The output format is cluster_name_variable_name variable_value. Most of them are described in Galera Documentation Status Variables. Additionally we display:

  • cluster_name - name of the cluster
  • node_state - current state of the node: closed, destroyed, joining, donor, synced
  • indexes_count - number of indexes managed by the cluster
  • indexes - list of index names managed by the cluster
  • nodes_set - list of nodes in the cluster defined with cluster CREATE, JOIN or ALTER UPDATE commands
  • nodes_view - actual list of nodes in cluster which this node sees
| Counter                    | Value                                                                               |
| cluster_name               | post                                                                                |
| cluster_post_state_uuid    | fba97c45-36df-11e9-a84e-eb09d14b8ea7                                                |
| cluster_post_conf_id       | 1                                                                                   |
| cluster_post_status        | primary                                                                             |
| cluster_post_size          | 5                                                                                   |
| cluster_post_local_index   | 0                                                                                   |
| cluster_post_node_state    | synced                                                                              |
| cluster_post_indexes_count | 2                                                                                   |
| cluster_post_indexes       | pq1,pq_posts                                                                        |
| cluster_post_nodes_set     |                                                                      |
| cluster_post_nodes_view    |,,, |