In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
It is believed that many inexperienced people have no idea about how to use snapshots to make virtual machines in linux. Therefore, this paper summarizes the causes and solutions of the problems. Through this article, I hope you can solve this problem.
In daily learning, if you encounter cluster and load balancing experiments, you need to use a large number of virtual machines, if you create one by one, it is obviously very laborious and inefficient. So today I'm going to show you how to make a virtual machine with snapshots. I'll give you as much as you want ^ _ ^. As long as there is enough memory!
Making a snapshot of a virtual machine is divided into the following steps:
1. First, we need to create a stored logical volume to generate templates and snapshot files
two。 Make a template that is snapped
3. Create a snapshot.
1. Create a logical volume:
(1) fdisk / dev/sda (create a LVM logical volume, and then rescan the disk;)
(2) partx-d / dev/sda
Partx-a / dev/sda
(3) create a lv file:
Pvcreate / dev/sda
Vgcreate-s 4m vg1 / dev/sda5
Lvcreate-L 10G-n base vg1
(4) then you can make a virtual machine template:
At this point, you can install a normal virtual machine. Do the following after the restart is complete (because you are making a template, so the template should be universal)
two。 Make a template:
There are several operations to be done in the template virtual machine:
1. Close Fire Wall and selinux (modified in file):
Vim / etc/sysconfig/selinux
two。 Modify network configuration files and delete network card information:
Vim / etc/sysconfig/network-script/ifcfg-eth0
3. Modify the yum source to a stable address:
Vim / etc/yum.repos.d/yum.repo
3. Create a snapshot:
After the completion of our template has been completed, at this time on the real machine with a snapshot to take pictures of it, but before taking photos must be closed this template, usually we take pictures of people is also asked to stand still ^ _ ^.
Select our snapshot file:
Directly start vm2, instantly open, his state is the initial state of the template, very convenient.
Let's calculate the total cost:
Template (10G)
In the future, each virtual machine only needs about 4G, so a lot of virtual machines can be produced. No installation is required, and the space overhead is greatly saved.
After reading the above, have you mastered how to use snapshots to make virtual machines in linux? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.