第二十二章 系统优化
作者:互联网
系统优化
[root@qls ~]# ifconfig eth1 172.16.1.100/24
[root@qls ~]# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
[root@qls ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=none
NAME=eth1
DEVICE=eth1
ONBOOT=yes
IPADDR=172.16.1.100
PREFIX=24
#更新源
[root@qls ~]# rm -rf /etc/yum.repos.d/*
[root@qls ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@qls ~]# curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@qls ~]# ll /etc/yum.repos.d/
total 8
-rw-r--r--. 1 root root 2523 Aug 5 20:09 CentOS-Base.repo
-rw-r--r--. 1 root root 664 Aug 5 20:09 epel.repo
#关闭firewalld及selinux
[root@qls ~]# systemctl stop firewalld
[root@qls ~]# systemctl disable firewalld
[root@qls ~]# setenforce 0
[root@qls ~]# vi /etc/sysconfig/selinux
[root@qls ~]# grep 'SELINUX' /etc/sysconfig/selinux
# SELINUX= can take one of these three values:
SELINUX=disabled
#关闭NetworkManager网络
[root@qls ~]# systemctl stop NetworkManager
[root@qls ~]# systemctl disable NetworkManager
#同步时间
[root@qls ~]# crontab -l
* * * * * /usr/bin/ntpdate ntp.aliyun.com &> /dev/null
#配置文件介绍
<domain> <type> <item> <value>
<domain>表示要限制的用户
<type>设定类型
<item>表示可选的资源
<value>表示要限制的值
#加大文件描述符
[root@qls ~]# echo '* - nofile 65535 ' >>/etc/security/limits.conf
#检查结果
[root@qls ~]# tail -1 /etc/security/limits.conf
标签:repo,系统优化,qls,第二十二章,etc,sysconfig,root,eth1 来源: https://www.cnblogs.com/GAO321/p/16673232.html