1.centos网络配置
hadoop100: 192.168.2.100 192.168.2.1(网关)
hadoop101: 192.168.2.101 192.168.2.1(网关)
hadoop102: 192.168.2.102 192.168.2.1(网关)
- VMnet8-> 设置子网IP 192.168.2.0
- DHCP设置起始192.168.2.100和结束地址192.168.2.254
- NAT设置网关192.168.2.1(用于搭建局域网,在同一网关)
2.windows网络设置:
网络中心>适配器设置>vmNET8>IPV4>配置网关(192.168.2.1)和ip(虚拟机ip)192.168.2.2
3.centos网卡
vi /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.2.100
GATEWAY=192.168.2.1
BROADCAST=192.168.2.255
//加入域名解析
DNS1=114.114.114.114
DNS2=8.8.8.8
保存配置文件,并重启网络服务
service network restart;
4.通过网络名访问虚拟机
centos:
vi /etc/hosts
追加 192.168.2.100 hadoop100
windows:
C:\Windows\System32\drivers\etc\hosts
追加 192.168.2.100 hadoop100
5.关闭centos防火墙
6.与宿主机时间同步
安装ntp插件
yum -y install ntp ntpdate
ntpdate cn.pool.ntp.org从网站同步时间
hwclock –systohc将系统时间写入硬盘
7.使用XShell连接centOS7
安装 lrzsz 插件 ,实现ftp上传文件功能
yum -y install lrzsz