In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Host initializes virtual machine configuration: 1 core, 2G memory, 50G hard disk, network card bridge, virtual machine opens "Virtualization intel VT-x/EPT or AMD-V/RVI" installs CentOS Linux release 7.2.1511 minimizes installation modifies network card name: quiet ifnames=0 biosdevname=0 initialization: hostname,ip,firewall off Selinux shutdown (native ip setting 192.168.2.150) install common software: yum-y install net-tools iproute vim wget lrzsz modify YumSource: wget-O / etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repowget-O / etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repokvm installation QEMU-KVM has two major functions: 1. Provide virtual 2. 0 for cpu, memory (KVM) and IO devices (QEMU). Manage the creation and calls of various virtual devices (QEMU is responsible for) Libvirt is an open source API, daemon and management tool for managing virtualization platforms. It can be used to manage KVM, Xen, VMware ESX,QEMU and other virtualization technologies virt-install is a command line tool It can be used for KVM, Xen or other hypervisor that supports libvrit API creates a virtual machine and completes GuestOS installation yum install-y qemu-kvm libvirtyum install-y virt-installsystemctl enable libvirtdsystemctl start libvirtdsystemctl status libvirtdgrep vmx / proc/cpuinfolsmod | grep kvm checks whether kvm successfully loads a copy of iso into the system / tmp/ directory to create a virtual machine image qemu-img create-f raw / opt/CentOS-7-x86_64.raw 10G create a virtual machine disk virt-install-- virt-type kvm-- name CentOS7- X861564-- ram 1024\-- cdrom=/tmp/CentOS-7-x86_64-DVD-1511.iso\-- disk path=/opt/CentOS-7-x86_64.raw\-- network network=default-- graphics\-- vnc Listen=0.0.0.0-noautoconsole uses virt-install to create a virtual machine using vnc client to connect to 192.168.2.150 vnc 5900 for system installation virsh start CentOS-7-x86_64 startup virtual machine virsh list-all view current virtual machine status modify network configuration: the default kvm virtual machine accesses the external network through nat mode For the convenience of management, you can directly use kvm virtual machine ip for management. You need to modify the network to modify the configuration of the host in bridge mode: #! / bin/bashbrctl addbr br0brctl addif br0 eth0ip addr del dev eth0 192.168.2.150/24ifconfig br0 192.168.2.150 bin/bashbrctl addbr br0brctl addif br0 eth0ip addr del dev eth0 192.168.2.150/24ifconfig br0 24 uproute add default gw 192.168.56.2 after modification, the host ip changes from eth0 to br0virsh edit CentOS7-x86_64 to edit the kvm virtual machine configuration file the original network configuration: bridge configuration is modified to restart kvm:virsh shutdown CentOS7-x86 after modification _ 64virsh start CentOS7-x86_64vnc modifies ip to the ip address of the network segment connected with the host computer after connecting to the kvm In this way, virtual machine management can be done directly with kvm ip. Note that if you execute virt-install error: ERROR host does not support any virtualization options: first check whether cpu virtualization is turned on, kvm is installed, check the log if there is a problem with the ssl version, please upgrade (version libssl.so.10). Yum install-y openssl-1.0.2k*Libvirtd stops does not affect the running of the virtual machine. Kvm can hot modify cpu, memory and other configurations online through configuration files. File path / etc/libvirt/qemu/CentOS7-x86_64.xmlvirsh edit CentOS-7-x86_64 clone virtual machine: virsh shutdown CentOS7-x86_64 closes the virtual machine virt-clone-o CentOS7-x86_64-n cent7_kvm-f / var/lib/libvirt/images/cent7_kvm.imgvirsh start cent7_kvm clone and starts a new virtual machine and modifies the ip address
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: 272
*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.