In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
After the Ubuntu virtual machine copied by clone method starts, although the network information such as IP does not conflict with other virtual machines, it is unable to ping other virtual machines.
Create the resulting virtual machine information:
Replicated virtual machine information:
By observing the network configuration file, it is found that the name of the network card of the two virtual machines is the biggest difference. According to common sense, when there is only one network card in the system, Linux's hardware detection program will identify it as the first network card, that is, it should be displayed as the number 0 instead of 1 in the Ubuntu. This means that there should also be a network card in the copied virtual machine, but it cannot be mounted to the Ubuntu system because it is not detected, and this invisible network card is the first network card numbered 0.
After querying the hardware registration mechanism document of Ubuntu, / lib/udev/writenetrules will automatically generate a file 70-persistent-net.rules that records the hardware information of the current network card after the system is installed, which is generally stored in the directory / etc/udev/rules.d/.
Its content is roughly as follows:
* * # This file was automatically generated by the / lib/udev/writenetrulesprogram, run by the persistent-net-generator.rules rules file.You can modify it, as long as you keep each rule on a singleline, and change only the value of the NAME= key.net device () SUBSYSTEM== "net", ACTION== "add", DRIVERS== "?", ATTR {address} = = "00:0C:29:D5:2C:03", ATTR {type} = = "1", KERNEL== "eth", NAME= "eth0" *
This file records the MAC address of the network card and the corresponding device name. After Linux is powered on, the system will check whether the currently mounted device is consistent with the information recorded in the configuration file. If the input is not consistent, the relevant device will not be activated. Specifically, after Ubuntu is powered on, the device detection program finds that the MAC address of the current network card does not match the information recorded in / etc/udev/rules.d/70-persistent-net.rules, so it reserves the number 0 to the 70-persistent-net.rules recorded MAC address (although the number 0 is not mounted to the current system), assigns the number 1 to the MAC address of the current network card, and refuses to activate the current network card.
Therefore, there are two ways to solve this kind of fault: one is to modify the equipment information record in 70-persistent-net.rules, and the other is to invalidate the existing record.
If this type of failure is resolved in a production environment, it is recommended to modify the record in 70-persistent-net.rules or invalidate the record by annotating it. If it is an experimental environment or a non-important environment, you can delete the file 70-persistent-net.rules or back up by changing the file name.
After CentOS 6, CentOS changed the naming mode of the device, adopted the consistent device naming specification, and supported both biosdevname and net.ifnames specifications, so it can no longer rely on the device number to identify the network card, but the MAC address of the network card is unique in the world, so when solving this kind of fault in CentOS, the above two ideas are still valid.
After the replacement of the network card, the new network card can not be activated because of the existence of this file, delete and restart the system to activate the new network card.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.