charts icon indicating copy to clipboard operation
charts copied to clipboard

[bitnami/mysql] Slave pods are not running.

Open shaekhhasanshoron opened this issue 6 years ago • 11 comments

Which chart: bitnami/mysql version: 6.14.3 appVersion: 8.0.20

Describe the bug I am running this version of the chart and using 'docker.io/bitnami/mysql:5.7.30-debian-10-r53' tag. First I have fetched the master and slave descriptor using 'helm template' command and customize the root password, db user and password. Then deployed the descriptor. After deploying descriptors, the master runs correctly without any error but slave pod does not run.

Slave Pod Log:

mysql 13:10:56.89
mysql 13:10:56.89 Welcome to the Bitnami mysql container
mysql 13:10:56.90 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mysql
mysql 13:10:56.90 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mysql/issues
mysql 13:10:56.90
mysql 13:10:56.90 INFO  ==> ** Starting MySQL setup **
mysql 13:10:56.92 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mysql 13:10:56.93 INFO  ==> Initializing mysql database
mysql 13:10:56.95 WARN  ==> The mysql configuration file '/opt/bitnami/mysql/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.
mysql 13:10:56.95 INFO  ==> Using persisted data
mysql 13:10:56.97 INFO  ==> Running mysql_upgrade
mysql 13:10:56.99 INFO  ==> Starting mysql in background
mysql 13:10:58.03 INFO  ==> Stopping mysql

Slave Pod Events:

LAST SEEN   TYPE      REASON    OBJECT               MESSAGE
13m         Normal    Pulling   pod/mysql-slave-0    Pulling image "docker.io/bitnami/mysql:5.7.30-debian-10-r53"
3m50s       Warning   BackOff   pod/mysql-slave-0    Back-off restarting failed container

To Reproduce Steps to reproduce the behavior:

  1. Fetch the complete descriptor using following command:
helm template mysql --set root.forcePassword=true --set image.tag=5.7.30-debian-10-r53 --set slave.replicas=2  --set metrics.enabled=true --set replication.enabled=true --set root.password=abcd1234 bitnami/mysql > mysql.yaml
  1. Deploy the descriptor.
kubectl create -f mysql.yaml
  1. Mysql Master Pod is running.
  2. Mysql Slave Pod is not running. See the above events and logs.

Expected behavior Mysql slave pod's should be running.

Version of Helm and Kubernetes:

  • Output of helm version:
version.BuildInfo{Version:"v3.2.3", GitCommit:"8f832046e258e2cb800894579b1b3b50c2d83492", GitTreeState:"clean", GoVersion:"go1.13.12"}
  • Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.7", GitCommit:"b4455102ef392bf7d594ef96b97a4caa79d729d9", GitTreeState:"clean", BuildDate:"2020-06-17T11:39:47Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.7", GitCommit:"b4455102ef392bf7d594ef96b97a4caa79d729d9", GitTreeState:"clean", BuildDate:"2020-06-17T11:32:20Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

Additional context Add any other context about the problem here.

shaekhhasanshoron avatar Jul 10 '20 14:07 shaekhhasanshoron

Hi @shaekhhasanshoron, we couldn't reproduce your issue. In our case, all the pods (master and slaves) are showing correct status and appropriate logs.

To get more information from the logs, please, add the following to the slave-statefulset manifest (in your mysql.yaml):

           image: docker.io/bitnami/mysql:5.7.30-debian-10-r53
           imagePullPolicy: "IfNotPresent"
           env:
+            - name: BITNAMI_DEBUG
+              value: "true"
             - name: MYSQL_REPLICATION_MODE
               value: "slave"
             - name: MYSQL_MASTER_HOST

Then show again the logs for the pods that are failing. Please, remember that you might need to do a clean-up of the resources that you have created, so you work always in the same environment creating the resources instead of updating them.

andresbono avatar Jul 13 '20 06:07 andresbono

@andresbono thank you so much for your reply. I have cleaned all the resources and deployed MySQL master and slave descriptors again. I was also working with another MySQL tag 'docker.io/bitnami/mysql:8.0.19-debian-10-r21'. I have just changed the image without changing any other configuration on the deployment descriptor. After deployment, the master and slave ran successfully and for this tag. But for 'docker.io/bitnami/mysql:5.7.30-debian-10-r53' tag, the slave is still not working. Got an error in the log "Access denied for user 'root'@'localhost' (using password: YES) while connecting to the MySQL server Upgrade process encountered error and will not continue". Now if 'docker.io/bitnami/mysql:5.7.30-debian-10-r53' tag gives me this error then how come 'docker.io/bitnami/mysql:8.0.19-debian-10-r21' works fine with the same configuration. I am adding the slave configmap, descriptor, and its logs with this comment which uses tag 'docker.io/bitnami/mysql:5.7.30-debian-10-r53'.

