[root@master3 ~]# /usr/sbin/mysqld status 2022-07-11T02:24:32.318716Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.16) starting as process 16939 2022-07-11T02:24:32.320750Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read"Security" section of the manual to find out how to run mysqld as root! 2022-07-11T02:24:32.320815Z 0 [ERROR] [MY-010119] [Server] Aborting 2022-07-11T02:24:32.321037Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.16) MySQL Community Server - GPL.
运行后看到/var/log/mysqld.log日志内报错 经验证排除了内存,句柄数等问题. 并且切换至root用户打开大量线程时没有问题。试着调整ulimit各项参数,最后发现是”max user processes “参数有问题,通过root用户调整大小至 12000,线程数也随着增大.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2022-07-11T02:39:22.810927Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.16) starting as process 1984 2022-07-11T02:39:22.871940Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 11 2022-07-11T02:40:59.893262Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 11 2022-07-11T02:41:00.893393Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 11 2022-07-11T02:41:01.893623Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 11 2022-07-11T02:41:02.893861Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 11 2022-07-11T02:41:02.894715Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 11 in a file operation. 2022-07-11T02:41:02.894745Z 1 [ERROR] [MY-012596] [InnoDB] Error number 11 means 'Resource temporarily unavailable' 2022-07-11T02:41:02.894773Z 1 [ERROR] [MY-012215] [InnoDB] Cannot open datafile './ibdata1' 2022-07-11T02:41:02.894839Z 1 [ERROR] [MY-012959] [InnoDB] Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data! 2022-07-11T02:41:02.894868Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Cannot open a file. 2022-07-11T02:41:03.496799Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2022-07-11T02:41:03.497069Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2022-07-11T02:41:03.497874Z 0 [ERROR] [MY-010119] [Server] Aborting 2022-07-11T02:41:03.498844Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.16) MySQL Community Server - GPL.
终于发现报错
问题解决方案
1 2 3 4 5
vi /etc/security/limits.conf # 添加下列2参数
* soft nproc 12000 * hard nproc 12000
nproc就是”max user processes”,完整描述是: nproc - max number of processes 参数含义: