# Introduction in replication course

在本教程中，我们将学习Manticore Search中复制的基础知识。

### 简要介绍复制

Manticore搜索守护进程可以将写事务复制到集群中的其他节点，用于实时或Percolate索引。
*您可以在这里尝试* *[here](https://play.manticoresearch.com/replication/)* *或阅读下面的内容。*

要使用守护进程进行复制，您需要确保：
- 您的构建支持复制（在Manticore官方构建中默认启用 - <https://manticoresearch.com/downloads/>）
- 在searchd部分的配置中设置data_dir选项。这是存储传入索引的位置
- 为复制协议设置listen选项，每个集群至少使用两个端口范围
- 为SphinxAPI协议设置listen选项
- 为SphinxQL协议设置listen选项（用于执行集群操作语句）
- 可选地设置server_id选项。值必须在集群中唯一。如果未设置，server_ids将自动生成

您可以查看用于此演示的Manticore配置示例：


`cat /etc/sphinxsearch/sphinx1.conf`

```ini
index pq {
  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搜索守护进程实例，分别使用不同的端口（9306和9307），以代表我们未来集群中的两个节点。另一个的配置是：

`cat /etc/sphinxsearch/sphinx2.conf`

```ini
  searchd {
  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
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.
```

并创建一个新的集群。

## 创建新集群

`CREATE CLUSTER posts;`

```sql
MySQL [(none)]> CREATE CLUSTER posts;
Query OK, 0 rows affected (0.90 sec)
```

要确保集群已成功创建，请使用**SHOW STATUS**命令：

`SHOW STATUS LIKE 'cluster%';`

```sql
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                                            |
| 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);`

```sql
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;`

```sql
MySQL [(none)]> SELECT * FROM testrt;
+------+------+
| id   | gid  |
+------+------+
|    1 |   10 |
+------+------+
1 row in set (0.10 sec)
```

请注意，所有旨在更改集群中索引的写操作语句（如**INSERT**、**REPLACE**、**DELETE**、**TRUNCATE**）必须使用**cluster_name:index_name**格式而不是纯**index_name**，以确保更改传播到集群中的所有副本。否则将触发错误（见下文）。但直到索引加入集群之前，您可以不带任何前缀插入数据：

`INSERT INTO testrt VALUES(2,'List of Dell business laptops','Latitude Precision Vostro',10);`

```sql
MySQL [(none)]> INSERT INTO testrt VALUES(2,'List of Dell business laptops','Latitude Precision Vostro',10);
Query OK, 1 row affected (0.00 sec)
```

当您尝试将文档插入到集群中的索引时，需要在索引名称前加上集群名称：

`INSERT INTO posts:testrt VALUES(3,'List of Dell business laptops','Latitude Precision Vostro',10);`

```sql
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;`

```sql
MySQL [(none)]> ALTER CLUSTER posts ADD testrt;
Query OK, 0 rows affected (0.10 sec)
```
我们的**testrt**索引现在在集群中，可以通过查看**cluster_posts_indexes**状态字段来确认（**posts**是我们集群的名称）。

`SHOW STATUS LIKE 'cluster_posts_indexes';`

```sql
MySQL [(none)]> SHOW STATUS LIKE 'cluster_posts_indexes';
+-----------------------+--------+
| Counter               | Value  |
+-----------------------+--------+
| cluster_posts_indexes | testrt |
+-----------------------+--------+
1 row in set (0.00 sec)
```

让我们向我们的**testrt**索引插入更多数据：

`INSERT INTO testrt VALUES(3,'List of Dell business laptops','Latitude Precision Vostro',10);`

```sql
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'
```

现在我们看到错误，因为正确的查询是：

`INSERT INTO posts:testrt VALUES(3,'List of Dell business laptops','Latitude Precision Vostro',10);`

```sql
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;`

```sql
MySQL [(none)]> SELECT * FROM testrt;
+------+------+
| id   | gid  |
+------+------+
|    1 |   10 |
+------+------+
1 row in set (0.10 sec)
```

## 将节点加入集群

---

让我们去另一个节点。

`exit;`

```sql
MySQL [(none)]> exit;
Bye
```

`mysql -P 9307 -h0`

```sql
root@replication-5b59c59f5c-mkqfc:/# mysql -P 9307 -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.
```

我们知道这个节点尚未加入我们的集群，因此它不包含我们在另一个节点上之前添加到**testrt**索引中的任何数据。甚至没有**testrt**索引


`SELECT * FROM testrt;`

```sql
MySQL [(none)]> SELECT * FROM testrt;
+------+------+
| id   | gid  |
+------+------+
|    1 |   10 |
+------+------+
1 row in set (0.10 sec)
```

让我们加入集群。为此，请使用**JOIN CLUSTER**语句。您需要指定集群名称（因为可能有多个集群）和要连接的节点：


`JOIN CLUSTER posts at '127.0.0.1:9312';`

```sql
MySQL [(none)]> JOIN CLUSTER posts at '127.0.0.1:9312';
Query OK, 0 rows affected (1.90 sec)
```

现在让我们再试一次：

`SELECT * FROM testrt;`

```sql
MySQL [(none)]> SELECT * FROM testrt;
+------+------+
| 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);`

```sql
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)
```

`SELECT * FROM testrt;`

```sql
MySQL [(none)]> SELECT * FROM testrt;
+------+------+
| id   | gid  |
+------+------+
|    1 |   10 |
+------+------+
1 row in set (0.10 sec)
```

现在切换回我们的第一个节点：

`exit;`

```sql
MySQL [(none)]> exit;
Bye
```

`mysql -P 9306 -h0`

```sql
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.
```

`SELECT * FROM testrt;`

```sql
MySQL [(none)]> SELECT * FROM testrt;
+------+------+
| id   | gid  |
+------+------+
|    1 |   10 |
+------+------+
1 row in set (0.10 sec)
```

正如我们所见，更改已成功复制。

## 删除集群索引和集群

---


现在我们将索引从集群中删除：

`ALTER CLUSTER posts DROP testrt;`

```sql
MySQL [(none)]> ALTER CLUSTER posts DROP testrt;
Query OK, 0 rows affected (0.00 sec)
```

`SHOW STATUS LIKE 'cluster_posts_indexes';`

```sql
MySQL [(none)]> SHOW STATUS LIKE 'cluster_posts_indexes';
+-----------------------+--------+
| Counter               | Value  |
+-----------------------+--------+
| cluster_posts_indexes | testrt |
+-----------------------+--------+
1 row in set (0.00 sec)

