Galera MySQL群集无法在Kubernetes中启动

时间:2018-10-24 13:11:34

标签: mysql docker kubernetes percona-xtradb-cluster

好的,所以我正在使用此仓库的修订版:https://github.com/CaptTofu/mysql_replication_kubernetes/tree/master/galera_sync_replication

修改后的文件是:

服务:

SELECT
*
FROM
  `wehco-bi.64884663.ga_sessions_20180928` AS GA, UNNEST(hits) AS hits
  <br/>LEFT JOIN `wehco-bi.BlueConic.ao` AS BC
  <br/>ON GA.customDimensions.index.3 = BC.bc_profile_id
<br/>LIMIT 100

pxc1,其相同的复制控制器,用于2和3的发现和持久卷声明服务,只是更改了数字

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


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

几天前它正在运行,并且进行了很多测试,测试了Pod,节点的运行情况,并查看了复制投票的工作方式以及所有工作情况,现在,当我集成到应用程序时,它就不会启动,我不明白为什么它的配置仍然有效,为什么我在Internet,SO,GitHub上查看了很多内容,并尝试了建议的修复程序,但无法正常工作。

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

有什么建议吗?现在已经几个小时了,只是无法正常工作

1 个答案:

答案 0 :(得分:0)

Percona XtraDB Cluster现在具有对Kubernetes的本地支持。 PXC运营商几周前发布了GA 1.0。 https://percona.com/doc/kubernetes-operator-for-pxc/index.html