blog-post

प्रतिनिधित्व पाठ्यक्रम में परिचय

इस ट्यूटोरियल में, हम मैन्टिकोर सर्च में प्रतिनिधित्व के मूलभूत सिद्धांतों का अध्ययन करेंगे।

प्रतिनिधित्व के बारे में संक्षेप में

मैन्टिकोर सर्च डेमोन एक लिखित लेन-देन को रियल-टाइम या पर्स्कोलेट इंडेक्स में क्लस्टर में अन्य नोड्स में पुन: प्रस्तुत कर सकता है।
आप इसे लाइव आज़मा सकते हैं यहाँ या नीचे पढ़ें।

डेमोन के साथ प्रतिनिधित्व का उपयोग करने के लिए, आपको यह सुनिश्चित करने की आवश्यकता है:

  • आपकी बिल्ड प्रतिनिधित्व का समर्थन करती है (मैन्टिकोर आधिकारिक बिल्ड में डिफ़ॉल्ट रूप से सक्रिय - https://manticoresearch.com/downloads/ )
  • कॉन्फ़िग में सर्चड सेक्शन में data_dir विकल्प सेट करें। यही वह जगह है जहाँ आने वाले इंडेक्स संग्रहीत होते हैं
  • प्रतिनिधित्व प्रोटोकॉल के लिए क्लस्टर प्रति कम से कम दो पोर्ट की एक श्रृंखला के साथ listen विकल्प सेट करें
  • SphinxAPI प्रोटोकॉल के लिए listen विकल्प सेट करें
  • SphinxQL प्रोटोकॉल के लिए listen विकल्प सेट करें (क्लस्टर संचालन विधान को निष्पादित करने के लिए)
  • वैकल्पिक रूप से server_id विकल्प सेट करें। मानों को क्लस्टर में अद्वितीय होना चाहिए। जब यह सेट नहीं होता है तो server_ids स्वचालित रूप से उत्पन्न होंगे

आप इस डेमो के लिए उपयोग किए गए मैन्टिकोर कॉन्फ़िग का उदाहरण देख सकते हैं:

cat /etc/sphinxsearch/sphinx1.conf

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
}

हमारे पास यहां विभिन्न पोर्ट (9306 और 9307) पर चलने वाले मैन्टिकोर सर्च डेमोन के दो उदाहरण हैं जो हमारे भविष्य के क्लस्टर में दो नोड्स का प्रतिनिधित्व करते हैं। दूसरे का कॉन्फ़िग है:

cat /etc/sphinxsearch/sphinx2.conf

  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

root@replication-5b59c59f5c-mkqfc:/# mysql -P 9306 -h0
MariaDB मॉनिटर में आपका स्वागत है।  आदेश ; या \g के साथ समाप्त होते हैं।
आपकी MySQL कनेक्शन आईडी 1 है
सर्वर संस्करण: 3.1.0 445e806e@190716 रिलीज़

कॉपीराइट (c) 2000, 2018, Oracle, MariaDB Corporation Ab और अन्य।

सहायता के लिए 'help;' या '\h' टाइप करें। वर्तमान इनपुट स्टेटमेंट को मिटाने के लिए '\c' टाइप करें।

और इसमें एक नया क्लस्टर बनाएं।

नया क्लस्टर बनाना

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                                        |
+------------------------------------------+----------------------------------------------+
| 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);

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)]> 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);

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

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 हमारे क्लस्टर का नाम है)।

SHOW STATUS LIKE 'cluster_posts_indexes';

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

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

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  |
+------+------+
|    1 |   10 |
+------+------+
1 row in set (0.10 sec)

एक नोड को क्लस्टर में जोड़ना


आइए हम एक अन्य नोड पर जाएँ जो हमारे पास है।

exit;

MySQL [(none)]> exit;
Bye

mysql -P 9307 -h0

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;

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';

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;
+------+------+
| 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)

SELECT * FROM testrt;

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

और अब हमारे पहले नोड पर वापस चलें:

exit;

