我正在尝试运行 percona xtradb 集群。percona 服务器的输出如下:
mysqld: [Warning] World-writable config file '/etc/mysql/my.cnf' is ignored.
2019-06-10T07:24:28.000875Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-06-10T07:24:28.000942Z 0 [Warning] WSREP: Node is running in bootstrap/initialize mode. Disabling pxc_strict_mode checks
2019-06-10T07:24:28.187210Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-06-10T07:24:28.218407Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-06-10T07:24:28.273235Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: c8208edd-8b50-11e9-92e6-0242ac110005.
2019-06-10T07:24:28.274902Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-06-10T07:24:28.421386Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
Finished --initialize-insecure
+ echo 'Finished --initialize-insecure'
+ pid=60
+ mysql=(mysql --protocol=socket -uroot)
+ for i in '{30..0}'
+ echo 'SELECT 1'
+ mysql --protocol=socket -uroot
+ mysqld --user=mysql --datadir=/var/lib/mysql/ --skip-networking
+ echo 'MySQL init process in progress...'
+ sleep 1
MySQL init process in progress...
mysqld: [Warning] World-writable config file '/etc/mysql/my.cnf' is ignored.
2019-06-10T07:24:35.939976Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-06-10T07:24:35.941003Z 0 [Warning] WSREP: Node is not a cluster node. Disabling pxc_strict_mode
2019-06-10T07:24:35.941026Z 0 [Note] mysqld (mysqld 5.7.25-28-57) starting as process 60 ...
2019-06-10T07:24:35.943891Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-06-10T07:24:35.943931Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-06-10T07:24:35.943934Z 0 [Note] InnoDB: Uses event mutexes
2019-06-10T07:24:35.943937Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-06-10T07:24:35.943939Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2019-06-10T07:24:35.943941Z 0 [Note] InnoDB: Using Linux native AIO
2019-06-10T07:24:35.944094Z 0 [Note] InnoDB: Number of pools: 1
2019-06-10T07:24:35.944167Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-06-10T07:24:35.945273Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2019-06-10T07:24:35.949427Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-06-10T07:24:35.950944Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-06-10T07:24:35.961258Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2019-06-10T07:24:35.961301Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2019-06-10T07:24:35.961308Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
MySQL init process in progress...
2019-06-10T07:24:37.066708Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-06-10T07:24:37.067259Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-06-10T07:24:37.067993Z 0 [ERROR] Failed to initialize builtin plugins.
2019-06-10T07:24:37.068107Z 0 [ERROR] Aborting
2019-06-10T07:24:37.068125Z 0 [Note] Binlog end
2019-06-10T07:24:37.068278Z 0 [Note] Shutting down plugin 'CSV'
2019-06-10T07:24:37.068293Z 0 [Note] Shutting down plugin 'MyISAM'
2019-06-10T07:24:37.071449Z 0 [Note] mysqld: Shutdown complete
+ for i in '{30..0}'
+ mysql --protocol=socket -uroot
+ echo 'SELECT 1'
+ echo 'MySQL init process in progress...'
+ sleep 1
<30 times same for the above for loop>
+ exit 1
我得到的解决方案没有帮助。
哦,docker文件是:
FROM debian:jessie
MAINTAINER Percona Development <info@percona.com>
RUN groupadd -g 1001 mysql
RUN useradd -u 1001 -r -g 1001 -s /sbin/nologin \
-c "Default Application User" mysql
RUN apt-get update -qq && apt-get install -qqy --no-install-recommends \
apt-transport-https ca-certificates \
pwgen wget \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://repo.percona.com/apt/percona-release_0.1-6.jessie_all.deb \
&& dpkg -i percona-release_0.1-6.jessie_all.deb
# the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql)
# also, we set debconf keys to make APT a little quieter
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -qq \
&& apt-get install -qqy --force-yes \
percona-xtradb-cluster-57 curl \
&& rm -rf /var/lib/apt/lists/* \
# comment out any "user" entires in the MySQL config ("docker-entrypoint.sh" or "--user" will handle user switching)
&& sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf \
# purge and re-create /var/lib/mysql with appropriate ownership
&& rm -rf /var/lib/mysql \
&& mkdir -p /var/lib/mysql /var/log/mysql /var/run/mysqld \
# && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
# && chown -R 1001:1001 /etc/mysql/ /var/log/mysql /var/lib/mysql /var/run/mysqld \
&& chown -R mysql:mysql /etc/mysql/ /var/log/mysql /var/lib/mysql /var/run/mysqld \
# && chmod -R g=u /etc/mysql/ /var/log/mysql /var/lib/mysql
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime
&& chmod -R 777 /etc/mysql/ /var/log/mysql /var/lib/mysql /var/run/mysqld
RUN sed -ri 's/^bind-address/#&/' /etc/mysql/my.cnf
# && echo 'skip-host-cache\nskip-name-resolve' | awk '{ print } $1 == "[mysqld]" && c == 0 { c = 1; system("cat") }' /etc/mysql/my.cnf > /tmp/my.cnf \
# && mv /tmp/my.cnf /etc/mysql/my.cnf
VOLUME ["/var/lib/mysql", "/var/log/mysql"]
RUN sed -ri 's/^log_error/#&/' /etc/mysql/my.cnf
ADD node.cnf /etc/mysql/conf.d/node.cnf
RUN echo '!include /etc/mysql/conf.d/node.cnf' >> /etc/mysql/my.cnf
COPY entrypoint.sh /entrypoint.sh
COPY dockerdir /
#COPY jq /usr/bin/jq
#COPY clustercheckcron /usr/bin/clustercheckcron
#RUN chmod a+x /usr/bin/jq
#RUN chmod a+x /usr/bin/clustercheckcron
EXPOSE 3306 4567 4568
LABEL vendor=Percona
LABEL com.percona.package="Percona XtraDB Cluster"
LABEL com.percona.version="5.7"
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 3306
USER 1001
CMD [""]