fix系统ulimit设置

pull/641/head
gjmzj 2019-06-26 12:02:27 +08:00
parent b925682d25
commit 1e4b3147bd
3 changed files with 9 additions and 11 deletions

View File

@ -49,8 +49,12 @@
shell: "sysctl -p /etc/sysctl.d/95-k8s-sysctl.conf"
ignore_errors: true
# 设置系统 ulimits
- name: 创建 systemd 配置目录
file: name=/etc/systemd/system.conf.d state=directory
- name: 设置系统 ulimits
template: src=30-k8s-ulimits.conf.j2 dest=/etc/security/limits.d/30-k8s-ulimits.conf
template: src=30-k8s-ulimits.conf.j2 dest=/etc/systemd/system.conf.d/30-k8s-ulimits.conf
- name: 把SCTP列入内核模块黑名单
copy: src=sctp.conf dest=/etc/modprobe.d/sctp.conf

View File

@ -23,12 +23,6 @@
- ipvsadm
state: present
- name: 设置 ulimits
lineinfile:
dest: /etc/profile
regexp: "ulimit -SHn"
line: "ulimit -SHn 65535"
# 优化设置 journal 日志相关,避免日志重复搜集,浪费系统资源
- name: 准备 journal 日志相关目录
file: name={{ item }} state=directory

View File

@ -1,4 +1,4 @@
* soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65536
[Manager]
DefaultLimitCORE=infinity
DefaultLimitNOFILE=100000
DefaultLimitNPROC=100000