oracle / mysql-operator

Create, operate and scale self-healing MySQL clusters in Kubernetes
869 stars 235 forks source link

mysql-agent get cluster status failed #258

Open xjxia opened 5 years ago

xjxia commented 5 years ago

Is this a BUG REPORT or FEATURE REQUEST?

BUG REPORT

after helm install, kubectl create -f cluster.yaml,container mysql-agent work failed image

kubectl log my-app-db-0 -n jamxia -c mysql-agent|more
W0227 10:30:27.961852 136977 cmd.go:392] log is DEPRECATED and will be removed in a future version. Use logs instead. Starting mysql-agent version 0.3.0 I0226 09:32:59.777724 1 main.go:48] FLAG: --address="0.0.0.0" I0226 09:32:59.777764 1 main.go:48] FLAG: --alsologtostderr="false" I0226 09:32:59.777771 1 main.go:48] FLAG: --cluster-name="my-app-db" I0226 09:32:59.777776 1 main.go:48] FLAG: --healthcheck-port="10512" I0226 09:32:59.777783 1 main.go:48] FLAG: --hostname="my-app-db-0" I0226 09:32:59.777787 1 main.go:48] FLAG: --log-backtrace-at=":0" I0226 09:32:59.777795 1 main.go:48] FLAG: --log-dir="" I0226 09:32:59.777799 1 main.go:48] FLAG: --log-flush-frequency="5s" I0226 09:32:59.777806 1 main.go:48] FLAG: --logtostderr="true" I0226 09:32:59.777810 1 main.go:48] FLAG: --min-resync-period="12h0m0s" I0226 09:32:59.777815 1 main.go:48] FLAG: --namespace="jamxia" I0226 09:32:59.777819 1 main.go:48] FLAG: --stderrthreshold="2" I0226 09:32:59.777824 1 main.go:48] FLAG: --v="4" I0226 09:32:59.777828 1 main.go:48] FLAG: --vmodule="" I0226 09:32:59.784051 1 cluster_manager.go:116] Database not yet running. Waiting... E0226 09:33:11.821167 1 cluster_manager.go:126] Failed to get the cluster status: exit status 1 getting cluster status from group seeds github.com/oracle/mysql-operator/pkg/controllers/cluster/manager.(ClusterManager).getClusterStatus /go/src/github.com/oracle/mysql-operator/pkg/controllers/cluster/manager/cluster_manager.go:106 github.com/oracle/mysql-operator/pkg/controllers/cluster/manager.(ClusterManager).Sync /go/src/github.com/oracle/mysql-operator/pkg/controllers/cluster/manager/cluster_manager.go:122


kubectl log my-app-db-0 -n jamxia -c mysql