Slave Pod Log:

mysql 15:39:31.50
mysql 15:39:31.50 Welcome to the Bitnami mysql container
mysql 15:39:31.50 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mysql
mysql 15:39:31.51 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mysql/issues
mysql 15:39:31.51
mysql 15:39:31.51 INFO  ==> ** Starting MySQL setup **
mysql 15:39:31.55 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mysql 15:39:31.56 INFO  ==> Initializing mysql database
mysql 15:39:31.56 DEBUG ==> Ensuring expected directories/files exist
mysql 15:39:31.59 WARN  ==> The mysql configuration file '/opt/bitnami/mysql/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.
mysql 15:39:31.60 INFO  ==> Using persisted data
mysql 15:39:31.63 INFO  ==> Running mysql_upgrade
mysql 15:39:31.64 INFO  ==> Starting mysql in background
2020-07-13T15:39:31.971336Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2020-07-13T15:39:31.971552Z 0 [Note] /opt/bitnami/mysql/bin/mysqld (mysqld 5.7.30-log) starting as process 46 ...
2020-07-13T15:39:31.983770Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-07-13T15:39:31.983863Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-07-13T15:39:31.983877Z 0 [Note] InnoDB: Uses event mutexes
2020-07-13T15:39:31.983883Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-07-13T15:39:31.983888Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-07-13T15:39:31.983902Z 0 [Note] InnoDB: Using Linux native AIO
2020-07-13T15:39:31.984562Z 0 [Note] InnoDB: Number of pools: 1
2020-07-13T15:39:31.984905Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-07-13T15:39:31.990151Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-07-13T15:39:32.006369Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-07-13T15:39:32.011860Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-07-13T15:39:32.027887Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-07-13T15:39:32.071514Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-07-13T15:39:32.071654Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-07-13T15:39:32.505454Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-07-13T15:39:32.506746Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-07-13T15:39:32.506777Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-07-13T15:39:32.513465Z 0 [Note] InnoDB: Waiting for purge to start
2020-07-13T15:39:32.563993Z 0 [Note] InnoDB: 5.7.30 started; log sequence number 2746507
2020-07-13T15:39:32.564373Z 0 [Note] InnoDB: Loading buffer pool(s) from /bitnami/mysql/data/ib_buffer_pool
2020-07-13T15:39:32.566976Z 0 [Note] Plugin 'FEDERATED' is disabled.
2020-07-13T15:39:32.568950Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200713 15:39:32
2020-07-13T15:39:32.681025Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-07-13T15:39:32.681062Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-07-13T15:39:32.682439Z 0 [Warning] CA certificate ca.pem is self signed.
2020-07-13T15:39:32.682562Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-07-13T15:39:32.682789Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2020-07-13T15:39:32.682887Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2020-07-13T15:39:32.682974Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-07-13T15:39:32.815411Z 0 [Note] Event Scheduler: Loaded 0 events
2020-07-13T15:39:32.815865Z 0 [Note] /opt/bitnami/mysql/bin/mysqld: ready for connections.
Version: '5.7.30-log'  socket: '/opt/bitnami/mysql/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)
mysql_upgrade: [Warning] Using a password on the command line interface can be insecure.
mysql_upgrade: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
2020-07-13T15:39:33.702696Z 2 [Note] Access denied for user 'root'@'localhost' (using password: YES)
mysql 15:39:33.72 INFO  ==> Stopping mysql
2020-07-13T15:39:33.727722Z 0 [Note] Giving 0 client threads a chance to die gracefully
2020-07-13T15:39:33.727763Z 0 [Note] Shutting down slave threads
2020-07-13T15:39:33.773106Z 0 [Note] Forcefully disconnecting 0 remaining clients
2020-07-13T15:39:33.773157Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2020-07-13T15:39:33.787590Z 0 [Note] Binlog end
2020-07-13T15:39:33.797763Z 0 [Note] Shutting down plugin 'ngram'
2020-07-13T15:39:33.797812Z 0 [Note] Shutting down plugin 'partition'
2020-07-13T15:39:33.797819Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2020-07-13T15:39:33.797825Z 0 [Note] Shutting down plugin 'ARCHIVE'
2020-07-13T15:39:33.797828Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2020-07-13T15:39:33.797880Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2020-07-13T15:39:33.797889Z 0 [Note] Shutting down plugin 'MyISAM'
2020-07-13T15:39:33.797908Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2020-07-13T15:39:33.797913Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2020-07-13T15:39:33.797916Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2020-07-13T15:39:33.797942Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2020-07-13T15:39:33.797946Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2020-07-13T15:39:33.797949Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2020-07-13T15:39:33.797952Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2020-07-13T15:39:33.797956Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2020-07-13T15:39:33.797959Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2020-07-13T15:39:33.797962Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2020-07-13T15:39:33.797966Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2020-07-13T15:39:33.797969Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2020-07-13T15:39:33.797973Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2020-07-13T15:39:33.797976Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2020-07-13T15:39:33.797979Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2020-07-13T15:39:33.797983Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2020-07-13T15:39:33.797986Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2020-07-13T15:39:33.797989Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2020-07-13T15:39:33.797992Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2020-07-13T15:39:33.797996Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2020-07-13T15:39:33.797999Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2020-07-13T15:39:33.798002Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2020-07-13T15:39:33.798006Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2020-07-13T15:39:33.798009Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2020-07-13T15:39:33.798281Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2020-07-13T15:39:33.798290Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2020-07-13T15:39:33.798295Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2020-07-13T15:39:33.798299Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2020-07-13T15:39:33.798302Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2020-07-13T15:39:33.798306Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2020-07-13T15:39:33.798309Z 0 [Note] Shutting down plugin 'InnoDB'
2020-07-13T15:39:33.798443Z 0 [Note] InnoDB: FTS optimize thread exiting.
2020-07-13T15:39:33.798612Z 0 [Note] InnoDB: Starting shutdown...
2020-07-13T15:39:33.898900Z 0 [Note] InnoDB: Dumping buffer pool(s) to /bitnami/mysql/data/ib_buffer_pool
2020-07-13T15:39:33.899249Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 200713 15:39:33
2020-07-13T15:39:35.489551Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2748016
2020-07-13T15:39:35.493792Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-07-13T15:39:35.493849Z 0 [Note] Shutting down plugin 'MEMORY'
2020-07-13T15:39:35.493866Z 0 [Note] Shutting down plugin 'CSV'
2020-07-13T15:39:35.493871Z 0 [Note] Shutting down plugin 'sha256_password'
2020-07-13T15:39:35.493874Z 0 [Note] Shutting down plugin 'mysql_native_password'
2020-07-13T15:39:35.494061Z 0 [Note] Shutting down plugin 'binlog'
2020-07-13T15:39:35.498376Z 0 [Note] /opt/bitnami/mysql/bin/mysqld: Shutdown complete

