一、在安装的时候配置网卡名称的参数

. 选择“Install Centos ”
. 按Tab,打开kernel启动选项后,增加 net.ifnames= biosdevname=

二、最小化安装完成之后必备安装软件

# 添加epel源,安装基础软件,设置主机名
rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
yum install -y net-tools vim lrzsz tree screen lsof tcp wget tcpdump nc mtr nmap openssl-devel ntpdate
hostnamectl set-hostname linux-node1.example.com # 关闭firewalld和NetworkManager
systemctl stop firewalld
systemctl stop NetworkManager
systemctl disable firewalld
systemctl disable NetworkManager # 关闭selinux
setenforce 0
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config # 设置打开文件描述符的数量
echo "* hard nofile 65536" >> /etc/security/limits.conf
echo "* soft nofile 65536" >> /etc/security/limits.conf # 设置记录历史命令的格式
echo 'export HISTTIMEFORMAT=" %F %T `whoami` "' >> /etc/profile
source /etc/profile # 使用tables键的时候补全systemctl命令
yum install -y bash-completion # 安装killall命令
yum install -y psmisc  # 时间同步,如果没有内网时间同步可以使用公网的
crontab -e
*/5 * * * * /usr/sbin/ntpdate time1.aliyun.com

三、内核参数优化

cat /etc/sysctl.conf

# 系统优化参数
# 关闭ipv6
net.ipv6.conf.all.disable_ipv6 =
net.ipv6.conf.default.disable_ipv6 = # 避免放大攻击
net.ipv4.icmp_echo_ignore_broadcasts = # 开启恶意icmp错误消息保护
net.ipv4.icmp_ignore_bogus_error_responses = # 关闭路由转发
net.ipv4.ip_forward =
net.ipv4.conf.all.send_redirects =
net.ipv4.conf.default.send_redirects = # 开启反向路径过滤
net.ipv4.conf.all.rp_filter =
net.ipv4.conf.default.rp_filter = # 处理无源路由的包
net.ipv4.conf.all.accept_source_route =
net.ipv4.conf.default.accept_source_route = #关闭sysrq功能
kernel.sysrq = # core文件名中添加pid作为扩展名
kernel.core_uses_pid = # 开启SYN洪水攻击保护
net.ipv4.tcp_syncookies = # 修改消息队列长度
kernel.msgmnb =
kernel.msgmax = # 设置最大内存共享段大小bytes
kernel.shmmax =
kernel.shmall = # timewait的数量,默认180000
net.ipv4.tcp_max_tw_buckets =
net.ipv4.tcp_sack =
net.ipv4.tcp_window_scaling =
net.ipv4.tcp_rmem =          
net.ipv4.tcp_wmem =          
net.core.wmem_default =
net.core.rmem_default =
net.core.rmem_max =
net.core.wmem_max = # 每个网络接口接收数据包的速率比内核处理这些包的速率快时,允许送到队列的数据包的最大数目
net.core.netdev_max_backlog = # 限制仅仅是为了防止简单的DoS 攻击
net.ipv4.tcp_max_orphans = # 未收到客户端确认信息的连接请求的最大值
net.ipv4.tcp_max_syn_backlog = 262144
# 启用timewait 快速回收,需要先打开时间戳。注:(NAT的网络和负载均衡器上不能打开)
net.ipv4.tcp_timestamps =
net.ipv4.tcp_tw_recycle = #开启重用。允许将TIME-WAIT sockets 重新用于新的TCP连接
net.ipv4.tcp_tw_reuse =
net.ipv4.tcp_mem =
net.ipv4.tcp_fin_timeout = # 当keepalive 起用的时候,TCP 发送keepalive 消息的频度。缺省是2小时
net.ipv4.tcp_keepalive_time = #允许系统打开的端口范围,不建议从1024开始,因为某些端口会存在10000以内。一般情况下已够用。
net.ipv4.ip_local_port_range =     # 修改防火墙表大小,默认65536
net.netfilter.nf_conntrack_max=
net.netfilter.nf_conntrack_tcp_timeout_established= # 确保无人能修改路由表
net.ipv4.conf.all.accept_redirects =
net.ipv4.conf.default.accept_redirects =
net.ipv4.conf.all.secure_redirects =
net.ipv4.conf.default.secure_redirects =

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;
mso-font-kerning:1.0pt;}

