avatar

1.综合架构环境准备

综合架构环境准备

1.创建一台全新虚拟机做模板机

系统:CentOS 7

内存:2G

网卡eth0:NAT模式 10.0.1.200 — 外网

网卡eth1:LAN局域网 172.16.1.200

硬盘:40G

2.安装CentOS 7 系统

添加网卡eth1:

修改网卡名称:

1
net.ifnames=0 biosdevname=0

3.优化模板机

3.1精简网卡配置文件

如果不删除,重新克隆虚拟机会导致上不了网
删除网卡里面包含UUID 的行(centos7),删除UUID和HWADDR(CentOS5和6)
清空/etc/udev/rules.d/70-persistent-net.rules(centos 5 和6)

3.2关闭防火墙和Selinux

关闭防火墙:

1
2
systemctl stop firewalld
systemctl disable firewalld

关闭selinux:

1
2
3
setenforce 0
vim /etc/selinux/config
SELINUX=disabled

3.3优化SSH连接速度慢

1
2
3
4
vim /etc/ssh/sshd_config
79 GSSAPIAuthentication no
115 UseDNS no
systemctl restart sshd.service

3.4优化命令行显示

1
2
3
vim /etc/profile
export PS1="[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$ "
source /etc/profile

3.5优化yum源为阿里源

查看yum 库信息

1
yum repolist

打开阿里源网址https://opsx.alibaba.com/mirror

选择对应版本,帮助:

1、备份

1
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

1
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、之后运行yum makecache fast生成缓存

4.安装额外包epel ,选择帮助:

1
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

3.6安装常用软件

1
yum -y install tree vim wget bash-completion bash-completion-extras lrzsz net-tools sysstat iotop iftop htop unzip telnet ntpdate

3.7配置普通用户sudo权限

1
2
# grep oldboy /etc/sudoers
oldboy ALL=(ALL) NOPASSWD: ALL

3.8配置/etc/hosts解析

1
2
3
4
5
6
7
8
9
10
11
12
vim /etc/hosts

10.0.1.5 172.16.1.5 lb01
10.0.1.6 172.16.1.6 lb02
10.0.1.7 172.16.1.7 web01
10.0.1.8 172.16.1.8 web02
10.0.1.9 172.16.1.9 web03
10.0.1.31 172.16.1.31 nfs
10.0.1.41 172.16.1.41 backup
10.0.1.51 172.16.1.51 db01
10.0.1.61 172.16.1.61 m01
10.0.1.71 172.16.1.71 zabbix

4.修改模板机IP、主机名,拍摄快照

5.克隆backup服务器

5.1. backup 41备份服务器

设置backup-41

修改backup-41的网卡信息

重启网卡服务

1
systemctl restart network

修改主机名为backup

1
hostnamectl set-hostname backup

5.2 NFS 31 服务器克隆

安装nfs -31服务器

修改nfs -31网卡信息

重启网卡服务

1
systemctl restart network

修改主机名为nfs

1
hostnamectl set-hostname nfs

6.部署完成给backup和nfs做好快照

文章作者: Wu Fei
文章链接: http://linuxwf.com/2020/04/13/1-%E7%BB%BC%E5%90%88%E6%9E%B6%E6%9E%84%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 WF's Blog
打赏
  • 微信
    微信
  • 支付宝
    支付宝

评论