Skip to content

部署/调优系统环境

shell
setenforce 0
sed -i "s#SELINUX=enforcing#SELINUX=disabled#g" /etc/selinux/config
shell
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
shell
systemctl stop firewalld
systemctl disable firewalld
shell
yum install vim nc wget psmisc gcc-c++ gcc lrzsz telnet net-tools cifs-utils ntpdate bash-completion sysstat iotop iftop htop unzip tar nmap bc bind-utils nethogs nfs-utils network-scripts -y
shell
yum -y update
shell
cat >> /etc/security/limits.conf << eof
root soft nofile 65535
root hard nofile 65535
root soft nproc 65535
root hard nproc 65535
root soft core unlimited
root hard core unlimited
* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535
* soft core unlimited
* hard core unlimited
eof
shell
cd /etc/security/limits.d/
rm -rf  *-nproc.conf
shell
#设置时间为东八区,上海时间
timedatectl set-timezone Asia/Shanghai

#如果时间不是24H小时制,可修改
echo "export LC_TIME=zh_CN.UTF-8" >> /etc/profile

source /etc/profile  #生效


#时间同步
#Ansible: ntpdate
0 */1 * * * ntpdate -u time1.aliyun.com
最近更新

采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 运维小弟