VMware安装Centos7集群环境规划之模板机

1.规划网卡名称为eth0,eth1

1.修改网卡配置文件,使之能联网 网卡是DHCP获取IP

	sed -i  ' /^ONBOOT=/c   ONBOOT=yes '  /etc/sysconfig/network-scripts/ifcfg-ens33 

2.下载阿里云源

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

2.1更新源

 	yum clean all
 	yum makecache

3.安装命令补全及网络命令及下载工具,基础软件包

	yum install -y net-tools  bash-completion  wget 
	yum install net-tools vim tree htop iotop lrzsz sl wget unzip nmap nc psmisc dos2unix bash-completion iotop iftop sysstat -y

4.修改网卡配置文件名

	mv /etc/sysconfig/network-scripts/ifcfg-{ens33,eth0} 

4.1修改网卡配置文件内容

 	sed -i 's#ens33#eth0#g'  /etc/sysconfig/network-scripts/ifcfg-eth0
 	sed -i 's#100#200#g'    /etc/sysconfig/network-scripts/ifcfg-eth0

4.2修改grub配置文件

	vim /etc/default/grub      

在文件中GRUB_CMDLINE_LINUX里添加

	net.ifnames=0 biosdevname=0 

3.3执行命令

	grub2-mkconfig -o /boot/grub2/grub.cfg

4.虚拟机添加一块网卡,IP配置为172.16.1.200/24,使用lVN网段

5.回到centos使用命令新增一个eth1的网卡配置文件

	nmcli connection add con-name eth1 ipv4.addresses 172.16.1.200/24 ipv4.method manual autoconnect yes type ethernet ifname eth1

7.关闭selinux和firewall
7.1关闭selinux
7.1.1临时关闭

	setenforce 0

7.1.2永久关闭
方法一

	sed -i 's#SELINUX=enforcing#SELINUX=disabled#g '     /etc/selinux/config

方法二

	sed -i 's#(SELINUX=).*#\1disabled#g' /etc/selinux/config

方法三

	sed -i '/^SELINUX=/c SELINUX=disabled' /etc/selinux/config
	cat /etc/selinux/config

8.2关闭防火墙firewall

	systemctl stop firewalld
	systemctl disable firewalld.service

9.检查是否满足条件

	ifconfig

10.修改文件打开数量

	echo '* - nofile 65535' >> /etc/security/limits.conf

你可能感兴趣的:(vmware装机)