programing

MariaDB Galera 클러스터가 동기화되고 있지 않습니다.

megabox 2023. 10. 26. 20:56
반응형

MariaDB Galera 클러스터가 동기화되고 있지 않습니다.

이전에 MariaDB Cluster를 배포한 적이 있는데, 이 문제는 최근에 와서야 나타납니다(이전에는 이 문제가 없었고 이유도 모르겠습니다).

서버 1,2,3이 있습니다.서버 3에서 INSERT 명령을 실행했지만 서버 1과 2의 테이블은 변경되지 않습니다.

3대의 서버가 세계 각지에 있습니다.After the INSERT command, the state uuid remains the same.

서버 1의 상태는 다음과 같습니다.
MariaDB [mysql]> show status like 'wsrep_%'; +------------------------------+----------------------------------------------------------+ | Variable_name | Value | +------------------------------+----------------------------------------------------------+ | wsrep_local_state_uuid | c4f9e2e2-fee1-11e5-8648-a22b867b5a6e | | wsrep_protocol_version | 7 | | wsrep_last_committed | 205 | | wsrep_replicated | 170 | | wsrep_replicated_bytes | 160481 | | wsrep_repl_keys | 664 | | wsrep_repl_keys_bytes | 9222 | | wsrep_repl_data_bytes | 140379 | | wsrep_repl_other_bytes | 0 | | wsrep_received | 46 | | wsrep_received_bytes | 26150 | | wsrep_local_commits | 170 | | wsrep_local_cert_failures | 0 | | wsrep_local_replays | 1 | | wsrep_local_send_queue | 0 | | wsrep_local_send_queue_max | 1 | | wsrep_local_send_queue_min | 0 | | wsrep_local_send_queue_avg | 0.000000 | | wsrep_local_recv_queue | 0 | | wsrep_local_recv_queue_max | 1 | | wsrep_local_recv_queue_min | 0 | | wsrep_local_recv_queue_avg | 0.000000 | | wsrep_local_cached_downto | 1 | | wsrep_flow_control_paused_ns | 0 | | wsrep_flow_control_paused | 0.000000 | | wsrep_flow_control_sent | 0 | | wsrep_flow_control_recv | 0 | | wsrep_cert_deps_distance | 7.482927 | | wsrep_apply_oooe | 0.009756 | | wsrep_apply_oool | 0.000000 | | wsrep_apply_window | 1.009756 | | wsrep_commit_oooe | 0.000000 | | wsrep_commit_oool | 0.000000 | | wsrep_commit_window | 1.000000 | | wsrep_local_state | 4 | | wsrep_local_state_comment | Synced | | wsrep_cert_index_size | 28 | | wsrep_causal_reads | 0 | | wsrep_cert_interval | 0.009756 | | wsrep_incoming_addresses | server1:3306,server2:3306,server3:3306 | | wsrep_evs_delayed | | | wsrep_evs_evict_list | | | wsrep_evs_repl_latency | 0.200155/0.201113/0.201752/0.000614937/4 | | wsrep_evs_state | OPERATIONAL | | wsrep_gcomm_uuid | c4f91b4f-fee1-11e5-8c4f-6e451c332f79 | | wsrep_cluster_conf_id | 3 | | wsrep_cluster_size | 3 | | wsrep_cluster_state_uuid | c4f9e2e2-fee1-11e5-8648-a22b867b5a6e | | wsrep_cluster_status | Primary | | wsrep_connected | ON | | wsrep_local_bf_aborts | 6 | | wsrep_local_index | 0 | | wsrep_provider_name | Galera | | wsrep_provider_vendor | Codership Oy <info@codership.com> | | wsrep_provider_version | 25.3.14(r3560) | | wsrep_ready | ON | | wsrep_thread_count | 2 | +------------------------------+----------------------------------------------------------+

