programing

MariaDB gcomm 백엔드 연결 실패 110

randomtip 2022. 12. 21. 22:59
반응형

MariaDB gcomm 백엔드 연결 실패 110

데비안 8 제시의 마리아DB 갤러라 10.1을 구하려고 합니다.

필요한 컴포넌트를 모두 설치하고 구성했지만 동작하지 않습니다.

노드는 VPS로 구축됩니다.

노드 1의 설정:

[mysqld]

# Cluster node configurations
wsrep_cluster_address="gcomm://172.16.0.102,172.16.0.112"
wsrep_node_address="172.16.0.102"
wsrep_node_name='n1' 
wsrep_cluster_name='cluster'
innodb_buffer_pool_size=400M
# Mandatory settings to enable Galera
wsrep_provider=/usr/lib/galera/libgalera_smm.so
binlog_format=ROW
default-storage-engine=InnoDB
innodb_autoinc_lock_mode=2
innodb_doublewrite=1
query_cache_size=0
bind-address=0.0.0.0
# Galera synchronisation configuration
wsrep_sst_method=rsync

노드 2의 설정:

[mysqld]

# Cluster node configurations
wsrep_cluster_address="gcomm://172.16.0.102,172.16.0.112"
wsrep_node_address="172.16.0.112"
wsrep_node_name='n2' 
wsrep_cluster_name='cluster'
innodb_buffer_pool_size=400M
# Mandatory settings to enable Galera
wsrep_provider=/usr/lib/galera/libgalera_smm.so
binlog_format=ROW
default-storage-engine=InnoDB
innodb_autoinc_lock_mode=2
innodb_doublewrite=1
query_cache_size=0
bind-address=0.0.0.0
# Galera synchronisation configuration
wsrep_sst_method=rsync

node 1 부트스트랩명령어로 실행하려고 할 때

service mysql bootstrap

에러에 의해 에러가 발생.

May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28  139843152635840 [ERROR] WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 (Connection timed out)
May 13 15:59:28 test mysqld[2397]: at gcomm/src/pc.cpp:connect():162
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -110 (Connection timed out) 
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1379: Failed to open channel 'cluster' at 'gcomm://172.16.0.102,172.16.0.112': -110 (Connection timed out)
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: gcs connect failed: Connection timed out
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: wsrep::connect(gcomm://172.16.0.102,172.16.0.112) failed: 7
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] Aborting

사용하고 있는 네트워크 설정은 프라이빗입니다.

ProxmoxVE 4.0과 함께 설치된 2x 전용 서버는 vRack 네트워크에 포함되어 있으며 VPS에서는 다음과 같이 구성되어 있습니다.

node1: 172.16.0.102 //node 1은 서버1 위에 있습니다

node2: 172.16.0.112 //node 2는 서버2에 있습니다.

개인 네트워크에서 서로 핑을 돌릴 수 있어요

MariaDB 10.1.8 이후 systemd는 새로운 init으로 Galera가 RPM 및 Debian 기반의 Linux 디스트리뷰션(내 경우 Ubuntu 16.04)에서 부트스트랩되는 방식에 영향을 줍니다.이전 버전에서는 다음과 같은 기능을 사용합니다.service mysql start --wsrep-new-cluster또는service mysqld bootstrap그러나 다음과 같이 실패하기 때문에 더 이상 작동하지 않습니다.

[ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -110 (Connection timed out)

이 문제를 해결하려면 다음을 수행합니다.

galera_new_cluster

이 스크립트는 '첫 번째' 서버에서만 실행해야 합니다.

실행 중인지 테스트하려면 mysql을 입력합니다.mysql -u [your mysql user] -p그리고 나서 달려라

SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';

다음과 같은 것이 표시됩니다.

+--------------+
| cluster size |
+--------------+
| 1            |
+--------------+

my.conf (MariaDB 10.1.16) 입니다.

[galera]
# Mandatory settings
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://[first ip],[second ip]"
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2

자세한 내용은 이쪽:

MariaDB systemd 및 galera_new_cluster

Galera 클러스터 시스템 변수

나는 해결책과 정확한 문제를 찾았다.

클러스터 노드를 시작하는 동안 문제가 발생했습니다.MariaDB 설치 시 포함된 스크립트부터 시작해야 합니다.galera_new_cluster새로운 클러스터를 부트스트랩하고 그 이후에는 모든 것이 정상적으로 동작합니다.

이것이 다른 사람에게 debian 하에서 설정을 통과시키는 데 도움이 되기를 바랍니다.

이 에러는 있습니다만, 제 경우는galera_new_cluster동작하지 않습니다.

편집으로 해결된 문제/var/lib/mysql/grastate.dat파일링 및 변경safe_to_bootstrap1로 설정합니다.

하고 나서galera_new_cluster작동하다.

이 경우 모든 것이 올바르게 설정되어 있으며, 이 에러는 MariaDB 포트를 차단하고 있는 방화벽에 의해 발생하였습니다.모든 서버에서 허용하여 수정했습니다.

ufw allow 3306,4567,4568,4444/tcp;
ufw allow 4567/udp;

그 주제는 이미 꽤 오래되었다는 것을 알고 있다.Kubernetes mariadb 클러스터를 설치하려고 했는데 그 문제가 발생했습니다.정보를 복사해야 했습니다.grastate.dat하나의 노드에서 다음 노드로 이동합니다.cat grastate.dat이 포함된 단일 형식 노드 1을 표시하고 UUID를 사용하지 않고 다음 노드에 모든 것을 복사해야 했습니다.이 파일을 실행하면 다음과 같이 표시됩니다.

# GALERA saved state
version: 2.1
uuid:    
seqno:   -1
safe_to_bootstrap: 1

그런 다음 컨테이너를 저장하고 삭제합니다.재기동하면, 그 파일의 상세를 사용하고, 정상적으로 기동합니다.

언급URL : https://stackoverflow.com/questions/37212127/mariadb-gcomm-backend-connection-failed-110

반응형