gpt4 book ai didi

mysql - Galera mysql集群在Kubernetes中启动失败

转载 作者:行者123 更新时间:2023-11-29 16:48:21 26 4
gpt4 key购买 nike

好吧,我正在使用此存储库的修改版本:https://github.com/CaptTofu/mysql_replication_kubernetes/tree/master/galera_sync_replication

修改后的文件是:

服务:

apiVersion: v1
kind: Service
metadata:
name: ro-db


labels:
unit: pxc-cluster
spec:
ports:
- port: 3306
name: mysql
selector:
unit: pxc-cluster

pxc1,它与 2 和 3 相同的复制 Controller 、发现服务和持久卷声明,只是更改数字

apiVersion: v1
kind: Service
metadata:
name: pxc-node1
labels:
node: pxc-node1
spec:
ports:
- port: 3306
name: mysql
- port: 4444
name: state-snapshot-transfer
- port: 4567
name: replication-traffic
- port: 4568
name: incremental-state-transfer
selector:
node: pxc-node1
---
apiVersion: v1
kind: ReplicationController
metadata:
name: pxc-node1
spec:
replicas: 1
template:
metadata:
labels:
node: pxc-node1
unit: pxc-cluster
spec:
nodeSelector:
number: '1'

containers:
- image: capttofu/percona_xtradb_cluster_5_6:beta
name: pxc-node1
ports:
- containerPort: 3306
- containerPort: 4444
- containerPort: 4567
- containerPort: 4568
env:
- name: GALERA_CLUSTER
value: "true"
- name: WRSEP_ON
value: "true"
- name: WSREP_CLUSTER_ADDRESS
value: gcomm://
- name: WSREP_SST_USER
value: sst
- name: WSREP_SST_PASSWORD
value: sst
- name: MYSQL_USER
value: mysql
- name: MYSQL_PASSWORD
value: mysql
- name: MYSQL_ROOT_PASSWORD
value: c-krit
volumeMounts:
- name: mysql-persistent-storage-1
mountPath: /var/lib
securityContext:
capabilities: {}
privileged: true #privileged required for mount
volumes:
- name: mysql-persistent-storage-1
persistentVolumeClaim:
claimName: claim-galera-1
---

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: claim-galera-1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 4Gi
selector:
matchLabels:
name: pxc1

事情是它在几天前工作,并进行了大量测试,关闭 Pod、节点,看看复制投票和一切工作如何,现在当我集成到应用程序时,它无法启动,我无法理解为什么如果它的配置相同,我在互联网、SO、GitHub 上查看了很多,并尝试了建议的修复,但不起作用。

2018-10-23 20:36:46 1 [Note] WSREP: (4be59ce1, 'tcp://0.0.0.0:4567') turning message relay requesting on, nonlive peers: tcp://10.244.2.61:4567 
2018-10-23 20:36:47 1 [Note] WSREP: forgetting 49c4d2cf (tcp://10.244.2.61:4567)
2018-10-23 20:36:47 1 [Note] WSREP: (4be59ce1, 'tcp://0.0.0.0:4567') turning message relay requesting off
2018-10-23 20:36:47 1 [Warning] WSREP: no nodes coming from prim view, prim not possible
2018-10-23 20:36:47 1 [Note] WSREP: view(view_id(NON_PRIM,4be59ce1,5) memb {
4be59ce1,0
} joined {
} left {
} partitioned {
47f2860c,0
49c4d2cf,0
})
2018-10-23 20:36:50 1 [Note] WSREP: view((empty))
2018-10-23 20:36:50 1 [ERROR] WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 (Connection timed out)
at gcomm/src/pc.cpp:connect():162
2018-10-23 20:36:50 1 [ERROR] WSREP: gcs/src/gcs_core.cpp:long int gcs_core_open(gcs_core_t*, const char*, const char*, bool)():206: Failed to open backend connection: -110 (Connection timed out)
2018-10-23 20:36:50 1 [ERROR] WSREP: gcs/src/gcs.cpp:long int gcs_open(gcs_conn_t*, const char*, const char*, bool)():1379: Failed to open channel 'galera_kubernetes' at 'gcomm://pxc-node2,pxc-node3': -110 (Connection timed out)
2018-10-23 20:36:50 1 [ERROR] WSREP: gcs connect failed: Connection timed out
2018-10-23 20:36:50 1 [ERROR] WSREP: wsrep::connect(gcomm://pxc-node2,pxc-node3) failed: 7
2018-10-23 20:36:50 1 [ERROR] Aborting

2018-10-23 20:36:50 1 [Note] WSREP: Service disconnected.
2018-10-23 20:36:51 1 [Note] WSREP: Some threads may fail to exit.
2018-10-23 20:36:51 1 [Note] Binlog end
2018-10-23 20:36:51 1 [Note] mysqld: Shutdown complete

有什么建议吗?已经几个小时了,但无法让它工作

最佳答案

Percona XtraDB Cluster 现在拥有对 Kubernetes 的原生支持。 PXC Operator 几周前发布了 GA 1.0。 https://percona.com/doc/kubernetes-operator-for-pxc/index.html

关于mysql - Galera mysql集群在Kubernetes中启动失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52969926/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com