서버 2의 상태:
MariaDB [(none)]> show status like 'wsrep_%'; +------------------------------+----------------------------------------------------------+ | Variable_name | Value | +------------------------------+----------------------------------------------------------+ | wsrep_local_state_uuid | c4f9e2e2-fee1-11e5-8648-a22b867b5a6e | | wsrep_protocol_version | 7 | | wsrep_last_committed | 225 | | wsrep_replicated | 35 | | wsrep_replicated_bytes | 25700 | | wsrep_repl_keys | 119 | | wsrep_repl_keys_bytes | 1757 | | wsrep_repl_data_bytes | 21703 | | wsrep_repl_other_bytes | 0 | | wsrep_received | 187 | | wsrep_received_bytes | 177793 | | wsrep_local_commits | 35 | | wsrep_local_cert_failures | 0 | | wsrep_local_replays | 1 | | wsrep_local_send_queue | 0 | | wsrep_local_send_queue_max | 1 | | wsrep_local_send_queue_min | 0 | | wsrep_local_send_queue_avg | 0.000000 | | wsrep_local_recv_queue | 0 | | wsrep_local_recv_queue_max | 4 | | wsrep_local_recv_queue_min | 0 | | wsrep_local_recv_queue_avg | 0.032086 | | wsrep_local_cached_downto | 9 | | wsrep_flow_control_paused_ns | 0 | | wsrep_flow_control_paused | 0.000000 | | wsrep_flow_control_sent | 0 | | wsrep_flow_control_recv | 0 | | wsrep_cert_deps_distance | 7.193548 | | wsrep_apply_oooe | 0.004630 | | wsrep_apply_oool | 0.000000 | | wsrep_apply_window | 1.004630 | | wsrep_commit_oooe | 0.000000 | | wsrep_commit_oool | 0.000000 | | wsrep_commit_window | 1.000000 | | wsrep_local_state | 4 | | wsrep_local_state_comment | Synced | | wsrep_cert_index_size | 28 | | wsrep_causal_reads | 0 | | wsrep_cert_interval | 0.009217 | | wsrep_incoming_addresses | server1:3306,server2:3306,server3:3306 | | wsrep_evs_delayed | | | wsrep_evs_evict_list | | | wsrep_evs_repl_latency | 0.200138/0.201917/0.203696/0.00177914/2 | | wsrep_evs_state | OPERATIONAL | | wsrep_gcomm_uuid | d562e272-fee1-11e5-b2a2-d3a6b5579aab | | wsrep_cluster_conf_id | 3 | | wsrep_cluster_size | 3 | | wsrep_cluster_state_uuid | c4f9e2e2-fee1-11e5-8648-a22b867b5a6e | | wsrep_cluster_status | Primary | | wsrep_connected | ON | | wsrep_local_bf_aborts | 0 | | wsrep_local_index | 1 | | wsrep_provider_name | Galera | | wsrep_provider_vendor | Codership Oy <info@codership.com> | | wsrep_provider_version | 25.3.14(r3560) | | wsrep_ready | ON | | wsrep_thread_count | 2 | +------------------------------+----------------------------------------------------------+ 57 rows in set (0.01 sec)

