MySQL的:8.0走不寻常的时间在泊坞窗初始化

问题描述 投票:0回答:1

官方mysql:8.0(又名8.0.4)形象正在不寻常的时间(约10+分钟)来初始化泊坞窗(本地计算机)数据库。

如果您在登录的时候仔细一看,最后一行用了7分钟来执行。

Initializing database
2018-04-09T10:00:29.926078Z 0 [Warning] [MY-011070] Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it is deprecated and will be removed in a future release.
2018-04-09T10:00:29.926165Z 0 [System] [MY-010116] /usr/sbin/mysqld (mysqld 8.0.4-rc) starting as process 30 ...
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
2018-04-09T10:00:46.842725Z 0 [Warning] [MY-010068] CA certificate ca.pem is self signed.
2018-04-09T10:00:46.903128Z 5 [Warning] [MY-010453] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2018-04-09T10:07:28.643932Z 5 [Warning] [MY-010315] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode.

为了您的信息,在此同一台机器,mysql:8.0.3不会花费太多时间在所有初始化数据库。

下面是我的配置:

操作系统:Ubuntu的16:04

$ docker version
Client:
 Version:   17.12.1-ce
 API version:   1.35
 Go version:    go1.9.4
 Git commit:    7390fc6
 Built: Tue Feb 27 22:17:40 2018
 OS/Arch:   linux/amd64

Server:
 Engine:
  Version:  17.12.1-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   7390fc6
  Built:    Tue Feb 27 22:16:13 2018
  OS/Arch:  linux/amd64
  Experimental: false

流程重建和完整的日志:

$ docker pull mysql:8.0
8.0: Pulling from library/mysql
2a72cbf407d6: Pull complete 
38680a9b47a8: Pull complete 
4c732aa0eb1b: Pull complete 
c5317a34eddd: Pull complete 
f92be680366c: Pull complete 
e8ecd8bec5ab: Pull complete 
2a650284a6a8: Pull complete 
5127cdce4b46: Pull complete 
e20139ed3159: Pull complete 
4c9ba8a8a3da: Pull complete 
16cd0f3afb27: Pull complete 
0e4872d58e1f: Pull complete 
Digest: sha256:7004063f8bd0c7bade8d1c526b9b8f5188c8288f411d76ee4ba83131e00c6f02
Status: Downloaded newer image for mysql:8.0

$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:8.0
b9c5d67233743dc085c50244526f5b12bd862cd50cdc0cb889b2dc549c4a396d

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
b9c5d6723374        mysql:8.0           "docker-entrypoint.s…"   5 seconds ago       Up 3 seconds        3306/tcp            some-mysql

$ docker logs -f b9c5d6723374
Initializing database
2018-04-09T10:00:29.926078Z 0 [Warning] [MY-011070] Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it is deprecated and will be removed in a future release.
2018-04-09T10:00:29.926165Z 0 [System] [MY-010116] /usr/sbin/mysqld (mysqld 8.0.4-rc) starting as process 30 ...
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
2018-04-09T10:00:46.842725Z 0 [Warning] [MY-010068] CA certificate ca.pem is self signed.
2018-04-09T10:00:46.903128Z 5 [Warning] [MY-010453] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2018-04-09T10:07:28.643932Z 5 [Warning] [MY-010315] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:28.644008Z 5 [Warning] [MY-010315] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:28.644033Z 5 [Warning] [MY-010315] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:28.644051Z 5 [Warning] [MY-010315] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:28.644082Z 5 [Warning] [MY-010323] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:28.644094Z 5 [Warning] [MY-010323] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:28.644112Z 5 [Warning] [MY-010311] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:28.644240Z 5 [Warning] [MY-010330] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:28.644257Z 5 [Warning] [MY-010330] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
Database initialized
MySQL init process in progress...
2018-04-09T10:07:44.797619Z 0 [Warning] [MY-011070] Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it is deprecated and will be removed in a future release.
2018-04-09T10:07:44.797712Z 0 [System] [MY-010116] /usr/sbin/mysqld (mysqld 8.0.4-rc-log) starting as process 64 ...
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
MySQL init process in progress...
2018-04-09T10:07:45.990317Z 0 [Warning] [MY-010068] CA certificate ca.pem is self signed.
2018-04-09T10:07:46.040103Z 0 [Warning] [MY-000000] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2018-04-09T10:07:46.046970Z 0 [Warning] [MY-010315] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:46.047013Z 0 [Warning] [MY-010315] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:46.047029Z 0 [Warning] [MY-010315] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:46.047046Z 0 [Warning] [MY-010315] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:46.047078Z 0 [Warning] [MY-010323] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:46.047091Z 0 [Warning] [MY-010323] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:46.047107Z 0 [Warning] [MY-010311] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:46.050079Z 0 [Warning] [MY-010330] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:46.050115Z 0 [Warning] [MY-010330] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:46.058044Z 0 [System] [MY-010931] /usr/sbin/mysqld: ready for connections. Version: '8.0.4-rc-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server (GPL).
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2018-04-09T10:07:50.304129Z 9 [Warning] [MY-010315] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:50.304156Z 9 [Warning] [MY-010315] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:50.304166Z 9 [Warning] [MY-010315] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:50.304175Z 9 [Warning] [MY-010315] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:50.304197Z 9 [Warning] [MY-010323] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:50.304207Z 9 [Warning] [MY-010323] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:50.304218Z 9 [Warning] [MY-010311] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:50.304321Z 9 [Warning] [MY-010330] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:50.304332Z 9 [Warning] [MY-010330] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.

