MYSQL默认的最大允许打开文件数为32768,但是可以通过修改启动服务的LimitNOFILE
对应值来增大允许打开的文件数。
环境信息:
- CentOS Linux release 7.9.2009 (Core);
- mariadb-10.6.8;
MariaDB Galera集群启动时报错:
Aug 07 22:35:42 sd-vm-0003929.novalocal mariadbd[16941]: 2022-08-07 22:35:42 0 [Warning] Could not increase number of max_open_files to more than 32768 (request: 33039)
具体修改的位置在/usr/lib/systemd/system/mysqld.service
:
LimitNOFILE=65536
然后重启MariaDB和守护进程即可。
systemctl daemon-reload
systemctl restart mysql
参考: Could not increase number of max_open_files to more than… (Solution);