서버 상태3 (보시는 것처럼 대기 시간이 모두 0으로 표시되는데 왜 그런지 모르겠습니다)
MariaDB [(none)]> show status like 'wsrep_%'; +------------------------------+----------------------------------------------------------+ | Variable_name | Value | +------------------------------+----------------------------------------------------------+ | wsrep_local_state_uuid | c4f9e2e2-fee1-11e5-8648-a22b867b5a6e | | wsrep_protocol_version | 7 | | wsrep_last_committed | 245 | | wsrep_replicated | 5 | | wsrep_replicated_bytes | 4350 | | wsrep_repl_keys | 11 | | wsrep_repl_keys_bytes | 203 | | wsrep_repl_data_bytes | 3827 | | wsrep_repl_other_bytes | 0 | | wsrep_received | 226 | | wsrep_received_bytes | 208559 | | wsrep_local_commits | 1 | | 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.000000 | | wsrep_local_recv_queue | 0 | | wsrep_local_recv_queue_max | 1 | | wsrep_local_recv_queue_min | 0 | | wsrep_local_recv_queue_avg | 0.000000 | | wsrep_local_cached_downto | 19 | | wsrep_flow_control_paused_ns | 0 | | wsrep_flow_control_paused | 0.000000 | | wsrep_flow_control_sent | 0 | | wsrep_flow_control_recv | 0 | | wsrep_cert_deps_distance | 7.022026 | | wsrep_apply_oooe | 0.000000 | | wsrep_apply_oool | 0.000000 | | wsrep_apply_window | 1.000000 | | wsrep_commit_oooe | 0.000000 | | wsrep_commit_oool | 0.000000 | | wsrep_commit_window | 1.000000 | | wsrep_local_state | 4 | | wsrep_local_state_comment | Synced | | wsrep_cert_index_size | 28 | | wsrep_causal_reads | 0 | | wsrep_cert_interval | 0.008811 | | wsrep_incoming_addresses | server1:3306,server2:3306,server3:3306 | | wsrep_evs_delayed | | | wsrep_evs_evict_list | | | wsrep_evs_repl_latency | 0/0/0/0/0 | | wsrep_evs_state | OPERATIONAL | | wsrep_gcomm_uuid | fd022144-fee1-11e5-a7a3-f23274fef9c3 | | wsrep_cluster_conf_id | 3 | | wsrep_cluster_size | 3 | | wsrep_cluster_state_uuid | c4f9e2e2-fee1-11e5-8648-a22b867b5a6e | | wsrep_cluster_status | Primary | | wsrep_connected | ON | | wsrep_local_bf_aborts | 0 | | wsrep_local_index | 2 | | wsrep_provider_name | Galera | | wsrep_provider_vendor | Codership Oy <info@codership.com> | | wsrep_provider_version | 25.3.14(r3560) | | wsrep_ready | ON | | wsrep_thread_count | 2 | +------------------------------+----------------------------------------------------------+ 57 rows in set (0.00 sec)

모든 입력 및 출력 트래픽을 허용하도록 세 서버의 ipt 테이블이 설정되어 있습니다.

로그에는 모든 서버가 클러스터에 가입 및 동기화되었음이 표시됩니다.

왜 그런지 아는 사람?감사해요.

MyISAM을 스토리지 엔진으로 사용하는 앱의 문제가 오류를 유발한다는 것을 알게 되었습니다.InnoDB로 다시 변경 후 오류가 발생하지 않습니다.

테이블 엔진을 확인하는 것을 제안합니다, 왜냐하면 Galera 클러스터는 MyISAM이 아닌 InnoDB 엔진을 지원하기 때문입니다.

MyISAM 테이블을 사용하여 Mysql 데이터베이스를 Galera 및 InnoDB로 마이그레이션하는 쉬운 방법은 다음과 같습니다.

  1. db 스키마에 InnoDB 엔진이 지원하지 않는 FULLTEXT 인덱스나 다른 구성이 포함되어 있지 않은지 확인합니다.
  2. 데이터베이스 덤프 스키마
  3. 덤프 문자열 "MYISAM"을 "INNODB"로 바꿉니다.
  4. 데이터 덤프
  5. Galera Cluster에서 db 사용자 준비(mysql.user 테이블은 클러스터 간에 복제되지 않으므로 각 mariadb 서버에 db 사용자를 삽입해야 함)
  6. 스키마 가져오기(nodb 엔진 포함)
  7. 데이터가져오기
  8. 덤프 파일 정리

https://support.qualityunit.com/718375-Migrate-MySQL-Database-with-Myisam-engine-to-MariaDB-Galera-Cluster 에서 보내준 감사합니다.

언급URL : https://stackoverflow.com/questions/36526633/mariadb-galera-cluster-is-not-syncing

반응형