Dockerfie镜像报错,状态acitvating(start)
[root@dc14736765e5 mysql]# systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: activating (start) since Thu 2021-10-14 04:26:29 UTC; 48s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 604 ExecStart=/usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS) Process: 589 ExecStartPre=/usr/local/mysql/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) CGroup: /docker/dc14736765e51e9353aa13ae33165be29c00f55a9182903933879e164fa7f8f1/system.slice/mysqld.service └─606 /usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid
刚开始远程登录mysql无法登录,以为这个状态是无法正常运行的,但是查看端口,端口也已经打开
[root@dc14736765e5 mysql]# netstat -natp | grep 3306 tcp6 0 0 :::3306 :::* LISTEN 606/mysqld tcp6 0 0 172.17.0.2:3306 192.168.229.80:60618 ESTABLISHED 606/mysqld
多次重新安装,状态依旧如此,但是远程登录可以正常访问,故此状态并不影响mysql镜像容器使用
[root@localhost mysql]# docker run --name=mysql_server1 -v /sys/fs/cgroup/:/sys/fs/cgroup -d -P --privileged mysql:centos fe31ead391b379516ca0ad8f3af42d72f6121a6dad90cd9c75eae3dfbe07a851 [root@localhost mysql]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES fe31ead391b3 mysql:centos "/usr/sbin/init" 5 seconds ago Up 4 seconds 0.0.0.0:49154->3306/tcp, :::49154->3306 [root@localhost mysql]# docker exec -it fe31ead391b3 bash [root@fe31ead391b3 mysql]# systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: failed (Result: start-limit) since Thu 2021-10-14 05:14:34 UTC; 19s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 477 ExecStart=/usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE) Process: 462 ExecStartPre=/usr/local/mysql/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Oct 14 05:14:34 fe31ead391b3 systemd[1]: Failed to start MySQL Server. Oct 14 05:14:34 fe31ead391b3 systemd[1]: Unit mysqld.service entered failed state. Oct 14 05:14:34 fe31ead391b3 systemd[1]: mysqld.service failed. Oct 14 05:14:34 fe31ead391b3 systemd[1]: mysqld.service holdoff time over, scheduling restart. Oct 14 05:14:34 fe31ead391b3 systemd[1]: Stopped MySQL Server. Oct 14 05:14:34 fe31ead391b3 systemd[1]: start request repeated too quickly for mysqld.service Oct 14 05:14:34 fe31ead391b3 systemd[1]: Failed to start MySQL Server. Oct 14 05:14:34 fe31ead391b3 systemd[1]: Unit mysqld.service entered failed state. Oct 14 05:14:34 fe31ead391b3 systemd[1]: mysqld.service failed. [root@fe31ead391b3 mysql]# systemctl start mysqld Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. [root@fe31ead391b3 mysql]# systemctl start mysqld [root@fe31ead391b3 mysql]# systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2021-10-14 05:28:07 UTC; 35s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 745 ExecStart=/usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS) Process: 730 ExecStartPre=/usr/local/mysql/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 747 (mysqld) CGroup: /docker/fe31ead391b379516ca0ad8f3af42d72f6121a6dad90cd9c75eae3dfbe07a851/system.slice/mysqld.service └─747 /usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid Oct 14 05:28:06 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:06.991381Z 0 [Note] Server socket created on IP: '::'. Oct 14 05:28:06 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:06.996265Z 0 [ERROR] Can't open the mysql.func table. Please run mysql...ate it. Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.003405Z 0 [ERROR] Cannot open mysql.event Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.003442Z 0 [ERROR] Event Scheduler: An error occurred when initializ...eduler. Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.003677Z 0 [Note] /usr/local/mysql/bin/mysqld: ready for connections. Oct 14 05:28:07 fe31ead391b3 mysqld[745]: Version: '5.7.20' socket: '/usr/local/mysql/mysql.sock' port: 3306 Source distribution Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.003703Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES... check. Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.003707Z 0 [Note] Beginning of list of non-natively partitioned tables Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.012549Z 0 [Note] End of list of non-natively partitioned tables Oct 14 05:28:07 fe31ead391b3 systemd[1]: Started MySQL Server. Hint: Some lines were ellipsized, use -l to show in full.
将本人在工作学习中的一些知识记录并分享