Increasing the number of open files for MariaDB 10.1 on CentOS7 (openstack pike RDO install)

(c) stackhpc

Our openstack pike installation crashed after a couple of days with tons of error messages in /var/log/mariadb/maria.log in the form of

Error in accept: Bad file descriptor

Some googling  hinted at mariadb running out of open files, but I had some problems getting to grips how to set the number of open files for mariadb 10.1.20 (used by the rdo openstack-pike) on a CentOS 7 system, so here’s for posterity:

1)increase the ulimit in /etc/security/limits.conf as usual:

* hard nofile 1024000
* soft nofile 1024000

2) create the file (if it doesn’t exist, otherwise edit the existing file) /etc/systemd/system/mariadb.service.d/limits.conf 

and add the following lines

[Service]
LimitNOFILE=1024000

2a) reload systemd

# systemctl daemon-reload

3) restart mariadb

# systemctl restart mariadb.service

4) check the results

# mysql -pXXXXXXXX mysql

MariaDB [mysql]> show global variables like 'open%';
+------------------+---------+
| Variable_name | Value |
+------------------+---------+
| open_files_limit | 1024000 |
+------------------+---------+
1 row in set (0.00 sec)

5) Enjoy a hopefully crash-free OpenStack Pike setup 😉

 

Leave a Reply

Your email address will not be published. Required fields are marked *