CenOs clone virtual machine network configuration detailed steps (to solve the Internet or can not perform "service network restart" after the virtual machine clone command failed)

First, the description of the problem and the reasons

1, Issue: After a virtual machine cloning, due to inconsistencies card information problems, leading to the Internet or can not perform "service network restart" command fails

ifconfig // view the current card information
cd / etc / sysconfig / network- scripts // into the network card configuration file directory
ls // View card information card configuration file
Here Insert Picture Description

2. Analysis: Because the system after cloning, the system simply changed the name of the virtual machine and the MAC, etc., and adds a line called eth1 in /etc/udev/rules.d/70-persistent-net.rules file device name, resulting in the virtual machine can not connect properly network

Second, the solution

Ideas:
  • Modify the network configuration information
    1, modified in 70-persistent-net.rules card usage information
    2, the configuration information modifying ifcfg-eth0
  • Modify the hostname
Specific steps
Enter the command vi /etc/udev/rules.d/70-persistent-net.rules modification
i to enter edit mode to delete the contents of the first paragraph of NIC eth0, eth1 NIC name changed to modify the above eth0 esc exit edit mode, enter: wq to save and exitHere Insert Picture Description

Here Insert Picture Description

Enter the command vi / etc / sysconfig / network-scripts / ifcfg-eth0 Review
i HWADDR enter edit delete rows and rows and modify IPADDR UDID last paragraph to a new address (first three paragraphs unchanged after the election has not been used for some addresses, such as I used before is 110, is now 111) esc input : wq save and exit

Here Insert Picture Description
Here Insert Picture Description

Restart the virtual machine (VM reboot is not reboot the network configuration), see the card information has been normal

Here Insert Picture Description

In order to facilitate the build cluster, we need to modify the computer name
Enter the command vi / etc / sysconfig / network / file into the network i edit or modify the HOSTNAME (they do not conflict with existing virtual machine name on the line, I changed xiaob02) esc exit edit mode: wq to save and exit

Here Insert Picture Description
Here Insert Picture Description

Restart the virtual machine to complete all the configuration, the need to continue cloning steps, like, just like the name and modify ipaddr

Reference article: https://www.cnblogs.com/liaoyuanyang/p/6748790.html

Next build jdk environment and hadroop environment

Guess you like

Origin blog.csdn.net/xiao_xiao_b/article/details/90746140