CentOS7 初始化配置的更多相关文章

  1. CentOS7.5最小化安装与初始化配置(做标准化)

    本文分享CentOS的标准化安装配置方法,方便集群批量装机配置 ------------------------- 完美的分割线 ---------------------------- 1.安装标准 ...

  2. 新装系统(CentOS7.4)环境初始化配置笔记

    新装系统(CentOS7.4)环境初始化配置笔记 一.概述 设备详情: Dell R730 服务器 (四个网卡,一根网线插在第2个网卡上) CentOS 7.4 x64 最小安装环境 二.网络环境配置 ...

  3. CentOS7.5 系统最小化安装与初始化配置

    CentOS7.5 系统最小化安装与初始化配置 1.安装标准化的系统 1.1.系统安装期间的语言 选择:中文-简体中文,安装完成也会默认支持中文输出,便于管理 1.2.时区选择 亚洲上海,CST时区( ...

  4. Centos7 Minimal 安装后 初始化配置

    安装完成后初始化配置 1:更新yum yum upgrade 2: 安装基础命令 #yum -y install vim* lrzsz gcc-c++ pcre pcre-devel zlib zli ...

  5. vmware centos7 minimal 配置共享文件夹

    使用的是VMware安装CentOS7 minimal版,系统镜像是CentOS-7-x86_64-DVD-1708.iso. 宿主机系统为win10,CentOS7 minimal过程省略,可参考h ...

  6. virtualBox安装centos7并配置nginx php mysql运行环境

    virtualBox安装centos7并配置nginx php mysql运行环境 一:virtualBox安装centos7并进行基础设置 1.下载dvd.iso安装文件,下载地址:https:// ...

  7. CentOS7 安装配置笔记

    CentOS7 安装配置笔记 1.通过镜像安装 CentOS7 ==============================* 使用 UltraISO 9.7 或者 rufus-3.5p 制作ISO的 ...

  8. CentOS7——初始化

    CentOS7--初始化 #禁止关闭显示器 archlinux wiki 提及的方法 echo -ne "\033[9;0]" >> /etc/issue # 重启,c ...

  9. Centos7安装配置jenkins(Tomcat)

    Centos7安装配置jenkins(Tomcat) 一.准备工作 1.1 安装JDK1.8 具体安装过程不在赘述. 1.2 下载jenkins的war包 jenkins官网下载地址:https:// ...

随机推荐

  1. idea指定SpringBoot启动.properties文件

    比如我的项目下有2个.properties文件,一个是application.properties,一个是application-local.properties,在本地的时候想指定用applicat ...

  2. The expression of type Integer is unboxed into int

    问题:The expression of type Integer is unboxed into int 原因:java的包装类,方法里面要的是Integer,传入的参数确实int类型 解决方案: ...

  3. yii 验证码功能的实现

    首先知晓我们在使用验证码的时候通常是和我们的表单小部件配合使用首先我们创建model层 新建一个php文件 名字叫做Verifycode.php 要在我们的model层 创建我们的验证码的验证规则,我 ...

  4. AT89S52之串行异步通信笔记

    SRF 中断入口地址 中断源 外中断 外部中断0 INT0(P3.2) 外部中断1 INT1(P3.3) 电平方式触发 低电平 脉冲方式触发 脉冲后延的负跳 内中断 定时中断 串行中断 中断允许控制寄 ...

  5. 面向对象程序设计_tesk1_寒假伊始

    大一下学期的自我目标(要求包含对大一上学期的总结.对面向对象课程完成后学习到的能力的预期,对面向对象课程的期望.对编程和专业能力的愿景规划) 在大学的第一个学期,相信很多人都是在得过且过度过,我也不例 ...

  6. PHP设计模式系列 - 解释器模式

    解释器模式 解释器模式 用于分析一个实体的关键元素,并且针对每个元素提供自己的解释或相应动作.解释器模式非常常用,比如PHP的模板引擎 就是非常常见的一种解释器模. 代码: <?php //解释 ...

  7. luogu P4199 万径人踪灭

    嘟嘟嘟 方案:回文子序列数 - 回文子串数. 回文子串数用manacher解决就行了,关键是怎么求会问序列数. 一个比较好的\(O(n ^ 2)\)的算法:对于一个回文中心\(i\),\(O(n)\) ...

  8. Day1 MySql安装和基本操作

    数据和数据库 1.数据:客观事物的符号表示. 2.存储介质:纸,光盘,磁盘,u盘,云盘… 3.存储的目的:检索(查询) 存储数据量加大,导致检索的难度升高. 4.数据库(DB:database):按照 ...

  9. [19/05/03-星期五] GOF23_模式总结

    总结:

  10. Selenium启动最新的火狐浏览器异常排查

    报错如下: WebDriverException: Message: 'Can\'t load the profile 打开谷歌浏览器和IE浏览器均正常 网上查阅资料,疑似与selenium版本相关联 ...