Slave ConfigMap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: mysql-test-slave
  namespace: mysql-ns
  labels:
    app: mysql-test
    component: slave
data:
  my.cnf: |-
    [mysqld]
    default_authentication_plugin=mysql_native_password
    skip-name-resolve
    skip-log-bin
    explicit_defaults_for_timestamp
    basedir=/opt/bitnami/mysql
    port=3306
    socket=/opt/bitnami/mysql/tmp/mysql.sock
    datadir=/bitnami/mysql/data
    tmpdir=/opt/bitnami/mysql/tmp
    max_allowed_packet=16M
    bind-address=0.0.0.0
    pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
    log-error=/opt/bitnami/mysql/logs/mysqld.log
    character-set-server=UTF8
    collation-server=utf8_general_ci

    [client]
    port=3306
    socket=/opt/bitnami/mysql/tmp/mysql.sock
    default-character-set=UTF8

    [manager]
    port=3306
    socket=/opt/bitnami/mysql/tmp/mysql.sock
    pid-file=/opt/bitnami/mysql/tmp/mysqld.pid

Slave Descriptor:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mysql-test-slave
  namespace: mysql-ns
  labels:
    app: mysql-test
    component: slave
spec:
  serviceName: mysql-test-slave
  replicas: 1
  selector:
    matchLabels:
      app: mysql-test
      component: slave
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: mysql-test
        component: slave
    spec:
      terminationGracePeriodSeconds: 15
      containers:
      - name: mysql
        imagePullPolicy: IfNotPresent
        image: docker.io/bitnami/mysql:5.7.30-debian-10-r53
        resources:
          requests:
            cpu: 500m
            memory: 512Mi
          limits:
            cpu: 1000m
            memory: 1024Mi
        command: 
        env:
        - name: BITNAMI_DEBUG
          value: "true"
        - name: MYSQL_REPLICATION_MODE
          value: slave
        - name: MYSQL_MASTER_HOST
          value: mysql-test-master-0.mysql-test-master.mysql-ns.svc.cluster.local
        - name: MYSQL_MASTER_PORT_NUMBER
          value: '3306'
        - name: MYSQL_MASTER_ROOT_USER
          value: root
        - name: MYSQL_MASTER_ROOT_PASSWORD
          value: abc123
        - name: MYSQL_REPLICATION_USER
          value: replicator
        - name: MYSQL_REPLICATION_PASSWORD
          value: abc123
        - name: MYSQL_AUTHENTICATION_PLUGIN
          value: mysql_native_password
        - name: MYSQL_ROOT_PASSWORD
          value: abc123
        ports:
        - name: mysql
          containerPort: 3306
        volumeMounts:
        - mountPath: "/bitnami/mysql"
          name: data
        - mountPath: "/opt/bitnami/mysql/conf/my.cnf"
          name: mysql-test-slave-config
          subPath: my.cnf
        readinessProbe:
          exec:
            command:
            - sh
            - "-c"
            - |-
              password_aux="${MYSQL_ROOT_PASSWORD:-}"
              if [ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]; then
                password_aux=$(cat $MYSQL_ROOT_PASSWORD_FILE)
              fi
              mysqladmin status -uroot -p$password_aux
          failureThreshold: 3
          initialDelaySeconds: 120
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        livenessProbe:
          exec:
            command:
            - sh
            - "-c"
            - |-
              password_aux="${MYSQL_ROOT_PASSWORD:-}"
              if [ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]; then
                password_aux=$(cat $MYSQL_ROOT_PASSWORD_FILE)
              fi
              mysqladmin status -uroot -p$password_aux
          failureThreshold: 3
          initialDelaySeconds: 120
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        securityContext: {}
      - name: metrics
        imagePullPolicy: IfNotPresent
        image: docker.io/bitnami/mysqld-exporter:0.12.1-debian-10-r27
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 200m
            memory: 256Mi
        command:
        - "/bin/sh"
        - "-c"
        - |-
          password_aux="${MYSQL_ROOT_PASSWORD:-}"
          if [ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]; then
            password_aux=$(cat $MYSQL_ROOT_PASSWORD_FILE)
          fi
          DATA_SOURCE_NAME="root:${password_aux}@(localhost:3306)/" /bin/mysqld_exporter
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: abc123
        envFrom: 
        ports:
        - name: metrics
          containerPort: 9104
        volumeMounts: 
        readinessProbe:
          failureThreshold: 
          httpGet:
            path: "/metrics"
            port: 9104
          initialDelaySeconds: 5
          periodSeconds: 
          successThreshold: 
          timeoutSeconds: 1
        livenessProbe:
          failureThreshold: 
          httpGet:
            path: "/metrics"
            port: 9104
          initialDelaySeconds: 5
          periodSeconds: 
          successThreshold: 
          timeoutSeconds: 1
        securityContext: {}
      volumes:
      - name: mysql-test-slave-config
        emptyDir: 
        configMap:
          name: my-mysql-slave
  volumeClaimTemplates:
  - metadata:
      name: data
      namespace: mysql-ns
      labels:
        app: mysql-test
        component: slave
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 1024Mi

