1. 程式人生 > 實用技巧 >基礎架構01----建立虛擬機器對其優化

基礎架構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標籤->測試連線伺服器是否成功