Ubuntu 24.04
Sponsored Link

MariaDB 10.11 : Galera झुंड2024/05/17

 
MariaDB Galera क्लस्टर कॉन्फ़िगर करें।
इस मल्टी-मास्टर कॉन्फ़िगरेशन पर क्लस्टर के सभी नोड मास्टर-सर्वर बन जाते हैं।
[1]
[2] पहले नोड को निम्नानुसार कॉन्फ़िगर करें।
root@www:~#
systemctl stop mariadb

root@www:~#
vi /etc/mysql/mariadb.conf.d/50-server.cnf
# पंक्ति 27: टिप्पणी करें

#
bind-address = 127.0.0.1
# अंत में जोड़ें

[galera]
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://"
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
# किसी भी क्लस्टर का नाम
wsrep_cluster_name="MariaDB_Cluster"
# स्वयं का आईपी पता
wsrep_node_address="10.0.0.31"

root@www:~#
galera_new_cluster
root@www:~#
vi /etc/mysql/mariadb.conf.d/50-server.cnf
# वे नोड जोड़ें जिन्हें आप क्लस्टर में सेट करने की योजना बना रहे हैं

wsrep_cluster_address="gcomm://
10.0.0.31,10.0.0.51
"
[3] पहले नोड को छोड़कर अन्य नोड्स को कॉन्फ़िगर करें।
root@node01:~#
vi /etc/mysql/mariadb.conf.d/50-server.cnf
# पंक्ति 27: टिप्पणी करें

#
bind-address = 127.0.0.1
# अंत में जोड़ें

[galera]
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
# क्लस्टर में सभी नोड्स निर्दिष्ट करें
wsrep_cluster_address="gcomm://10.0.0.31,10.0.0.51"
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
# किसी भी क्लस्टर का नाम
wsrep_cluster_name="MariaDB_Cluster"
# इस होस्ट का IP पता निर्दिष्ट करें
wsrep_node_address="10.0.0.51"

root@node01:~#
systemctl restart mariadb

[4] ठीक है। सुनिश्चित करें कि स्थिति इस प्रकार है। यह ठीक है अगर [wsrep_local_state_comment] [Synced] है।
root@node01:~#
mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 36
Server version: 10.11.7-MariaDB-2ubuntu2 Ubuntu 24.04

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

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show status like 'wsrep_%'; 
+-------------------------------+-----------------------------------------------+
| Variable_name                 | Value                                         |
+-------------------------------+-----------------------------------------------+
| wsrep_local_state_uuid        | f1646e43-13eb-11ef-b242-ae968fea5afb          |
| wsrep_protocol_version        | 10                                            |
| wsrep_last_committed          | 2                                             |
| wsrep_replicated              | 0                                             |
| wsrep_replicated_bytes        | 0                                             |
| wsrep_repl_keys               | 0                                             |
| wsrep_repl_keys_bytes         | 0                                             |
| wsrep_repl_data_bytes         | 0                                             |
| wsrep_repl_other_bytes        | 0                                             |
| wsrep_received                | 3                                             |
| wsrep_received_bytes          | 232                                           |
| wsrep_local_commits           | 0                                             |
| wsrep_local_cert_failures     | 0                                             |
| wsrep_local_replays           | 0                                             |
| wsrep_local_send_queue        | 0                                             |
| wsrep_local_send_queue_max    | 1                                             |
| wsrep_local_send_queue_min    | 0                                             |
| wsrep_local_send_queue_avg    | 0                                             |
| wsrep_local_recv_queue        | 0                                             |
| wsrep_local_recv_queue_max    | 1                                             |
| wsrep_local_recv_queue_min    | 0                                             |
| wsrep_local_recv_queue_avg    | 0                                             |
| wsrep_local_cached_downto     | 2                                             |
| wsrep_flow_control_paused_ns  | 0                                             |
| wsrep_flow_control_paused     | 0                                             |
| wsrep_flow_control_sent       | 0                                             |
| wsrep_flow_control_recv       | 0                                             |
| wsrep_flow_control_active     | false                                         |
| wsrep_flow_control_requested  | false                                         |
| wsrep_cert_deps_distance      | 0                                             |
| wsrep_apply_oooe              | 0                                             |
| wsrep_apply_oool              | 0                                             |
| wsrep_apply_window            | 0                                             |
| wsrep_apply_waits             | 0                                             |
| wsrep_commit_oooe             | 0                                             |
| wsrep_commit_oool             | 0                                             |
| wsrep_commit_window           | 0                                             |
| wsrep_local_state             | 4                                             |
| wsrep_local_state_comment     | Synced                                        |
| wsrep_cert_index_size         | 0                                             |
| wsrep_causal_reads            | 0                                             |
| wsrep_cert_interval           | 0                                             |
| wsrep_open_transactions       | 0                                             |
| wsrep_open_connections        | 0                                             |
| wsrep_incoming_addresses      | 10.0.0.51:0,10.0.0.31:0                       |
| wsrep_cluster_weight          | 2                                             |
| wsrep_desync_count            | 0                                             |
| wsrep_evs_delayed             |                                               |
| wsrep_evs_evict_list          |                                               |
| wsrep_evs_repl_latency        | 0/0/0/0/0                                     |
| wsrep_evs_state               | OPERATIONAL                                   |
| wsrep_gcomm_uuid              | 18690dfa-13ec-11ef-a7f4-97efe964a77f          |
| wsrep_gmcast_segment          | 0                                             |
| wsrep_applier_thread_count    | 1                                             |
| wsrep_cluster_capabilities    |                                               |
| wsrep_cluster_conf_id         | 2                                             |
| wsrep_cluster_size            | 2                                             |
| wsrep_cluster_state_uuid      | f1646e43-13eb-11ef-b242-ae968fea5afb          |
| wsrep_cluster_status          | Primary                                       |
| wsrep_connected               | ON                                            |
| wsrep_local_bf_aborts         | 0                                             |
| wsrep_local_index             | 0                                             |
| wsrep_provider_capabilities   | :MULTI_MASTER:CERTIFICATION:PARALLEL_APP..... |
| wsrep_provider_name           | Galera                                        |
| wsrep_provider_vendor         | Codership Oy <info@codership.com>             |
| wsrep_provider_version        | 4.16(rc333b191)                               |
| wsrep_ready                   | ON                                            |
| wsrep_rollbacker_thread_count | 1                                             |
| wsrep_thread_count            | 2                                             |
+-------------------------------+-----------------------------------------------+
69 rows in set (0.001 sec)
मिलान सामग्री