centos7系统优化

1. yum install net-tools #默认centos7不支持ifconfig 需要看装net-tools包;
2. 加大文件描述符数量
ulimit -SHn 1024000 
echo "ulimit -SHn 1024000" >> /etc/rc.d/rc.local 
source /etc/rc.d/rc.local
总结:
a.所有进程打开的文件描述符数不能超过/proc/sys/fs/file-max
b.单个进程打开的文件描述符数不能超过user limit中nofile的soft limit(/etc/security/limits.conf)
c.nofile的soft limit不能超过其hard limit
d.nofile的hard limit不能超过/proc/sys/fs/nr_open
3. 设置域名解析
options single-request-reopen
nameserver 10.100.11.102
nameserver 114.114.114.114
4. 关闭防火墙
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld 
开机禁用  : systemctl disable firewalld
开机启用  : systemctl enable firewalld
5. SELinux
查看SELinux状态:
/usr/sbin/sestatus -v
关闭SELinux:
1、临时关闭(不用重启机器):
setenforce 0 ##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
2.修改配置文件需要重启机器:
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可

备注:
不关闭的话可能引起的问题:
CentOS 为 vsftpd 启动 vsftpd:500 OOPS: cannot read config file: /etc/vsftpd/vsftpd.conf

posted @ 2020-07-24 22:40  Macoffee  阅读(388)  评论(0编辑  收藏  举报