CentOS作業系統基礎優化
核心優化
1
|
ECHOSTR='net.ipv4.tcp_fin_timeout = 2
|
檔案描述符
/etc/security/limits.conf
1
|
* hard nofile 65535
|
更新yum源,安裝epel源
vi /etc/yum.repo.d/CentOS-Base.repo 略
1 |
# yum install epel-release -y
|
系統時鐘同步
1
|
# yum install chrony -y
|
關閉SELinux和防火牆
1
|
if [ -f /etc/selinux/config ]; then
|
1
|
# systemctl stop firewalld
|
調整系統字符集
1
|
# echo 'export LC_ALL=C'>> /etc/profile
|
安裝基礎工具
1
|
# yum install wget net-tools telnet tree nmap sysstat lrzsz dos2unix -y
|
清華大學yum源--CentOS7
CentOS-Base.repo
#
The mirror system uses the connecting IP address of the client and the
update status of each mirror to pick mirrors that are updated to and
geographically close to the client. You should use this for CentOS updates
unless you are manually picking other mirrors.
#
If the mirrorlist= does not work for you, as a fall back you can try the
remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/releasever/os/releasever/os/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=releasever&arch=releasever&arch=basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/releasever/updates/releasever/updates/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=releasever&arch=releasever&arch=basearch&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/releasever/extras/releasever/extras/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=releasever&arch=releasever&arch=basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/releasever/centosplus/releasever/centosplus/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=releasever&arch=releasever&arch=basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7