centos7의 mariadb 10에서 열린 파일 제한을 늘릴 수 없습니다.
주제와 테스트 옵션에 대해 검색했지만 cpanel/whm 서버의 원격 데이터베이스 서버로 사용되는 mariadb 서버의 open-files-limit을 늘릴 수 없습니다.여기 좋은 레퍼런스 http://duntuk.com/how-raise-ulimit-open-files-and-mysql-openfileslimit가 있습니다.
로 늘렸다.
/etc/my.cnf
open-files-limit=65550
여기 몇 가지 결과가 있다
#ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63471
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65535
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
최대 사용자 프로세스(-u) 65535 가상 메모리(KB, -v) 무제한 파일 잠금(-x) 무제한
#ulimit -Hn -Sn
open files (-n) 65535
open files (-n) 65535
cat /etc/systemd/system/mariadb.service.d/limits.conf
[Service]
LimitNOFILE=65500
cat /usr/lib/systemd/system/mariadb.service
[Unit]
Description=MariaDB database server
After=syslog.target
After=network.target
[Service]
Type=simple
User=mysql
Group=mysql
LimitNOFILE=infinity
LimitMEMLOCK=infinity
그리고 여전히 mysql에서 나는 받는다.
'open%'와 같은 글로벌 변수를 표시한다.
+------------------+-------+
| Variable_name | 값 |
+------------------+-------+
| open_files_limit | 1024 |
+------------------+-------+
1열 세트(0.00초)
재시작 후 계속해서 다음 오류가 발생합니다.
60108 16:30:02 [ERROR] mysqld: Can't open file: './username_wp/wp_users.frm' (errno: 24)
160108 16:30:02 [ERROR] Error in accept: Too many open files
160108 16:30:04 [ERROR] Error in accept: Too many open files
160108 16:30:06 [ERROR] Error in accept: Too many open files
160108 16:30:11 [ERROR] mysqld: Can't open file: './username_db/strikes.frm' (errno: 24)
그리고 여기 mariadb의 스타트업 로그가 있습니다.
[Warning] Could not increase number of max_open_files to more than 1024 (request: 132107)
RH/CentOS mariadb 통합은 mariadb를 이름으로 사용하고 다른 곳에서는 mysqld를 사용하여 상당히 혼란스럽습니다.
/etc/systemd/system/mariadb에서 .conf 파일을 편집(또는 작성)해야 합니다.service.d/ (예: /etc/systemd/system/mariadb).service.d/servicon.conf 에 액세스 합니다.
그럼 kujiy가 제안하는 대로 편집해 주세요.
[Service]
LimitNOFILE=320000
systemd 서비스 파일을 새로고침하는 것을 잊지 마십시오.
# systemctl daemon-reload
세드릭
이것은 OS의 문제입니다.
'하드 리미트'를 늘려야 할 것 같아요/etc/security/limits.conf, 다음과 같습니다.
* hard nofile 65536
* soft nofile 16384
그 후ulimit"소프트 한계"를 증가시킵니다.
마침내 해결책을 찾았지만 합리적인 이유 없이! 나는 MariaDB 5.5와 모든 설정을 실행하고 있었지만, 소프트웨어 제한은 1024를 넘지 않았다! 나는 새로 설치했을 때 mariadb가 10.0이라고 생각했다.
5.5를 v10.0으로 업그레이드하려고 한 후 추가 액션이나 설정 없이 BOOM! 문제를 해결했습니다(커널 설정은 참조 링크에서 설명한 대로 최대 파일 제한을 허용합니다).
다른 사람에게도 같은 문제가 발생하기를 바랍니다(그러나 다른 모든 필수 설정을 시도한 후).
공식 지침은 마리아답에서 볼 수 있습니다.서비스 파일
[root@db1 system]# cat /usr/lib/systemd/system/mariadb.service | grep exam -A 5
# For example, if you want to increase mariadb's open-files-limit to 10000,
# you need to increase systemd's LimitNOFILE setting, so create a file named
# "/etc/systemd/system/mariadb.service.d/limits.conf" containing:
# [Service]
# LimitNOFILE=10000
공식 매뉴얼에 기재해야 한다고 생각합니다만...
공식 repo에서 CentOS 7.3과 MariaDB 10.0.29가 설치되어 있습니다.
어떤 이유로 systemd 유닛은mysql 는 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★/etc/systemd/system/mysql.service.d/oioki.conf:
[Service]
LimitNOFILE=500000
거 마systemctl daemon-reload그 후에.
open_files_limit 달라지는 입니다.
#my.cnf file
# max connections
max_connections = 64
# table_open_cache = max_connections * tables used in one transaction + 5
table_open_cache = 800
# table_definition_cache = all tables(50) + max_connections + 5
table_definition_cache = 400
# open_files_limit = table_open_cache * 1.4
open_files_limit = 1120
「 」의 값을 open_files_limitmysql에서 명령을 합니다.
mysql> select @@open_files_limit;
...출력:
+--------------------+
| @@open_files_limit |
+--------------------+
| 12903 |
+--------------------+
1 row in set (0.000 sec)
RedHat Enterprise Linux 7.2와 소프트웨어 컬렉션(SCL) 및 시스템 실행 시 이 문제가 발생하였습니다.d
rh-mariadb100-mariadb-server-10.0.20-1.el7.x86_64
내 경우 하드 리미트는 괜찮았지만 소프트 리미트는 1024로 고정되어 있었다.
신구 정리
old : RHEL6.x : MySQL : init.d : mysql_safe : 'root', mysqld : 'mysql'
new : RHEL7.x : MariaDB : SystemD : mysql_safe : 'mysql', mysqld 'mysql'
이전 initl.d 래퍼 스크립트는 루트로 실행되지만 새 SystemD 래퍼 스크립트는 'mysql'로 실행됩니다.이로 인해 mysql_safe는 ulimit에 콜을 발신하지 않을 수 있습니다.제 경우 SystemD의 LimitNOFILE 설정은 도움이 되지 않았습니다.포장지의 파일 제한을 늘렸을 뿐 데몬 자체는 그렇지 않았습니다.나는 그것을 작동시키기 위한 2단계 과정을 발견했다.
스텝 1 - mysqld_safe 섹션을 mysql_safe가 읽을 수 있도록 conf 파일에 다시 설치합니다.
sudo vi /etc/opt/rh/rh-mariadb100/my.cnf.d/mariadb-server.cnf
[mysqld_safe]
open_files_limit=2048
스텝 2 - SystemD 드롭인을 생성하여 래퍼를 루트로 시작합니다(데몬은 계속 'mysql'로 실행됩니다).LimitNOFILE은 코멘트 아웃됩니다.
/etc/systemd/system
mkdir rh-mariadb100-mariadb.service.d
cd rh-mariadb100-mariadb.service.d
vi limits.conf
[Service]
#LimitNOFILE=2048
User=
Group=
SystemD 서비스 파일 새로고침
systemctl daemon-reload
이 시점에서 서비스를 재시작하고 mysql 클라이언트의 open_files_limit 값을 확인합니다.이 값은 2048(새로운 소프트웨어 제한)이라고 표시됩니다.
적절한 해결책은 래퍼를 제거하고 네이티브 SystemD를 사용하는 것입니다.
업데이트 mysql_safe 래퍼를 더 이상 사용하지 않는 최신 버전에서 수정된 것 같습니다.
rh-mariadb101-mariadb-10.1.19-6.el7.x86_64
Centos 7의 MySQL 5.6에서 열린 파일 제한을 늘리려면 다음을 수행해야 합니다.
nano /usr/lib/systemd/system/mysqld.service
파일 끝에 추가합니다.
LimitNOFILE=65535
LimitNPROC=65535
그 후, 다음과 같이 합니다.
systemctl daemon-reload
systemctl restart mysqld
완료! MariaDB도 마찬가지일 것입니다.
/etc/systemd/system/mariadb 에 다른 파일이 없는지 확인합니다.파일 수를 제한하는 service.d 폴더.제 경우입니다만, 제가 설정한 제한을 줄이고 있는 다른 파일이 있었습니다.
언급URL : https://stackoverflow.com/questions/34686072/cannot-increase-open-files-limit-in-mariadb-10-on-centos7
'source' 카테고리의 다른 글
| dict를 초기화하기 위해 권장되는 구문은 무엇입니까(컬리 괄호 리터럴 {} 또는 dict() 함수). (0) | 2022.11.21 |
|---|---|
| MySQL 데이터베이스에 데이터를 삽입하려면 어떻게 해야 합니까? (0) | 2022.11.21 |
| 요청 - 404를 받을 수 있는지 확인하는 방법 (0) | 2022.11.21 |
| PHP의 변수에 문자열을 추가할 수 있습니까? (0) | 2022.11.21 |
| Node.js 파일 확장자를 가져옵니다. (0) | 2022.11.21 |