基础架构01----创建虚拟机对其优化

集群架构系统基础环境准备

1.安装全新Centos7系统,配置网卡为eth0及eth1命名模式 200
    1.第一块网卡为NAT模式[公网环境],配置的网段为10.0.0.0网段
    2.第二块网卡为LAN模式[私网环境],配置的网段为172.16.1.0网段
    3.优化安装好的Centos7虚拟机,安装常用软件、关闭防火墙等等
2.优化步骤
        #1.配置yum仓库
rm -f /etc/yum.repos.d/*
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

        #2.安装基础软件包
yum install net-tools vim tree htop iftop gcc gcc-c++ glibc
iotop lrzsz sl wget unzip telnet nmap nc psmisc 
dos2unix bash-completion bash-completion-extra sysstat 
rsync nfs-utils httpd-tools -y

        #3.关闭防火墙firewalld
systemctl disable firewalld
systemctl stop firewalld

        #4.关闭selinux
sed -i '/^SELINUX=/c SELINUX=disabled' /etc/selinux/config

        #5.调整单个进程最大能打开文件的数量
echo '* - nofile 65535' >> /etc/security/limits.conf

3.基于优化后的虚拟机进行克隆
    1.连接克隆(需要依赖于母体)
    2.完整克隆(完完全全的复制一份,占用磁盘空间)

4.对新克隆后的主机进行如下操作:
    1.修改主机名  hostnamectl set-hostname backup
    2.修改IP地址  sed -i 's#200#41#g' /etc/sysconfig/network-scripts/ifcfg-eth[01]
    3.重启服务器
    
5.创建xshell标签->测试连接服务器是否成功


xshell无法连接虚拟机,则需排错
1.先ping虚拟机机器
2.再看看本机网卡,查看是否禁用,和网卡设置的地址是否可以连接
3.再看看虚拟机的虚拟网络编辑器
原文地址:https://www.cnblogs.com/iyy125032/p/13995070.html