Make sure all .cnf files have permissions 644 to that all
users (apache, postfix, etc) can read them:
[0:root@elmo filter.d]$ ls -l /etc/my.cnf /etc/my.cnf.d/
-rw-r--r--. 1 root root 345 Feb 14 2016 /etc/my.cnf
/etc/my.cnf.d/:
total 24
-rw-r--r--. 1 root root 4128 Jul 27 2015 99-mystuff.cnf
-rw-r--r--. 1 root root 295 Dec 16 2015 client.cnf
-rw-r--r--. 1 root root 1107 Feb 14 2016 mariadb-server.cnf
-rw-r--r--. 1 root root 232 Dec 16 2015 mysql-clients.cnf
-rw-r--r--. 1 root root 285 Dec 16 2015 tokudb.cnf
Also, if you running with systemd as init, you need to override
the limits in the service file:
[0:root@elmo SPECS 130]$ cat /etc/systemd/system/mariadb.service
.include /usr/lib/systemd/system/mariadb.service
[Service]
#LimitNOFILE=infinity
LimitNOFILE=65536
LimitMEMLOCK=infinity
Your open_files_limit in my.cnf won't do anything until you remove the
systemd constraints.
To check the current limits, get the pid:
[0:root@elmo filter.d]$ ps aux | grep mariadb
mysql 2523 1.5 14.1 4705824 1153820 ? Sl 2017 1047:37
/usr/libexec/mysqld ....
which is currently 2523 and then:
[0:root@elmo filter.d]$ cat /proc/2523/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 31841 31841 processes
Max open files 16895 16895 files
Max locked memory 65536 unlimited bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 31841 31841 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
You can also query mariadb itself:
[0:root@elmo filter.d]$ mysql
MySQL (root@localhost) [(none)]> SHOW GLOBAL VARIABLES LIKE '%file%';
+---------------------------------------+--------------------------------------+
| Variable_name | Value |
+---------------------------------------+--------------------------------------+
| aria_log_file_size | 1073741824 |
| aria_max_sort_file_size | 9223372036853727232 |
| aria_pagecache_file_hash_size | 512 |
| character_set_filesystem | binary |
| ft_stopword_file | (built-in) |
| general_log_file | /var/log/mariadb/general.log |
| init_file | |
| innodb_buffer_pool_filename | ib_buffer_pool |
| innodb_data_file_path | ibdata1:256M;ibdata2:256M:autoextend |
| innodb_disable_sort_file_cache | OFF |
| innodb_file_format | Antelope |
| innodb_file_format_check | ON |
| innodb_file_format_max | Antelope |
| innodb_file_per_table | ON |
| innodb_log_file_size | 50331648 |
| innodb_log_files_in_group | 2 |
| innodb_max_bitmap_file_size | 104857600 |
| innodb_open_files | 8192 |
| keep_files_on_create | OFF |
| key_cache_file_hash_size | 512 |
| large_files_support | ON |
| local_infile | ON |
| lower_case_file_system | OFF |
| myisam_max_sort_file_size | 9223372036853727232 |
| open_files_limit | 16895 |
| performance_schema_max_file_classes | 50 |
| performance_schema_max_file_handles | 32768 |
| performance_schema_max_file_instances | -1 |
| pid_file | /var/run/mariadb/mariadb.pid |
| relay_log_info_file | relay-log.info |
| secure_file_priv | |
| slow_query_log_file | /var/log/mariadb/slow_query.log |
+---------------------------------------+--------------------------------------+
Try the above query with 'max%' too.
HTH,
Bill
On 1/3/2018 9:38 PM, Phil Stracchino wrote:
On 01/03/18 20:39, Voytek wrote:
On Thu, January 4, 2018 12:00 pm, Voytek wrote:
on startup it says: Jan 04 07:48:24 mysqld-scl-helper[6908]: 2018-01-04
7:48:24
139791312545920 [Warning] Changed limits: max_open_files: 1024
max_connections: 151 table_cache: 431
Jan 04 07:48:24 systemd[1]: Started MariaDB 10.2 database server.
tried editing /etc/my.cnf with, BUT, I don't think my MariaDB is reading
/etc/my.cnf, do I need my.cnf somewhere in /var/run/rh-mariadb102-mariadb/ ??
MariaDB does indeed read /etc/my.cnf, and should also read
/etc/my.cnf.d/*.cnf. Make sure that nothing in /etc/my.cnf.d/ is
overriding what you changed. Also, remember that changes in the config
files will not take effect until you restart mysqld. But many MySQL
configuration variables are dynamic and can be applied from the
MySQL/MariaDB command-line shell without restarting.
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_connections = 250
open_files_limit = 10240
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/rh-mariadb102-mariadb/mariadb.pid
open_files_limit = 10240