shaekhhasanshoron avatar Jul 13 '20 18:07 shaekhhasanshoron

@shaekhhasanshoron, everything works fine for us with the image that you are indicating:

helm install mysql-test --set root.forcePassword=true --set image.tag=5.7.30-debian-10-r53 --set slave.replicas=2  --set metrics.enabled=true --set replication.enabled=true --set root.password=abcd1234 --set image.debug=true bitnami/mysql

Are you able to connect to the master pod and connect to the database with mysql client? Is the password the expected one and the one specified in the slave statefulset manifest?

Are you cleaning PVC between one deployment and the following? That may be causing issues.

andresbono avatar Jul 14 '20 07:07 andresbono

@andresbono I ran the command and deployed the descriptor without changing anything. But still slave pod are not working for 'mysql:5.7.30-debian-10-r53' whereas its working for 'mysql:8.0.19-debian-10-r21'. The master pod is running successfully for both tags and I have also successfully connected those with MySQL client. I have tried both ways, first I have tried deleting all PVC and run those deployments. Secondly, I have tried keeping PVC and run those deployments. In both ways, I have faced the same problem. Can you please suggest anything that solves this issue. Thanks in advance.

Here Slave Pod's error log:

2020-07-15T11:38:07.764656Z 12 [Note] Access denied for user 'root'@'localhost' (using password: YES)
mysql: [Warning] Using a password on the command line interface can be insecure.
2020-07-15T11:38:10.335218Z 15 [Note] Access denied for user 'root'@'localhost' (using password: YES)
ERROR 2005 (HY000): Unknown MySQL server host 'mysql-test' (22)

