zoukankan      html  css  js  c++  java
  • centos7.2 基础优化脚本

    #防火墙
    systemctl status iptables
    systemctl status firewalld
    systemctl stop firewalld
    systemctl disable firewalld
    systemctl status firewalld
    #selinux 关闭
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
    setenforce 0
    #打开文件数
    sed -i '/# End of file/i*		-	nofile		65535' /etc/security/limits.conf 
    cat /etc/security/limits.conf 
    ulimit -HSn 65535
    ulimit -n
    #内核参数调整
    echo 'net.ipv4.ip_forward = 1' > /etc/sysctl.conf
    echo 'net.ipv4.tcp_timestamps = 1' >> /etc/sysctl.conf
    echo 'net.ipv4.tcp_tw_recycle = 1' >> /etc/sysctl.conf
    echo 'net.ipv4.tcp_fin_timeout = 30' >> /etc/sysctl.conf
    sysctl -p
    #配置yum源为aliyun
    cd /etc/yum.repos.d
    mv CentOS-Base.repo CentOS-Base.repo.bak
    rpm -ivh http://source.zhaolibin.com/scripts/wget-1.14-10.el7_0.1.x86_64.rpm
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
    yum clean all
    yum makecache
    #修改时区同步时间
    rm -rf /etc/localtime ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime yum install ntpdate -y echo "*/5 * * * * /usr/sbin/ntpdate -d 0.asia.pool.ntp.org" >> /var/spool/cron/root

      

     

    ntpdate 0.asia.pool.ntp.org
    docker 镜像加速
    --registry-mirror=https://odhacnra.mirror.aliyuncs.com
    

      

    1. yum install ntpdate -y
    2. echo "*/5 * * * * /usr/sbin/ntpdate 0.asia.pool.ntp.org">>/var/spool/cron/root
  • 相关阅读:
    python3--shelve 模块
    python3--常用模块
    python3 时间复杂度
    Python3 正则表达式
    python--冒泡排序
    python3--正则表达式
    python3--算法基础:二维数组转90度
    python3--算法基础:二分查找/折半查找
    python3--递归
    dedecms单独调用指定文章
  • 原文地址:https://www.cnblogs.com/creazylinux/p/7365348.html
Copyright © 2011-2022 走看看