2019-02-26T09:33:08.664415Z 0 [Note] [MY-012922] [InnoDB] InnoDB: Waiting for purge to start 2019-02-26T09:33:08.717535Z 0 [Note] [MY-010182] [Server] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. 2019-02-26T09:33:08.717561Z 0 [Note] [MY-010304] [Server] Skipping generation of SSL certificates as certificate files are present in data directory. 2019-02-26T09:33:08.718246Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2019-02-26T09:33:08.718300Z 0 [Note] [MY-010308] [Server] Skipping generation of RSA key pair through --sha256_password_auto_generate_rsa_keys as key files are present in data directory. 2019-02-26T09:33:08.718311Z 0 [Note] [MY-010308] [Server] Skipping generation of RSA key pair through --caching_sha2_password_auto_generate_rsa_keys as key files are present in data directory. 2019-02-26T09:33:08.718599Z 0 [Note] [MY-010252] [Server] Server hostname (bind-address): '*'; port: 3306 2019-02-26T09:33:08.718640Z 0 [Note] [MY-010253] [Server] IPv6 is available. 2019-02-26T09:33:08.718655Z 0 [Note] [MY-010264] [Server] - '::' resolves to '::'; 2019-02-26T09:33:08.718706Z 0 [Note] [MY-010251] [Server] Server socket created on IP: '::'. 2019-02-26T09:33:08.728608Z 0 [Warning] [MY-010315] [Server] 'user' entry 'healthchecker@localhost' ignored in --skip-name-resolve mode. 2019-02-26T09:33:08.728633Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode. 2019-02-26T09:33:08.728647Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-02-26T09:33:08.728659Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-02-26T09:33:08.728671Z 0 [Warning] [MY-010315] [Server] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2019-02-26T09:33:08.728696Z 0 [Warning] [MY-010323] [Server] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-02-26T09:33:08.728706Z 0 [Warning] [MY-010323] [Server] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-02-26T09:33:08.728726Z 0 [Warning] [MY-010311] [Server] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2019-02-26T09:33:08.732267Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-02-26T09:33:08.732287Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-02-26T09:33:08.737794Z 4 [Note] [MY-010051] [Server] Event Scheduler: scheduler thread started with id 4 2019-02-26T09:33:08.737903Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.12' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL. 2019-02-26T09:33:08.899554Z 0 [Note] [MY-011240] [Server] Plugin mysqlx reported: 'Using SSL configuration from MySQL Server' 2019-02-26T09:33:08.899991Z 0 [Note] [MY-011243] [Server] Plugin mysqlx reported: 'Using OpenSSL for TLS connections' 2019-02-26T09:33:08.900044Z 0 [Note] [MY-011332] [Server] Plugin mysqlx reported: 'IPv6 is available' 2019-02-26T09:33:08.900636Z 0 [Note] [MY-011323] [Server] Plugin mysqlx reported: 'X Plugin listens on TCP (bind-address:'::', port:33060)' 2019-02-26T09:33:08.900654Z 0 [Note] [MY-011323] [Server] Plugin mysqlx reported: 'X Plugin listens on UNIX socket (/var/run/mysqld/mysqlx.sock)' 2019-02-26T09:33:08.900700Z 0 [Note] [MY-011328] [Server] Plugin mysqlx reported: 'Server starts handling incoming connections' 2019-02-26T09:33:09.640368Z 0 [Note] [MY-011946] [InnoDB] InnoDB: Buffer pool(s) load completed at 190226 9:33:09

Versions

MySQL Operator Version: 0.3.0(latest master pull)

Environment:

mysql-agent: iad.ocir.io/oracle/mysql-agent:0.30 mysql-operator: iad.ocir.io/oracle/mysql-operator:0.30 mysql-server:8.0.12

What happened?

What you expected to happen?

How to reproduce it (as minimally and precisely as possible)?

  1. kubectl create namespace jamxia
  2. git clone mysql-operator's repo
  3. docker pull mysql-agent, mysql-operator, mysql-server and push to personal image repo, hub.oa.com/scc-dba
  4. modify mysql-operator/values.yaml's registry to personal image hub.oa.com/scc-dba, namespace to jamxia
  5. modify mysql-operator/templates/03-deployment.yaml add: - --mysql-server-image={{- .Values.image.registry }}/mysql-server helm install --namespace scc-dba --name mysql-operator-jamxia mysql-operator --set rbac.enabled=false --set operator.namespace=jamxia
  6. kubectl create -f cluster.yaml

Anything else we need to know?

kubectl exec my-app-db-0 -n jamxia -c mysql-agent bash -it mysqlsh --no-wizard --uri mysql:mysql@192.xx.xx.xx:3306 --py -e "print dba.get_cluster('Cluster')" get error: SystemError: RuntimeError: Dba.get_cluster: This function is not available through a session to a standalone instance

linqingping commented 5 years ago

@xjxia do you sloved it?

xjxia commented 5 years ago

@xjxia do you sloved it?

It's ok now ,but I don't know the reason or why its comes well, maybe related to k8s cluster's configure. I cann't repeat now

cpanato commented 5 years ago

I start seeing this issue in my cluster. this is not clear to me why it is happening. @xjxia how did you fix in your side?

thanks