```

成功了！


` SELECT * from testrt;`



```sql
MySQL [(none)]> SELECT * from testrt;
+------+------+
| id   | gid  |
+------+------+
|    1 |   10 |
|    2 |   10 |
|    3 |   10 |
|    4 |   20 |
+------+------+
4 rows in set (0.00 sec)

```
**testrt**索引已成为一个本地非复制索引。让我们确认这一点：

` INSERT INTO testrt VALUES(5,'Lenovo laptops list','Yoga IdeaPad',30);`

```sql
MySQL [(none)]> INSERT INTO testrt VALUES(5,'Lenovo laptops list','Yoga  IdeaPad',30);
Query OK, 1 row affected (0.00 sec)
```

没有关于缺少'posts:'的警告，因此'testrt'不再在集群中。


`SELECT * from testrt;`

```sql
MySQL [(none)]> SELECT * from testrt;
+------+------+
| id   | gid  |
+------+------+
|    1 |   10 |
|    2 |   10 |
|    3 |   10 |
|    4 |   20 |
+------+------+
4 rows in set (0.00 sec)

```

让我们切换到我们的第二个节点：

`exit;`

```sql
MySQL [(none)]> exit;
Bye
```

`mysql -P 9307 -h0`

```sql
root@replication-5b59c59f5c-mkqfc:/# mysql -P 9307 -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.
```

`SELECT * from testrt;`

```sql
MySQL [(none)]> SELECT * from testrt;
+------+------+
| id   | gid  |
+------+------+
|    1 |   10 |
|    2 |   10 |
|    3 |   10 |
|    4 |   20 |
+------+------+
4 rows in set (0.00 sec)
```

正如预期，我们在第一个节点上所做的更改未复制到第二个节点。

要完全删除集群，请使用**DELETE CLUSTER**语句：


`DELETE CLUSTER posts;`

```sql
MySQL [(none)]> DELETE CLUSTER posts;
Query OK, 0 rows affected (6.20 sec)
```

`SHOW STATUS LIKE 'cluster%';`

```sql
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                                            |
| 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;`

```sql
MySQL [(none)]> SELECT * FROM testrt;
+------+------+
| id   | gid  |
+------+------+
|    1 |   10 |
+------+------+
1 row in set (0.10 sec)
```

为了确保它确实从所有地方删除，我们可以检查另一个节点的状态：

`exit;`

```sql
MySQL [(none)]> exit;
Bye
```

`mysql -P 9306 -h0`

```sql
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%';`

```sql
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                                            |
| 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)

```


我们看到集群**posts**在这里也不存在。

感谢阅读！

本文已经为您介绍了Manticore Search中的复制功能以及可以用来搭建简单集群的基本命令。
