Linux virtual machine system replication or cloning follow-up problem solving!

Source: Internet
Author: User

Objective

Accelerate the creation of Hadoop or spark clusters in two ways: Clone or copy. In fact, I recently returned to write this blog post, to clarify the idea.

For example, you install a virtual machine in one of your computers. A Hadoop or spark cluster has been built. In order to save time, but also for my hands-on practice this link.

  

For example, I installed it in another computer. Clone or copy the entire folder, such as Hadoopmaster, to copy the past. to a different computer. What we need to do is, MAC address and UUID changes!

Then, find, the corresponding directory, this is very simple, not much to say.

Reference:

Question: I have VMware11 on my computer, On top of a Centos6.5 virtual machine, set up a good environment, copy a good virtual machine as a new virtual machine, I am in the same computer with a VMware to open the same system, only the IP modified to the same network segment, found that only one environment can be connected with SSH, the other is not good, so think should be MAC address, etc. The same parameters result!

The solution is as follows:

Step one, modify hostname

Vi/etc/sysconfig/network

"Hostname=" Work1 ", Save exit

Vi/etc/hosts

Add a row at the end

127.0.0.1 Work1, save exit

If you want to take effect immediately, you can enter hostname Work1, or restart to take effect

Then shutdown restart (shutdown-h now) Shutdown-r now;

Or

Restarting a separate NIC can be used with this command:

Ifconfig eth0 Down

Ifconfig eth0 up

Close/Start network card ifdown eth0

Ifup Etho

Restart Network Service NIC unable to connect onboot=no in VI www.qixoo.qixoo.com/etc/sysconfig/network-scripts/ifcfg-eth0 to Yes

Step two, to the new virtual machine network card, generate a new MAC address

Because the virtual machine is copied, the MAC address is the same as the virtual machine being copied, so to modify, and to modify the hardware, you must first shut down the computer.

On the virtual machine, right-click Settings, network adapter, high-level build Mac, OK. Generate a new MAC address, such as:

Step three, modify the network card Address VI Qkxue.net/etc/udev/rules.d/70-persistent-net.rules

This file records all network card information on the current machine

According to the newly generated MAC address, find the corresponding line, the name of the network card is changed to Eth0, the other network cards are deleted.

# PCI Device 0x8086:0x100f (e1000)
#SUBSYSTEM = = "NET", action== "Add", drivers== "? *", attr{address}== "00:0c:29:b9:30: #59", attr{type}== "1", kernel== "eth * ", name=" eth0 "

# PCI Device 0x8086:0x100f (e1000)
subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:50:56:25:d4:58", attr{type}== "1", kernel== "eth*" , name= "Eth0"

Save exit, after Vi/etc/sysconfig/network-scripts/ifcfg-eth0, the file records the details of the first NIC Eth0

Change the UUID to a number, make sure it is different from the original system, and then change the hwaddr to the newly generated MAC address and save the exit.

Reboot system Shutdown-r now; Enter the system, everything OK.

Step Four, note

If both systems are booted at the same time on VMware, the other system will be restarted.

Shutdown-r now

If the above steps are not yet available, try the following

In the/etc/sysconfig/network-scripts/ifcfg-eth0, keep only

DEVICE (What it is, what it is, not modifying it)
Onboot (What it is, what it is, not modifying it)
TYPE (What it is, what it is, not modified)
IPADDR (Original is 128, then modify 218)
NETMASK (What it is, what it is, not modifying it)
Bootproto=none

Next

OK, boot try, no address on the service network restart, dhclient, then IP A.

After that, you can modify it to static IP.

Original virtual machine

A virtual machine that succeeds and does a follow-up problem after replication or cloning

Of course, here we can again, will eth1, modify back to eth0.

Linux virtual machine system replication or cloning follow-up problem solving!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.