MySQL [(none)]> exit;
Bye

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.

SELECT * FROM testrt;

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

जैसा कि हम देखते हैं, परिवर्तन सफलतापूर्वक प्रतिकृत किए गए थे।

क्लस्टर इंडेक्स और क्लस्टर्स को हटाना


अब हम अपने क्लस्टर से अपना इंडेक्स हटा देंगे:

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)]> SHOW STATUS LIKE 'cluster_posts_indexes';
+-----------------------+--------+
| Counter               | Value  |
+-----------------------+--------+
| cluster_posts_indexes | testrt |
+-----------------------+--------+
1 row in set (0.00 sec)

यह काम किया!

SELECT * from testrt;

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

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;

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

आइए हम अपने दूसरे नोड पर स्विच करें:

exit;

MySQL [(none)]> exit;
Bye

mysql -P 9307 -h0

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;

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

जैसा कि अपेक्षित था, पहले नोड पर किए गए परिवर्तन दूसरे नोड पर प्रतिकृत नहीं हुए।

To remove the cluster completely use DELETE CLUSTER statement:

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         |
| 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:प्रतिलिपि    |
| 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                  | कार्यात्मक                                  |
| cluster_posts_gcomm_uuid                 | 95b52441-c296-11e9-abae-52c260760909         |
+------------------------------------------+----------------------------------------------+
71 rows in set (0.00 sec)

क्लस्टर सभी नोड्स से हटा दिया गया है, लेकिन इसके इंडेक्स बिना किसी बदलाव के बने रहते हैं और साधारण स्थानीय गैर-प्रतिलिपि इंडेक्स बन जाते हैं।

SELECT * FROM testrt;

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

यह सुनिश्चित करने के लिए कि यह वास्तव में हर जगह से हटा दिया गया है, हम दूसरे नोड की स्थिति की जांच कर सकते हैं:

exit;

MySQL [(none)]> exit;
अलविदा

mysql -P 9306 -h0

root@replication-5b59c59f5c-mkqfc:/# mysql -P 9306 -h0
MariaDB मॉनिटर में आपका स्वागत है।  आदेश ; या \g से समाप्त होते हैं।
आपका MySQL कनेक्शन आईडी 1 है
सर्वर संस्करण: 3.1.0 445e806e@190716 रिलीज

कॉपीराइट (c) 2000, 2018, Oracle, MariaDB Corporation Ab और अन्य।

सहायता के लिए 'help;' या '\h' टाइप करें। वर्तमान इनपुट विवरण को साफ करने के लिए '\c' टाइप करें।

SHOW STATUS LIKE 'cluster%';

MySQL [(none)]> SHOW STATUS LIKE 'cluster%';
+------------------------------------------+----------------------------------------------+
| काउंटर                                  | मान                                         |
+------------------------------------------+----------------------------------------------+
| cluster_name                             | पोस्ट्स                                      |
| cluster_posts_state_uuid                 | 95c2ffc3-c296-11e9-b475-9fad1c2e6dab         |
| cluster_posts_conf_id                    | 1                                            |
| cluster_posts_status                     | प्राथमिक                                      |
| cluster_posts_size                       | 1                                            |
| cluster_posts_local_index                | 0                                            |
| cluster_posts_node_state                 | समन्वयित                                   |
| cluster_posts_nodes_set                  |                                              |
| cluster_posts_nodes_view                 | 127.0.0.1:9312,127.0.0.1:9350:प्रतिलिपि    |
| 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)

और हम देखते हैं कि क्लस्टर पोस्ट्स यहाँ भी मौजूद नहीं है।

आपके पढ़ने के लिए धन्यवाद!

इस लेख ने आपको मैटिकोर सर्च में दोहराव (Replication) का एक मूलभूत समझ प्रदान किया है और कौन-कौन से मौलिक आदेशों का उपयोग एक सरल क्लस्टर को सेटअप करने के लिए किया जा सकता है।

मैंटीकोर सर्च इंस्टॉल करें

मैंटीकोर सर्च इंस्टॉल करें