2018-04-09T10:07:53.074527Z 0 [System] [MY-010910] /usr/sbin/mysqld: Shutdown complete.

MySQL init process done. Ready for start up.

2018-04-09T10:07:53.336773Z 0 [Warning] [MY-011070] Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it is deprecated and will be removed in a future release.
2018-04-09T10:07:53.336883Z 0 [System] [MY-010116] /usr/sbin/mysqld (mysqld 8.0.4-rc-log) starting as process 1 ...
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
2018-04-09T10:07:54.704270Z 0 [Warning] [MY-010068] CA certificate ca.pem is self signed.
2018-04-09T10:07:54.833645Z 0 [Warning] [MY-000000] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2018-04-09T10:07:54.841847Z 0 [Warning] [MY-010315] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:54.841879Z 0 [Warning] [MY-010315] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:54.841894Z 0 [Warning] [MY-010315] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:54.841908Z 0 [Warning] [MY-010315] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:54.841931Z 0 [Warning] [MY-010323] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:54.841940Z 0 [Warning] [MY-010323] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:54.841953Z 0 [Warning] [MY-010311] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:54.844864Z 0 [Warning] [MY-010330] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:54.844947Z 0 [Warning] [MY-010330] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-04-09T10:07:54.850382Z 0 [System] [MY-010931] /usr/sbin/mysqld: ready for connections. Version: '8.0.4-rc-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL).

此外,这一形象在minikube走25分钟以上初始化数据库。

丑陋基地的Konfigurachi在:

环境:

  • 基地丑五个[R史昂:v0.25.2
  • 操作系统:Ubuntu的LTS 16.04.4
  • VM驱动程序:VirtualBox的
  • ISO版本:minikube-v0.25.1.iso

我使用的YAML文件:

apiVersion: v1
kind: Namespace
metadata:
  name: demo
spec:
  finalizers:
  - kubernetes
---
apiVersion: v1
kind: Service
metadata:
  name: mysql-gvr
  namespace: demo
spec:
  clusterIP: None
  sessionAffinity: None
  type: ClusterIP

---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app: mysql
  name: mysql-8
  namespace: demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mysql
  serviceName: mysql-gvr
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
      - env:
        - name: MYSQL_ROOT_PASSWORD
          value : "test"
        image: mysql:8.0
        name: mysql
        ports:
        - containerPort: 3306
          name: db
          protocol: TCP
        volumeMounts:
        - mountPath: /var/lib/mysql
          name: data
  volumeClaimTemplates:
  - metadata:
      annotations:
        volume.beta.kubernetes.io/storage-class: standard
      name: data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi
      storageClassName: standard
---
apiVersion: v1
kind: Service
metadata:
  name: mysql
  namespace: demo
  labels:
    name: mysql
spec:
  ports:
    - port: 3306
  selector:
    name: mysql

这是因为mysql:8.0.4使用新的基础图像debian:stretch?任何指导将不胜感激。

我也创建在github上docker-library/mysql库的问题有问题的轨道上来。这里是issue link

mysql docker kubernetes minikube
1个回答
0
投票

看起来,它是缓慢的存储问题。我的硬盘升级到SSD后,等待时间大幅提高。

我minikube内存4GB是在我以前的和当前的设置都。但是,SSD正在作出巨大的差异。

© www.soinside.com 2019 - 2024. All rights reserved.