# Introduction in replication course

В этом руководстве мы изучим основы репликации в Manticore Search.

### Кратко о репликации

Демон Manticore Search может реплицировать транзакцию записи в Real-Time или Percolate-индексе на другие узлы кластера.
*Попробовать это вживую* *[здесь](https://play.manticoresearch.com/replication/)* *или прочитать ниже.*

ваша сборка поддерживает репликацию (включена по умолчанию в официальных сборках Manticore - <https://manticoresearch.com/downloads/>)
- установите параметр data_dir в секции searchd конфигурации. Здесь хранятся входящие индексы
- задайте параметр listen с диапазоном как минимум двух портов на кластер для протокола репликации
- задайте параметр listen для протокола SphinxAPI
- задайте параметр listen для протокола SphinxQL (для выполнения команд управления кластером)
- при необходимости задайте параметр server_id. Значения должны быть уникальны во всём кластере. Если не задано, server_id генерируются автоматически
- Вы можете посмотреть пример конфигурации Manticore, используемой в этой демонстрации:

`cat /etc/sphinxsearch/sphinx1.conf`


index pq {

```ini
  type = percolate
  path = /var/lib/manticore/data/pq1
}
index testrt

{
  type = rt
  path = /var/lib/manticore/data/testrt1
  rt_field = title
  rt_field = content
  rt_attr_uint = gid
}
searchd {

  listen = 127.0.0.1:9312
  listen = 127.0.0.1:9306:mysql41
  listen = 127.0.0.1:9350-9359:replication
  data_dir = /var/run/manticore/replication/1
  log = /var/run/manticore/log/searchd1.log
  pid_file = /var/run/manticore/searchd1.pid
  binlog_path = /var/run/manticore/data/pq1
  server_id = 1
}
У нас запущены два экземпляра демона Manticore Search на разных портах (9306 и 9307), представляющих два узла нашего будущего кластера. Конфигурация другого узла:
```

`cat /etc/sphinxsearch/sphinx2.conf`

  searchd {

```ini
  listen = 127.0.0.1:9313
  listen = 127.0.0.1:9307:mysql41
  listen = 127.0.0.1:9360-9369:replication
  data_dir = /var/run/manticore/replication/2
  log = /var/run/manticore/log/searchd2.log
  pid_file = /var/run/manticore/searchd2.pid
  binlog_path = /var/run/manticore/data/pq2
  server_id = 2
}
Подключимся к первому узлу:
```

`mysql -P 9306 -h0`


и создадим в нём новый кластер.

```sql
## Создание нового кластера
`CREATE CLUSTER posts;`
MySQL [(none)]> CREATE CLUSTER posts;
Query OK, 0 rows affected (0.90 sec)

Чтобы убедиться, что кластер успешно создан, используйте команду **SHOW STATUS**:

`SHOW STATUS LIKE 'cluster%';`
```

MySQL [(none)]> SHOW STATUS LIKE 'cluster%';

+------------------------------------------+----------------------------------------------+

| Counter                                  | Value                                        |

```sql
+------------------------------------------+----------------------------------------------+
| cluster_name                             | posts                                        |
```

| cluster_posts_state_uuid                 | 95c2ffc3-c296-11e9-b475-9fad1c2e6dab         |

| cluster_posts_conf_id                    | 1                                            |

```sql
| cluster_posts_status                     | primary                                      |
| cluster_posts_size                       | 1                                            |
| cluster_posts_local_index                | 0                                            |
| cluster_posts_node_state                 | synced                                       |
| cluster_posts_nodes_set                  |                                              |
| cluster_posts_nodes_view                 | 127.0.0.1:9312,127.0.0.1:9350:replication    |
| cluster_posts_indexes_count              | 0                                            |
| cluster_posts_indexes                    |                                              |
| cluster_posts_local_state_uuid           | 95c2ffc3-c296-11e9-b475-9fad1c2e6dab         |
| cluster_posts_protocol_version           | 9                                            |
| cluster_posts_last_applied               | 0                                            |
| cluster_posts_last_committed             | 0                                            |
| cluster_posts_replicated                 | 0                                            |
| cluster_posts_replicated_bytes           | 0                                            |
| cluster_posts_repl_keys                  | 0                                            |
| cluster_posts_repl_keys_bytes            | 0                                            |
| cluster_posts_repl_data_bytes            | 0                                            |
| cluster_posts_repl_other_bytes           | 0                                            |
| cluster_posts_received                   | 2                                            |
| cluster_posts_received_bytes             | 175                                          |
| cluster_posts_local_commits              | 0                                            |
| cluster_posts_local_cert_failures        | 0                                            |
| cluster_posts_local_replays              | 0                                            |
| cluster_posts_local_send_queue           | 0                                            |
| cluster_posts_local_send_queue_max       | 2                                            |
| cluster_posts_local_send_queue_min       | 0                                            |
| cluster_posts_local_send_queue_avg       | 0.500000                                     |
| cluster_posts_local_recv_queue           | 0                                            |
| cluster_posts_local_recv_queue_max       | 2                                            |
| cluster_posts_local_recv_queue_min       | 0                                            |
| cluster_posts_local_recv_queue_avg       | 0.500000                                     |
| cluster_posts_local_cached_downto        | 0                                            |
| cluster_posts_flow_control_paused_ns     | 0                                            |
| cluster_posts_flow_control_paused        | 0.000000                                     |
| cluster_posts_flow_control_sent          | 0                                            |
| cluster_posts_flow_control_recv          | 0                                            |
| cluster_posts_flow_control_interval      | [ 100, 100 ]                                 |
| cluster_posts_flow_control_interval_low  | 100                                          |
| cluster_posts_flow_control_interval_high | 100                                          |
| cluster_posts_flow_control_status        | OFF                                          |
| cluster_posts_cert_deps_distance         | 0.000000                                     |
| cluster_posts_apply_oooe                 | 0.000000                                     |
| cluster_posts_apply_oool                 | 0.000000                                     |
| cluster_posts_apply_window               | 0.000000                                     |
| cluster_posts_commit_oooe                | 0.000000                                     |
| cluster_posts_commit_oool                | 0.000000                                     |
| cluster_posts_commit_window              | 0.000000                                     |
| cluster_posts_local_state                | 4                                            |
| cluster_posts_local_state_comment        | Synced                                       |
| cluster_posts_cert_index_size            | 0                                            |
| cluster_posts_cert_bucket_count          | 2                                            |
| cluster_posts_gcache_pool_size           | 1320                                         |
| cluster_posts_causal_reads               | 0                                            |
| cluster_posts_cert_interval              | 0.000000                                     |
| cluster_posts_open_transactions          | 0                                            |
| cluster_posts_open_connections           | 0                                            |
| cluster_posts_ist_receive_status         |                                              |
| cluster_posts_ist_receive_seqno_start    | 0                                            |
| cluster_posts_ist_receive_seqno_current  | 0                                            |
| cluster_posts_ist_receive_seqno_end      | 0                                            |
| cluster_posts_incoming_addresses         | 127.0.0.1:9312,127.0.0.1:9350:replication    |
| cluster_posts_cluster_weight             | 1                                            |
| cluster_posts_desync_count               | 0                                            |
| cluster_posts_evs_delayed                |                                              |
| cluster_posts_evs_evict_list             |                                              |
| cluster_posts_evs_repl_latency           | 1.075e-06/7.957e-06/2.2911e-05/8.12112e-06/5 |
| cluster_posts_evs_state                  | OPERATIONAL                                  |
| cluster_posts_gcomm_uuid                 | 95b52441-c296-11e9-abae-52c260760909         |
+------------------------------------------+----------------------------------------------+
71 rows in set (0.00 sec)
Вы можете увидеть информацию о нашем новом кластере в полях статуса.
Вставим некоторые данные в наш индекс **testrt**.
`INSERT INTO testrt VALUES(1,'List of HP business laptops','Elitebook Probook',10);`
MySQL [(none)]> INSERT INTO testrt VALUES(1,'List of HP business laptops
','Elitebook Probook',10);
Query OK, 1 row affected (0.10 sec)
`SELECT * FROM testrt;`

```

MySQL [(none)]> INSERT INTO testrt VALUES(1,'List of HP business laptops

','Elitebook Probook',10);

Query OK, 1 row affected (0.10 sec)

```sql
Обратите внимание, что все запросы на запись, такие как **INSERT**, **REPLACE**, **DELETE**, **TRUNCATE**, которые должны изменять индекс в кластере, должны использовать формат **cluster_name:index_name** вместо простого **index_name**, чтобы гарантировать распространение изменений на все реплики кластера. В противном случае будет вызвана ошибка (см. ниже). Пока индекс не находится в кластере, вы можете вставлять в него данные без какого-либо префикса:
`INSERT INTO testrt VALUES(2,'List of Dell business laptops','Latitude Precision Vostro',10);`
MySQL [(none)]> INSERT INTO testrt VALUES(2,'List of Dell business laptops','Latitude Precision Vostro',10);
```

Query OK, 1 row affected (0.00 sec)

```sql
Когда вы пытаетесь вставить документ в индекс внутри кластера, необходимо добавить имя кластера перед именем индекса:
`INSERT INTO posts:testrt VALUES(3,'List of Dell business laptops','Latitude Precision Vostro',10);`
MySQL [(none)]> INSERT INTO posts:testrt VALUES(3,'List of Dell business laptops','Latitude Precision Vostro',10);
ERROR 1064 (42000): index 'testrt' is not in any cluster, use just 'testrt'
Поскольку индекс ещё не находится в кластере, мы видим ошибку. Чтобы реплицировать новый документ, сначала нужно добавить индекс в кластер. Это можно сделать следующей командой:
`ALTER CLUSTER posts ADD testrt;`
MySQL [(none)]> ALTER CLUSTER posts ADD testrt;
```

Query OK, 0 rows affected (0.10 sec)

Наш индекс **testrt** теперь находится в кластере, что можно проверить, посмотрев поле статуса **cluster_posts_indexes** (**posts** — имя нашего кластера).

```sql
`SHOW STATUS LIKE 'cluster_posts_indexes';`
MySQL [(none)]> SHOW STATUS LIKE 'cluster_posts_indexes';
```

+-----------------------+--------+

| Counter               | Value  |

```sql
+-----------------------+--------+
| cluster_posts_indexes | testrt |
```

+-----------------------+--------+

1 row in set (0.00 sec)

```sql
Вставим ещё данные в наш индекс **testrt**:
`INSERT INTO testrt VALUES(3,'List of Dell business laptops','Latitude Precision Vostro',10);`
```
MySQL [(none)]> INSERT INTO testrt VALUES(3,'List of Dell business lapto ps','Latitude Precision Vostro',10);

ERROR 1064 (42000): index 'testrt' is a part of cluster 'posts', use 'posts:testrt'

```sql
Теперь мы видим ошибку, потому что правильный запрос:
`INSERT INTO posts:testrt VALUES(3,'List of Dell business laptops','Latitude Precision Vostro',10);`
MySQL [(none)]> INSERT INTO posts:testrt VALUES(3,'List of Dell business  laptops','Latitude Precision Vostro',10);
ERROR 1064 (42000): index 'testrt' is not in any cluster, use just 'testrt'
И он работает как ожидалось.
`SELECT * FROM testrt;`
MySQL [(none)]> SELECT * FROM testrt;
```

+------+------+

| id   | gid  |

```sql
+------+------+
|    1 |   10 |
```

+------+------+

1 row in set (0.10 sec)

```sql
## Присоединение узла к кластеру
Перейдём к другому узлу, который у нас есть.
```

`exit;`


MySQL [(none)]> exit;

```sql
Bye
`mysql -P 9307 -h0`
MySQL [(none)]> exit;
Bye
Мы знаем, что этот узел ещё не входит в наш кластер, поэтому в нём нет данных в индексе **testrt**, который мы добавили ранее на другом узле. Индекса **testrt** даже нет
`SELECT * FROM testrt;`
MySQL [(none)]> SELECT * FROM testrt;
```

+------+------+

---

| id   | gid  |

+------+------+

```sql
|    1 |   10 |
+------+------+
```

1 row in set (0.10 sec)

```sql
Присоединимся к кластеру. Для этого используйте оператор **JOIN CLUSTER**. Необходимо указать имя кластера (так как их может быть несколько) и узел, к которому хотите подключиться:
`JOIN CLUSTER posts at '127.0.0.1:9312';`
MySQL [(none)]> JOIN CLUSTER posts at '127.0.0.1:9312';
Query OK, 0 rows affected (1.90 sec)

Теперь попробуем снова:

`SELECT * FROM testrt;`
```

MySQL [(none)]> SELECT * FROM testrt;


+------+------+

```sql
| id   | gid  |
+------+------+
|    1 |   10 |
+------+------+
1 row in set (0.10 sec)
Мы видим, что все данные индекса успешно реплицированы. Вставим ещё одно значение в индекс.
`INSERT INTO posts:testrt VALUES(4,'List of Dell gaming laptops','Inspirion Alienware',20);`
```

MySQL [(none)]> INSERT INTO posts:testrt VALUES(4,'List of Dell gaming l aptops','Inspirion Alienware',20);


Query OK, 1 row affected (0.20 sec)

```sql
`SELECT * FROM testrt;`
MySQL [(none)]> INSERT INTO posts:testrt VALUES(4,'List of Dell gaming l aptops','Inspirion Alienware',20);
```

Query OK, 1 row affected (0.20 sec)

А теперь переключимся обратно к нашему первому узлу:

```sql
`exit;`
MySQL [(none)]> exit;
Bye
`mysql -P 9306 -h0`
MySQL [(none)]> exit;
Bye
`SELECT * FROM testrt;`
```

root@replication-5b59c59f5c-mkqfc:/# mysql -P 9306 -h0

Welcome to the MariaDB monitor.  Commands end with ; or \g.

```sql
Your MySQL connection id is 1
Server version: 3.1.0 445e806e@190716 release
```

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

```sql
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Как видим, изменения успешно реплицированы.
## Удаление индексов кластера и кластеров
Теперь удалим наш индекс из кластера:
`ALTER CLUSTER posts DROP testrt;`
MySQL [(none)]> ALTER CLUSTER posts DROP testrt;
Query OK, 0 rows affected (0.00 sec)
```

`SHOW STATUS LIKE 'cluster_posts_indexes';`

MySQL [(none)]> ALTER CLUSTER posts DROP testrt;

```sql
Query OK, 0 rows affected (0.00 sec)
Это сработало!
```

` SELECT * from testrt;`

```sql
**testrt** индекс стал обычным локальным нереплицируемым индексом. Убедимся в этом:
` INSERT INTO testrt VALUES(5,'Lenovo laptops list','Yoga IdeaPad',30);`
MySQL [(none)]> SELECT * from testrt;
+------+------+

| id   | gid  |

+------+------+
```

|    1 |   10 |

```sql
|    2 |   10 |
|    3 |   10 |
|    4 |   20 |
+------+------+
4 rows in set (0.00 sec)
Нет предупреждения об отсутствии 'posts:', значит 'testrt' больше не находится в кластере.
`SELECT * from testrt;`
```

MySQL [(none)]> INSERT INTO testrt VALUES(5,'Lenovo laptops list','Yoga  IdeaPad',30);

Query OK, 1 row affected (0.00 sec)

---


Переключимся на наш второй узел:

`exit;`

```sql
MySQL [(none)]> SELECT * from testrt;
+------+------+
```

| id   | gid  |

```sql
+------+------+
|    1 |   10 |
|    2 |   10 |
|    3 |   10 |
|    4 |   20 |
+------+------+
4 rows in set (0.00 sec)

```

`mysql -P 9307 -h0`


root@replication-5b59c59f5c-mkqfc:/# mysql -P 9307 -h0



```sql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 3.1.0 445e806e@190716 release
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
`SELECT * from testrt;`
MySQL [(none)]> SELECT * from testrt;
+------+------+
| id   | gid  |
+------+------+

```
|    1 |   10 |

|    2 |   10 |

```sql
|    3 |   10 |
|    4 |   20 |
```

+------+------+


4 rows in set (0.00 sec)

```sql
Как и ожидалось, изменения, сделанные на первом узле, не были реплицированы на второй узел.
Чтобы полностью удалить кластер, используйте оператор **DELETE CLUSTER**:
`DELETE CLUSTER posts;`
MySQL [(none)]> DELETE CLUSTER posts;
Query OK, 0 rows affected (6.20 sec)
`SHOW STATUS LIKE 'cluster%';`
MySQL [(none)]> SHOW STATUS LIKE 'cluster%';
+------------------------------------------+----------------------------------------------+
| Counter                                  | Value                                        |
+------------------------------------------+----------------------------------------------+

```

| cluster_name                             | posts                                        |

| cluster_posts_state_uuid                 | 95c2ffc3-c296-11e9-b475-9fad1c2e6dab         |

```sql
| cluster_posts_conf_id                    | 1                                            |
| cluster_posts_status                     | primary                                      |
```

| cluster_posts_size                       | 1                                            |

```sql
| cluster_posts_local_index                | 0                                            |
| cluster_posts_node_state                 | synced                                       |
| cluster_posts_nodes_set                  |                                              |
| cluster_posts_nodes_view                 | 127.0.0.1:9312,127.0.0.1:9350:replication    |

| cluster_posts_indexes_count              | 0                                            |

| cluster_posts_indexes                    |                                              |
```

| cluster_posts_local_state_uuid           | 95c2ffc3-c296-11e9-b475-9fad1c2e6dab         |

```sql
| cluster_posts_protocol_version           | 9                                            |
| cluster_posts_last_applied               | 0                                            |
| cluster_posts_last_committed             | 0                                            |
| cluster_posts_replicated                 | 0                                            |
| cluster_posts_replicated_bytes           | 0                                            |
| cluster_posts_repl_keys                  | 0                                            |
| cluster_posts_repl_keys_bytes            | 0                                            |
| cluster_posts_repl_data_bytes            | 0                                            |
| cluster_posts_repl_other_bytes           | 0                                            |
| cluster_posts_received                   | 2                                            |
```

| cluster_posts_received_bytes             | 175                                          |

| cluster_posts_local_commits              | 0                                            |


| cluster_posts_local_cert_failures        | 0                                            |

```sql
| cluster_posts_local_replays              | 0                                            |
| cluster_posts_local_send_queue           | 0                                            |
```

| cluster_posts_local_send_queue_max       | 2                                            |

```sql
| cluster_posts_local_send_queue_min       | 0                                            |
| cluster_posts_local_send_queue_avg       | 0.500000                                     |
| cluster_posts_local_recv_queue           | 0                                            |
| cluster_posts_local_recv_queue_max       | 2                                            |
| cluster_posts_local_recv_queue_min       | 0                                            |
| cluster_posts_local_recv_queue_avg       | 0.500000                                     |
| cluster_posts_local_cached_downto        | 0                                            |
| cluster_posts_flow_control_paused_ns     | 0                                            |
| cluster_posts_flow_control_paused        | 0.000000                                     |
| cluster_posts_flow_control_sent          | 0                                            |
| cluster_posts_flow_control_recv          | 0                                            |
| cluster_posts_flow_control_interval      | [ 100, 100 ]                                 |
| cluster_posts_flow_control_interval_low  | 100                                          |
| cluster_posts_flow_control_interval_high | 100                                          |
| cluster_posts_flow_control_status        | OFF                                          |
| cluster_posts_cert_deps_distance         | 0.000000                                     |
| cluster_posts_apply_oooe                 | 0.000000                                     |
| cluster_posts_apply_oool                 | 0.000000                                     |
| cluster_posts_apply_window               | 0.000000                                     |
| cluster_posts_commit_oooe                | 0.000000                                     |
| cluster_posts_commit_oool                | 0.000000                                     |
| cluster_posts_commit_window              | 0.000000                                     |
| cluster_posts_local_state                | 4                                            |
| cluster_posts_local_state_comment        | Synced                                       |
| cluster_posts_cert_index_size            | 0                                            |
| cluster_posts_cert_bucket_count          | 2                                            |
| cluster_posts_gcache_pool_size           | 1320                                         |
| cluster_posts_causal_reads               | 0                                            |
| cluster_posts_cert_interval              | 0.000000                                     |
| cluster_posts_open_transactions          | 0                                            |
| cluster_posts_open_connections           | 0                                            |
| cluster_posts_ist_receive_status         |                                              |
| cluster_posts_ist_receive_seqno_start    | 0                                            |
| cluster_posts_ist_receive_seqno_current  | 0                                            |
| cluster_posts_ist_receive_seqno_end      | 0                                            |
| cluster_posts_incoming_addresses         | 127.0.0.1:9312,127.0.0.1:9350:replication    |
| cluster_posts_cluster_weight             | 1                                            |
| cluster_posts_desync_count               | 0                                            |
| cluster_posts_evs_delayed                |                                              |
| cluster_posts_evs_evict_list             |                                              |
| cluster_posts_evs_repl_latency           | 1.075e-06/7.957e-06/2.2911e-05/8.12112e-06/5 |
| cluster_posts_evs_state                  | OPERATIONAL                                  |
| cluster_posts_gcomm_uuid                 | 95b52441-c296-11e9-abae-52c260760909         |
+------------------------------------------+----------------------------------------------+
71 rows in set (0.00 sec)
Кластер удаляется со всех узлов, но его индексы остаются нетронутыми и становятся обычными локальными нереплицируемыми индексами.
`SELECT * FROM testrt;`
MySQL [(none)]> SHOW STATUS LIKE 'cluster%';
+------------------------------------------+----------------------------------------------+
| Counter                                  | Value                                        |
+------------------------------------------+----------------------------------------------+
| cluster_name                             | posts                                        |
| cluster_posts_state_uuid                 | 95c2ffc3-c296-11e9-b475-9fad1c2e6dab         |
| cluster_posts_conf_id                    | 1                                            |
| cluster_posts_status                     | primary                                      |
| cluster_posts_size                       | 1                                            |
| cluster_posts_local_index                | 0                                            |
| cluster_posts_node_state                 | synced                                       |
| cluster_posts_nodes_set                  |                                              |
| cluster_posts_nodes_view                 | 127.0.0.1:9312,127.0.0.1:9350:replication    |
| cluster_posts_indexes_count              | 0                                            |
| cluster_posts_indexes                    |                                              |
| cluster_posts_local_state_uuid           | 95c2ffc3-c296-11e9-b475-9fad1c2e6dab         |
| cluster_posts_protocol_version           | 9                                            |
| cluster_posts_last_applied               | 0                                            |
| cluster_posts_last_committed             | 0                                            |
| cluster_posts_replicated                 | 0                                            |
| cluster_posts_replicated_bytes           | 0                                            |
| cluster_posts_repl_keys                  | 0                                            |
| cluster_posts_repl_keys_bytes            | 0                                            |
| cluster_posts_repl_data_bytes            | 0                                            |
| cluster_posts_repl_other_bytes           | 0                                            |
| cluster_posts_received                   | 2                                            |
| cluster_posts_received_bytes             | 175                                          |
| cluster_posts_local_commits              | 0                                            |
| cluster_posts_local_cert_failures        | 0                                            |
| cluster_posts_local_replays              | 0                                            |
```

| cluster_posts_local_send_queue           | 0                                            |

| cluster_posts_local_send_queue_max       | 2                                            |

```sql
| cluster_posts_local_send_queue_min       | 0                                            |
| cluster_posts_local_send_queue_avg       | 0.500000                                     |
| cluster_posts_local_recv_queue           | 0                                            |
| cluster_posts_local_recv_queue_max       | 2                                            |
| cluster_posts_local_recv_queue_min       | 0                                            |
| cluster_posts_local_recv_queue_avg       | 0.500000                                     |
| cluster_posts_local_cached_downto        | 0                                            |
```

| cluster_posts_flow_control_paused_ns     | 0                                            |

| cluster_posts_flow_control_paused        | 0.000000                                     |

```sql
| cluster_posts_flow_control_sent          | 0                                            |
| cluster_posts_flow_control_recv          | 0                                            |
```

| cluster_posts_flow_control_interval      | [ 100, 100 ]                                 |

```sql
| cluster_posts_flow_control_interval_low  | 100                                          |
| cluster_posts_flow_control_interval_high | 100                                          |
| cluster_posts_flow_control_status        | OFF                                          |
| cluster_posts_cert_deps_distance         | 0.000000                                     |

| cluster_posts_apply_oooe                 | 0.000000                                     |

| cluster_posts_apply_oool                 | 0.000000                                     |
```

| cluster_posts_apply_window               | 0.000000                                     |

```sql
| cluster_posts_commit_oooe                | 0.000000                                     |
| cluster_posts_commit_oool                | 0.000000                                     |
| cluster_posts_commit_window              | 0.000000                                     |
| cluster_posts_local_state                | 4                                            |
| cluster_posts_local_state_comment        | Synced                                       |
| cluster_posts_cert_index_size            | 0                                            |
| cluster_posts_cert_bucket_count          | 2                                            |
| cluster_posts_gcache_pool_size           | 1320                                         |
| cluster_posts_causal_reads               | 0                                            |
| cluster_posts_cert_interval              | 0.000000                                     |
| cluster_posts_open_transactions          | 0                                            |
| cluster_posts_open_connections           | 0                                            |
| cluster_posts_ist_receive_status         |                                              |
| cluster_posts_ist_receive_seqno_start    | 0                                            |
| cluster_posts_ist_receive_seqno_current  | 0                                            |
| cluster_posts_ist_receive_seqno_end      | 0                                            |
| cluster_posts_incoming_addresses         | 127.0.0.1:9312,127.0.0.1:9350:replication    |
| cluster_posts_cluster_weight             | 1                                            |
| cluster_posts_desync_count               | 0                                            |
| cluster_posts_evs_delayed                |                                              |
| cluster_posts_evs_evict_list             |                                              |
| cluster_posts_evs_repl_latency           | 1.075e-06/7.957e-06/2.2911e-05/8.12112e-06/5 |
| cluster_posts_evs_state                  | OPERATIONAL                                  |
| cluster_posts_gcomm_uuid                 | 95b52441-c296-11e9-abae-52c260760909         |
+------------------------------------------+----------------------------------------------+
71 rows in set (0.00 sec)
Чтобы убедиться, что он действительно удалён везде, можно проверить статус другого узла:
`exit;`
MySQL [(none)]> SELECT * FROM testrt;
+------+------+
| id   | gid  |
+------+------+
|    1 |   10 |
+------+------+
1 row in set (0.10 sec)
`mysql -P 9306 -h0`
root@replication-5b59c59f5c-mkqfc:/# mysql -P 9306 -h0
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 3.1.0 445e806e@190716 release
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
`SHOW STATUS LIKE 'cluster%';`
MySQL [(none)]> SHOW STATUS LIKE 'cluster%';
+------------------------------------------+----------------------------------------------+
| Counter                                  | Value                                        |
+------------------------------------------+----------------------------------------------+
| cluster_name                             | posts                                        |
| cluster_posts_state_uuid                 | 95c2ffc3-c296-11e9-b475-9fad1c2e6dab         |
| cluster_posts_conf_id                    | 1                                            |
| cluster_posts_status                     | primary                                      |
| cluster_posts_size                       | 1                                            |
| cluster_posts_local_index                | 0                                            |
| cluster_posts_node_state                 | synced                                       |
| cluster_posts_nodes_set                  |                                              |
| cluster_posts_nodes_view                 | 127.0.0.1:9312,127.0.0.1:9350:replication    |
| cluster_posts_indexes_count              | 0                                            |
| cluster_posts_indexes                    |                                              |
| cluster_posts_local_state_uuid           | 95c2ffc3-c296-11e9-b475-9fad1c2e6dab         |
| cluster_posts_protocol_version           | 9                                            |
| cluster_posts_last_applied               | 0                                            |
| cluster_posts_last_committed             | 0                                            |
| cluster_posts_replicated                 | 0                                            |
| cluster_posts_replicated_bytes           | 0                                            |
| cluster_posts_repl_keys                  | 0                                            |
| cluster_posts_repl_keys_bytes            | 0                                            |
| cluster_posts_repl_data_bytes            | 0                                            |
| cluster_posts_repl_other_bytes           | 0                                            |
| cluster_posts_received                   | 2                                            |
| cluster_posts_received_bytes             | 175                                          |
| cluster_posts_local_commits              | 0                                            |
| cluster_posts_local_cert_failures        | 0                                            |
| cluster_posts_local_replays              | 0                                            |
| cluster_posts_local_send_queue           | 0                                            |
| cluster_posts_local_send_queue_max       | 2                                            |
| cluster_posts_local_send_queue_min       | 0                                            |
| cluster_posts_local_send_queue_avg       | 0.500000                                     |

```


| cluster_posts_local_recv_queue           | 0                                            |

| cluster_posts_local_recv_queue_max       | 2                                            |

| cluster_posts_local_recv_queue_min       | 0                                            |