shaekhhasanshoron avatar Jul 17 '20 10:07 shaekhhasanshoron

It seems like mysql-test is not resolvable. Can you list the services?

This is what we get:

$ kubectl get svc
NAME               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)             AGE
kubernetes         ClusterIP   10.96.0.1       <none>        443/TCP             24m
mysql-test         ClusterIP   10.98.222.110   <none>        3306/TCP,9104/TCP   5m59s
mysql-test-slave   ClusterIP   10.96.155.62    <none>        3306/TCP,9104/TCP   5m59s

andresbono avatar Jul 20 '20 10:07 andresbono

@andresbono Hello, I have the same problem

The operation steps are as follows
helm version
version.BuildInfo{Version:"v3.1.3", GitCommit:"0a9a9a88e8afd6e77337a3e2ad744756e191429a", GitTreeState:"clean", GoVersion:"go1.13.10"}
 kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.6", GitCommit:"72c30166b2105cd7d3350f2c28a219e6abcd79eb", GitTreeState:"clean", BuildDate:"2020-01-18T23:31:31Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.6", GitCommit:"72c30166b2105cd7d3350f2c28a219e6abcd79eb", GitTreeState:"clean", BuildDate:"2020-01-18T23:23:21Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
helm repo add bitnami https://charts.bitnami.com/bitnami

helm search repo mariadb

helm pull bitnami/mariadb --version=7.6.1

kubectl create ns mariadb-ns

helm template mariadb ./mariadb-7.6.1.tgz --output-dir . \
    --namespace mariadb-ns \
    --set rootUser.password=1qaz@WSX \
    --set db.user=root \
    --set slave.replicas=1 \
    --set master.persistence.enabled=false \
    --set slave.persistence.enabled=false


kubectl apply -R -f mariadb/

k8s cluster info
kubectl -n mariadb-ns get all                                                        Thu Jul 23 11:52:46 2020

NAME                   READY   STATUS             RESTARTS   AGE
pod/mariadb-master-0   0/1     CrashLoopBackOff   5          4m52s
pod/mariadb-slave-0    0/1     Error              5          4m51s

NAME                    TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/mariadb         ClusterIP   10.96.128.71    <none>        3306/TCP   4m52s
service/mariadb-slave   ClusterIP   10.100.37.180   <none>        3306/TCP   4m52s

NAME                              READY   AGE
statefulset.apps/mariadb-master   0/1     4m52s
statefulset.apps/mariadb-slave    0/1     4m52s

