虚拟机克隆,并设置新的ip

6.1克隆新的虚拟机

选中某个虚拟机-à右键à管理à克隆

虚拟机克隆,并设置新的ip

选择下一步

虚拟机克隆,并设置新的ip

选择下一步

虚拟机克隆,并设置新的ip

虚拟机克隆,并设置新的ip

点击完成

6.2修改主机名

[root@hadoop3 ~]# vim/etc/sysconfig/network

将文件中的HOSTNAME改成hadoop3

虚拟机克隆,并设置新的ip

重新登录

6.3修改vi /etc/udev/rules.d/70-persistent-net.rules中的内容

留下最后一行,并且把最后的eth1改成eth0

虚拟机克隆,并设置新的ip

6.4.修改ip

命令是:vim /etc/sysconfig/network-scripts/ifcfg-eth0

[root@hadoop ~]# vim/etc/sysconfig/network-scripts/ifcfg-eth0

修改内容如下:

虚拟机克隆,并设置新的ip

删除HWADDR,删除UUID,修改IPADDR的ip值。

6.5关闭防火墙

service iptables stop

让下次启动的时候不自动启动防火墙

chkconfig iptables off

如果直接向通过主机名的方式连接,需要做如下配置

C:\Windows\System32\drivers\etc\hosts

# localhost name resolution is handled within DNS itself.

#       127.0.0.1       localhost

#       ::1             localhost

192.168.106.80      hadoop

192.168.106.81      hadoop2

192.168.106.82      hadoop3

配置完成之后在cmd中ping hadoop,结果如下:

虚拟机克隆,并设置新的ip

上一篇:ELK安装配置及nginx日志分析


下一篇:【Linux】nginx常用命令