In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
KVM popular that is a server when more than one use, detailed introduction to Baidu and Google. First check whether the server supports virtualization [root@KVM ~] # grep-E'(vmx | svm)'/ proc/cpuinfo-- color feedback is as follows: flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov p at pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pcl mulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 Xtpr pdcm pcid dca sse4_1 sse4_ 2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm arat epb xsave opt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms remarks: if you are using VMware test build Virtualization support needs to be enabled: right-click Virtual Machine-Settings-processor-Virtualization engine preferred mode is Intel VT-x/EPT or AMD-V/RVI, and check Virtualization "Intel VT-x/EPT or AMD-V/RVI". After that, memory had better be larger than 2G CPU, preferably greater than 2. Install Ali Cloud Source wget-O / etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repoyum clean allyum makecache install KVM and check the module yum install qemu-kvm- y [root@KVM ~] # lsmod | grep kvmkvm_intel 54285 0 kvm 333172 1 kvm_intel installation management tool yum install virt-manager python-virtinst qemu-kvm-tools-yyum install libvirt libvirt-python -y physical machine configuration bridge network card [root@KVM network-scripts] # cat ifcfg-br0 DEVICE=br0TYPE=BridgeONBOOT=yesNM_CONTROLLED=noBOOTPROTO=none (can also be set to dhcp On-demand configuration) DNS2=114.114.114.114DNS1=202.106.0.20IPADDR=172.16.10.189NETMASK=255.255.255.0GATEWAY=172.16.10.1 [root@KVM network-scripts] # cat ifcfg-eth0 DEVICE=eth0TYPE=EthernetONBOOT=yesNM_CONTROLLED=noBOOTPROTO=staticBRIDGE=br0 restart network service service network restart enable route forwarding check the network configuration after completion [root@KVM ~] # ifconfigbr0 Link encap:Ethernet HWaddr 70:E2:84:08:EB:AE inet addr:172.16.10.189 Bcast: 172.16.10.255 Mask:255.255.255.0 inet6 addr: fe80::72e2:84ff:fe08:ebae/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:143000 errors:0 dropped:0 overruns:0 frame:0 TX packets:44349 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:10882563 (10.3 MiB) TX bytes : 16649590 (15.8 MiB) eth0 Link encap:Ethernet HWaddr 70:E2:84:08:EB:AE inet6 addr: fe80::72e2:84ff:fe08:ebae/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:189220 errors:0 dropped:0 overruns:0 frame:0 TX packets:77679 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX Bytes:71695893 (68.3 MiB) TX bytes:19745769 (18.8 MiB) Memory:fbe20000-fbe40000 creates an empty hard disk The hard disk equivalent to the physical machine (qcow2 format commonly used by the company) [root@KVM ~] # qemu-img create-f qcow2 / home/kvm/kvm-demo2.qcow2 100G Formatting'/ home/kvm/kvm-demo2.qcow2', fmt=qcow2 size=107374182400 encryption=off cluster_size=65536 upload disk Image / home/kvm/CentOS-6.5.iso (can be uploaded using winscp, this is a CD for installation because the bridge network card is configured. You can also use PXE or cobbler to install the system) start libvirt/etc/init.d/libvirtd start to create a new virtual machine virt-install-- virt-type kvm--name kvm-demo-- boot network,cdrom,menu=on-- ram 512-- cdrom=/home/kvm/CentOS-6.5.iso-- graphics vnc,listen=0.0.0.0-- noautoconsole-- os-type=linux-- os-variant=rhel6-- accelerate-- disk path=/home/kvm/kvm-demo.qcow2,size=5,format=qcow2 Bus=virtio-bridge=br0 Model=virtio-- autostart explains:-- virt-type kvm type-- name name-- ram memory-- Image used for cdrom=/home/kvm/CentOS-6.5.iso installation-- network Network used-disk path=/home/kvm/kvm-demo.qcow2 designated disk (previously created) to view virtual machine status through virsh list-- all [root@KVM ~] # virsh list-- all Id Name State- -- 12 kvm-demo running uses VNC to log in to view And install the machine (the VNC port starts from 5900 by default)
After logging in, you can install the machine.
Connect again after installation, and the interface is as follows
Log in to the system to view IP
At this point, the KVM virtual machine is built and can be connected using Xshell. After that, it is not much different from the ordinary server.
Common virsh directives 1) virsh list lists the current virtual machines, excluding unstarted 2) virsh list-- all lists all virtual machines Including all defined virtual machines 3) virsh destroy vm-name shutdown virtual machine 4) virsh start vm-name start virtual machine 5) virsh edit vm-name edit virtual machine xml file 6) virsh undefine vm-name delete virtual machine 7) virsh shutdown vm-name stop virtual machine 8) virsh reboot vm-name restart virtual machine 9) virsh autostart vm-name virtual machine homestay starts
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.