master-log
mariadb 03:48:24.78 
mariadb 03:48:24.78 Welcome to the Bitnami mariadb container
mariadb 03:48:24.78 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mariadb
mariadb 03:48:24.78 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mariadb/issues
mariadb 03:48:24.78 
mariadb 03:48:24.79 INFO  ==> ** Starting MariaDB setup **
mariadb 03:48:24.80 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mariadb 03:48:24.81 INFO  ==> Initializing mariadb database
mariadb 03:48:24.81 DEBUG ==> Ensuring expected directories/files exist
mariadb 03:48:24.82 WARN  ==> The mariadb configuration file '/opt/bitnami/mariadb/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.
mariadb 03:48:24.82 INFO  ==> Using persisted data
mariadb 03:48:24.84 INFO  ==> Running mysql_upgrade
mariadb 03:48:24.85 INFO  ==> Starting mariadb in background
2020-07-23  3:48:24 0 [Note] /opt/bitnami/mariadb/sbin/mysqld (mysqld 10.3.23-MariaDB-log) starting as process 52 ...
2020-07-23  3:48:24 0 [Note] InnoDB: Using Linux native AIO
2020-07-23  3:48:24 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-07-23  3:48:24 0 [Note] InnoDB: Uses event mutexes
2020-07-23  3:48:24 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-07-23  3:48:24 0 [Note] InnoDB: Number of pools: 1
2020-07-23  3:48:24 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-07-23  3:48:24 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-07-23  3:48:25 0 [Note] InnoDB: Completed initialization of buffer pool
2020-07-23  3:48:25 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-07-23  3:48:25 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-07-23  3:48:25 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-07-23  3:48:25 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-07-23  3:48:25 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-07-23  3:48:25 0 [Note] InnoDB: 10.3.23 started; log sequence number 1625466; transaction id 21
2020-07-23  3:48:25 0 [Note] InnoDB: Loading buffer pool(s) from /bitnami/mariadb/data/ib_buffer_pool
2020-07-23  3:48:25 0 [Note] InnoDB: Buffer pool(s) load completed at 200723  3:48:25
2020-07-23  3:48:25 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-07-23  3:48:25 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-07-23  3:48:25 0 [Warning] 'proxies_priv' entry '@% root@mariadb-master-0' ignored in --skip-name-resolve mode.
2020-07-23  3:48:25 0 [Note] Reading of all Master_info entries succeeded
2020-07-23  3:48:25 0 [Note] Added new Master_info '' to hash table
2020-07-23  3:48:25 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: ready for connections.
Version: '10.3.23-MariaDB-log'  socket: '/opt/bitnami/mariadb/tmp/mysql.sock'  port: 3306  Source distribution
2020-07-23  3:48:25 9 [Warning] Access denied for user 'root'@'localhost' (using password: YES)
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
FATAL ERROR: Upgrade failed
mariadb 03:48:25.88 INFO  ==> Stopping mariadb
2020-07-23  3:48:25 0 [Note] /opt/bitnami/mariadb/sbin/mysqld (initiated by: unknown): Normal shutdown
2020-07-23  3:48:25 0 [Note] Event Scheduler: Purging the queue. 0 events
2020-07-23  3:48:25 0 [Note] InnoDB: FTS optimize thread exiting.
2020-07-23  3:48:25 0 [Note] InnoDB: Starting shutdown...
2020-07-23  3:48:25 0 [Note] InnoDB: Dumping buffer pool(s) to /bitnami/mariadb/data/ib_buffer_pool
2020-07-23  3:48:25 0 [Note] InnoDB: Buffer pool(s) dump completed at 200723  3:48:25
2020-07-23  3:48:26 0 [Note] InnoDB: Shutdown completed; log sequence number 1625475; transaction id 22
2020-07-23  3:48:26 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-07-23  3:48:26 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: Shutdown complete
slave log
mariadb 03:47:57.06 
mariadb 03:47:57.06 Welcome to the Bitnami mariadb container
mariadb 03:47:57.06 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mariadb
mariadb 03:47:57.07 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mariadb/issues
mariadb 03:47:57.07 
mariadb 03:47:57.07 INFO  ==> ** Starting MariaDB setup **
mariadb 03:47:57.08 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mariadb 03:47:57.09 INFO  ==> Initializing mariadb database
mariadb 03:47:57.10 WARN  ==> The mariadb configuration file '/opt/bitnami/mariadb/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.
mariadb 03:47:57.10 INFO  ==> Installing database
mariadb 03:47:59.64 INFO  ==> Starting mariadb in background
mariadb 03:48:00.66 INFO  ==> Configuring authentication
mariadb 03:48:00.69 INFO  ==> Configuring replication in slave node


lemonit-eric-mao avatar Jul 23 '20 04:07 lemonit-eric-mao

Hi @lemonit-eric-mao, did you solve the issue?

andresbono avatar Jul 23 '20 08:07 andresbono

Hi @andresbono , The reason why I failed to start is not

The mariadb configuration file '/opt/bitnami/mariadb/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.

This problem has not been solved, but it does not affect the startup


My mistake
helm template mariadb ./mariadb-7.6.1.tgz --output-dir . \
    --namespace mariadb-ns \
    --set rootUser.password=******* \
    --set db.user=root \
    --set slave.replicas=1 \
    --set master.persistence.enabled=false \
    --set slave.persistence.enabled=false

I'm sorry to disturb you

lemonit-eric-mao avatar Jul 24 '20 08:07 lemonit-eric-mao

Great, @lemonit-eric-mao, thanks for your confirmation!

andresbono avatar Jul 24 '20 14:07 andresbono

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

stale[bot] avatar Aug 08 '20 15:08 stale[bot]

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

stale[bot] avatar Aug 15 '20 03:08 stale[bot]