修复centos日志优化配置等

pull/505/head
gjmzj 2019-03-28 18:44:10 +08:00
parent ece94ff0b4
commit 047a0488e5
5 changed files with 26 additions and 13 deletions

View File

@ -119,6 +119,7 @@
copy: src=~/.ssh/{{ item }} dest=~/.ssh/{{ item }} mode=0600
with_items:
- id_rsa
- id_rsa.pub
- known_hosts
run_once: true
when: "ansible_env['SSH_CLIENT'].split(' ')[0] != inventory_hostname"

View File

@ -96,4 +96,5 @@
# 配置 docker 命令软链接,方便单独安装 docker
- name: 配置 docker 命令软链接
file: src={{ bin_dir }}/docker dest=/usr/bin/docker state=link
ignore_errors: true
when: "'kubeasz' not in install_info.stdout"

View File

@ -32,3 +32,14 @@
dest: /etc/selinux/config
regexp: "^SELINUX="
line: "SELINUX=disabled"
# 优化设置 journal 日志相关,避免日志重复搜集,浪费系统资源
- name: 禁止rsyslog获取journald日志
lineinfile:
dest: /etc/rsyslog.conf
state: present
regexp: 'ModLoad imjournal'
line: '#$ModLoad imjournal # provides access to the systemd journal'
- name: 重启rsyslog服务
service: name=rsyslog state=restarted

View File

@ -42,16 +42,3 @@
- name: 把SCTP列入内核模块黑名单
copy: src=sctp.conf dest=/etc/modprobe.d/sctp.conf
# 优化设置 journal 日志相关
- name: 准备 journal 日志相关目录
file: name={{ item }} state=directory
with_items:
- "/etc/systemd/journald.conf.d"
- "/var/log/journal"
- name: 优化设置 journal 日志
template: src=95-k8s-journald.conf.j2 dest=/etc/systemd/journald.conf.d/95-k8s-journald.conf
- name: 重启 journald 服务
service: name=systemd-journald state=restarted

View File

@ -28,3 +28,16 @@
dest: /etc/profile
regexp: "ulimit -SHn"
line: "ulimit -SHn 65535"
# 优化设置 journal 日志相关,避免日志重复搜集,浪费系统资源
- name: 准备 journal 日志相关目录
file: name={{ item }} state=directory
with_items:
- "/etc/systemd/journald.conf.d"
- "/var/log/journal"
- name: 优化设置 journal 日志
template: src=95-k8s-journald.conf.j2 dest=/etc/systemd/journald.conf.d/95-k8s-journald.conf
- name: 重启 journald 服务
service: name=systemd-journald state=restarted