综合架构环境准备
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 | systemctl stop firewalld |
关闭selinux:
1 | setenforce 0 |
3.3优化SSH连接速度慢
1 | vim /etc/ssh/sshd_config |
3.4优化命令行显示
1 | vim /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 | # grep oldboy /etc/sudoers |
3.8配置/etc/hosts解析
1 | vim /etc/hosts |
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做好快照
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 WF's Blog!
评论