Detailed explanation of KVM deployment of three virtual machines to implement WordPress experiment

Detailed explanation of KVM deployment of three virtual machines to implement WordPress experiment

1. Introduction to KVM

The abbreviation of kernel-based Virtual Machine is an open source system virtualization module that has been integrated into all major Linux distributions since Linux 2.6.20. It uses Linux's own scheduler for management, so compared to Xen, its core source code is very small. KVM has now become one of the mainstream VMMs in academia.

KVM virtualization requires hardware support (such as Intel VT technology or AMD V technology). It is a complete hardware-based virtualization. While Xen's early version was based on software-simulated Para-Virtualization, the new version is based on hardware-supported full virtualization. However, Xen itself has its own process scheduler, storage management module, etc., so the code is relatively large. The widely used commercial system virtualization software VMware ESX series is also based on software simulation Para-Virtualization.

2. Build a Flowchart

3. Content

1. Deployment and installation environment

1.1 Modify system memory

Double-click the virtual machine, and there is Edit Virtual Machine Settings on the right, click Open

1.2 Enable virtualization, set the number of processors, and check the options marked in the icon

When finished, click the OK button

2. Check the CPU instruction set, that is, check whether virtualization is enabled

Note: If vmx does not display, just restart the system.

3. Configure yum source

Note: The yum source has been configured, depending on the situation

4. Install packages related to kvm services and management requirements

Note:

qemu-kvm ---- a tool for simulating computers and providing IO devices for KVM virtual machines

libvirt ---- manage virtual machines

virt-install ---- Command line virtual machine creation and installation tool

bridge-utils ---- Bridge tools

4.2 Restart the service

4.3 Inspection

5. Create a bridge

5.1 Create http-fpm bridge

5.1.1 Enter the directory

5.1.2 Editing XML files

5.1.3 Define and generate the bridge according to the specified XML file

5.1.4 Start the httpfpm bridge

5.1.5 Setting up httpfpm bridge startup

5.2 Create php-mysql bridge

5.2.1 Enter the directory

5.2.2 Editing XML files

5.2.3 Define and generate a bridge using a specified XML file

5.2.4 Start the httpfpm bridge

5.2.5 Setting up httpfpm bridge startup

5.2.6 Check whether the bridge is started

5.3 Creating a physical bridge

5.3.1 Create a new br0 configuration file

Note: type specifies the bridge type, con-name is the configuration file connection name, ifname is the specified interface

5.3.2 Set br0's dynamic IP address to 172.18.254.39, and set the gateway and DNS to 172.18.0.1

Note: ipv4.method is to specify dynamic IP or manually set IP, ipv4.gateway is to set gateway

5.3.3 Start br0

5.3.4 Add a physical network card to br0 and specify the primary network card as br0

Note: type is bridge-slave, ifname specifies the interface as ens33, and master specifies the master device as br0

5.3.5 Enable bridge-slave network card

Note: If there is an unknown error when the network card starts, restart the virtual machine.

5.3.6 Checking the network card association

5.3.7 Viewing the bridge

6. Create a virtual disk file

6.1 Create a virtual disk file directory

6.2 Create a disk file and generate a virtual disk template

7. Download the virtual machine centos7 image

slightly

8. Install the sample machine

8.1 Create a new virtual machine

8.2 Select installation method

8.3 Add image file

8.4 Modifying Memory and Processor

8.5 Import the generated virtual disk file

8.6 Modify the virtual machine name and select the network card

8.7 Start the installation

The steps after pressing Enter are the same as those for a new installation of centos7, so I will not go into details here.

9. Configure the sample machine

9.1 Configure yum repository

9.1.1 Download yum source

9.1.2 Clear the yum cache

9.1.3 Update the yum database

9.2 Install related packages for backup

After the installation is complete, use the reboot command to shut down the virtual machine.

10. Using the sample machine as a template, create three virtual machines named httpd, mysql, and php to prepare for the implementation of WordPress.

10.1 Create a directory for placing virtual machines

Note: Because the virtual machine file is large, a new directory is created here and mounted to the hard disk. It is recommended to create a new hard disk.

10.2 Copy the sample machine to the specified directory and change the name to httpd

10.3 Enter the configuration file directory and copy the configuration file of the generated httpd virtual machine

10.4 Editing the Configuration File

10.5 Start the httpd virtual machine

After completion, create the MySQL and PHP virtual machines using the same steps as above.

10.6 Check whether the created virtual machine is started

11. Configure the httpd virtual machine

11.1 Configuring the First Network Card

11.2 Configuring the Second Network Card

11.3 Check whether the configured network card automatically generates an IP address

12. Configure PHP virtual machine

12.1 Adding a Network Card

To add a network card, select the network card, right-click, click Add Network Card, select Network, modify the network source, and then click the Finish option in the lower right corner to complete.

12.2 Modify network card parameters

12.3 Check whether the configured network card automatically generates an IP address

13. Configure the MySQL virtual machine

Check whether the configured network card automatically generates an IP address

14. Test whether virtual machines can access each other

httpd virtual machine

PHP virtual machine

mysql virtual machine

15. Build a WordPress blog based on lamp

For detailed process, please refer to the blog: http://blog.51cto.com/12948961/2307599

Due to different modules, the module order needs to be specified

1. Modify the configuration file of the http service on the httpd client

2. Specify the order of modules

result

The IP address obtained will be different depending on the network you are connecting to.

1

2

3

4

Note: Because this experiment has been done before, the prompts are different.

5

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of deploying KVM virtual machines in CentOS 7.2 (pictures and text)
  • How to install and delete virtual machines using kvm
  • How to install KVM virtual machine on centos 6.6
  • How to create and clone kvm virtual machines
  • Detailed explanation of online migration of KVM virtual machines based on local storage
  • Detailed explanation of installing Win7 virtual machine on KVM
  • Introduction to the creation, management and migration of KVM virtual machines
  • Summary of KVM virtual machine technology learning

<<:  In-depth explanation of closure in JavaScript

>>:  MySQL 5.7 installation MySQL service cannot be started but the service does not report any errors

Recommend

How to use the Linux nl command

1. Command Introduction nl (Number of Lines) adds...

How to verify whether MySQL is installed successfully

After MySQL is installed, you can verify whether ...

IE8 provides a good experience: Activities

Today I had a sneak peek at IE8 beta 1 (hereafter...

Detailed tutorial on installing Ubuntu 19.10 on Raspberry Pi 4

Because some dependencies of opencv could not be ...

jQuery implements form validation function

jQuery form validation example / including userna...

A brief introduction to MySQL InnoDB ReplicaSet

Table of contents 01 Introduction to InnoDB Repli...

How to query the minimum available id value in the Mysql table

Today, when I was looking at the laboratory proje...

React+Koa example of implementing file upload

Table of contents background Server Dependencies ...

Several ways to encrypt and decrypt MySQL (summary)

Table of contents Written in front Two-way encryp...

A brief discussion on tags in HTML

0. What is a tag? XML/HTML CodeCopy content to cl...

On Visual Design and Interaction Design

<br />In the entire product design process, ...

Example of implementing QR code scanning effects with CSS3

Online Preview https://jsrun.pro/AafKp/ First loo...

Example of how to implement local fuzzy search function in front-end JavaScript

Table of contents 1. Project Prospects 2. Knowled...