diff --git a/docs/en/docs/StratoVirt/StratoVirt_Intoduction.md b/docs/en/docs/StratoVirt/StratoVirt_Intoduction.md index bc44873fff00157f1bdcde689bba13353c711cf2..d446616b3a88fab65e481e380324cd884209d658 100644 --- a/docs/en/docs/StratoVirt/StratoVirt_Intoduction.md +++ b/docs/en/docs/StratoVirt/StratoVirt_Intoduction.md @@ -12,15 +12,16 @@ StratoVirt reserves component-based assembling capabilities and APIs for archite StratoVirt core architecture consists of three layers from top to bottom: -- OCI campability API: compatible with the QEMU Machine Protocol (QMP) and has complete OCI compatibility capabilities. -- BootLoader: discards the traditional BIOS plus GRUB boot mode and implements a lighter and faster bootloader. -- MicroVM: At the virtualization layer, the software and hardware collaboration capability is fully used to simplify the device model with low-latency resource scaling capability. +- External API: compatible with the QMP(QEMU Monitor Protocol) and has complete OCI compatibility capabilities. Meanwhile, StratoVirt can be managed by libvirt too. +- BootLoader: abandon the traditional BIOS+GRUB boot mode to achieve fast boot in lightweight scenarios, and provide UEFI boot support for standard VM. +- Emulated mainboard: + - microvm: At the virtualization layer, the software and hardware collaboration capability is fully used to simplify the device model with low-latency resource scaling capability. + - standard VM: realize UEFI boot with constructed ACPI tables. Virtio-pci and VFIO devices can be attached to greatly improve the I/O performance. The overall architecture is shown in **Figure 1**. **Figure 1** Overall architecture of StratoVirt -![](./figures/arc.png) - +![](./figures/StratoVirt_architecture.png) diff --git a/docs/en/docs/StratoVirt/figures/StratoVirt_architecture.png b/docs/en/docs/StratoVirt/figures/StratoVirt_architecture.png new file mode 100644 index 0000000000000000000000000000000000000000..e46e1f0bd2673ddf65794ced63885e2579a14325 Binary files /dev/null and b/docs/en/docs/StratoVirt/figures/StratoVirt_architecture.png differ diff --git a/docs/en/docs/StratoVirt/figures/arc.png b/docs/en/docs/StratoVirt/figures/arc.png deleted file mode 100644 index baf5526d077a452c9d8a18af38638c8db9150d27..0000000000000000000000000000000000000000 Binary files a/docs/en/docs/StratoVirt/figures/arc.png and /dev/null differ diff --git a/docs/en/docs/desktop/HAuserguide.md b/docs/en/docs/desktop/HAuserguide.md new file mode 100644 index 0000000000000000000000000000000000000000..771d9945e8452227d1adc86f148e8ef0ce033a28 --- /dev/null +++ b/docs/en/docs/desktop/HAuserguide.md @@ -0,0 +1,358 @@ +# Installing, Deploying, and Using HA + + +- [Installing, Deploying, and Using HA](#ha的安装部署与使用) + - [Installation and Configuration](#安装与配置) + - [Modifying the Host Name and the /etc/hosts File](#修改主机名称及etchosts文件) + - [Configuring the Yum Source](#配置yum源) + - [Installing HA Software Package Components](#安装ha软件包组件) + - [Setting the hacluster User Password](#设置hacluster用户密码) + - [Modifying the `/etc/corosync/corosync.conf` File](#修改etccorosynccorosyncconf文件) + - [Managing Services](#管理服务) + - [Disabling the Firewall](#关闭防火墙) + - [Managing the pcs Service](#管理pcs服务) + - [Managing the pacemaker Service](#管理pacemaker服务) + - [Managing the corosync Service](#管理corosync服务) + - [Performing Node Authentication](#节点鉴权) + - [Accessing the Front-End Management Platform](#访问前端管理平台) + - [Quick User Guide](#快速使用指南) + - [Login Page](#登陆页面) + - [Home Page](#主页面) + - [Managing Nodes](#节点鉴权) + - [Node](#节点) + - [Preference Setting](#首选项配置) + - [Adding Resources](#添加资源) + - [Adding Common Resources](#添加普通资源) + - [Adding Group Resources](#添加组资源) + - [Adding Clone Resources](#添加克隆资源) + - [Editing Resources](#编辑资源) + - [Setting Resource Relationships](#设置资源关系) + - [ACLS](#acls) + + + + +## Installation and Configuration + +- Environment preparation: At least two physical machines or VMs with openEuler 20.03 LTS SP2 installed are required. (This section uses two physical machines or VMs as an example.) For details, see the *openEuler 20.03 LTS SP2 Installation Guide*. + +### Modifying the Host Name and the /etc/hosts File + +- **Note: You need to perform the following operations on both hosts. The following takes the operation on one host as an example.** + +Before using the HA software, ensure that the host name has been changed and all host names have been written into the **/etc/hosts** file. + +- Run the following command to change the host name: + +``` +# hostnamectl set-hostname ha1 +``` + +- Edit the **/etc/hosts** file and write the following fields: + +``` +172.30.30.65 ha1 +172.30.30.66 ha2 +``` + +### Configuring the Yum Source + +After the system is successfully installed, the Yum source is configured by default. The file location information is stored in the `/etc/yum.repos.d/openEuler.repo` file. The HA software package uses the following sources: + +``` +[OS] +name=OS +baseurl=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/OS/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/OS/$basearch/RPM-GPG-KEY-openEuler + +[everything] +name=everything +baseurl=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/everything/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/everything/$basearch/RPM-GPG-KEY-openEuler + +[EPOL] +name=EPOL +baseurl=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/EPOL/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/OS/$basearch/RPM-GPG-KEY-openEuler +``` + +### Installing HA Software Package Components + +``` +# yum install corosync pacemaker pcs fence-agents fence-virt corosync-qdevice sbd drbd drbd-utils -y +``` + +### Setting the hacluster User Password + +``` +# passwd hacluster +``` + +### Modifying the `/etc/corosync/corosync.conf` File + +``` +totem { + version: 2 + cluster_name: hacluster + crypto_cipher: none + crypto_hash: none +} +logging { + fileline: off + to_stderr: yes + to_logfile: yes + logfile: /var/log/cluster/corosync.log + to_syslog: yes + debug: on + logger_subsys { + subsys: QUORUM + debug: on + } +} +quorum { + provider: corosync_votequorum + expected_votes: 2 + two_node: 1 + } +nodelist { + node { + name: ha1 + nodeid: 1 + ring0_addr: 172.30.30.65 + } + node { + name: ha2 + nodeid: 2 + ring0_addr: 172.30.30.66 + } + } +``` + +### Managing Services + +#### Disabling the Firewall + +``` +# systemctl stop firewalld +``` + +Change the status of SELINUX in the **/etc/selinux/config** file to **disabled**. + +``` +# SELINUX=disabled +``` + +#### Managing the pcs Service + +- Run the following command to start the **pcs** service: + +``` +# systemctl start pcsd +``` + +- Run the following command to query service status: + +``` +# systemctl status pcsd +``` + +The service is started successfully if the following information is displayed: + +![](./figures/HA-pcs.png) + +#### Managing the pacemaker Service + +- Run the following command to start the **pacemaker** service: + +``` +# systemctl start pacemaker +``` + +- Run the following command to query service status: + +``` +# systemctl status pacemaker +``` + +The service is started successfully if the following information is displayed: + +![](./figures/HA-pacemaker.png) + +#### Managing the corosync Service + +- Run the following command to start the **corosync** service: + +``` +# systemctl start corosync +``` + +- Run the following command to query service status: + +``` +# systemctl status corosync +``` + +The service is started successfully if the following information is displayed: + +![](./figures/HA-corosync.png) + +### Performing Node Authentication + +- **Note: Perform this operation on only one node.** + +``` +# pcs host auth ha1 ha2 +``` + +### Accessing the Front-End Management Platform + +After the preceding services are started, open the browser (Chrome or Firefox is recommended) and enter `https://IP:2224` in the address box. + +## Quick User Guide + +### Login Page + +The username is `hacluster` and the password is the one set on the host. + +![](./figures/HA-login.png) + +### Home Page + +The home page is the **MANAGE CLUSTERS** page, which includes four functions: remove, add existing, destroy, and create new clusters. + +![](./figures/HA-home-page.png) + +### Managing Nodes + +#### Node + +You can add and remove nodes. The following describes how to add an existing node. + +![](./figures/HA-existing-nodes.png) + +Node management includes the following functions: start, stop, restart, standby, maintenance, and configure Fencing. You can view the enabled services and running resources of the node and manage the node. + +![](./figures/HA-node-setting1.png) ![](./figures/HA-node-setting2.png) + +### Preference Setting + +You can perform the following operations using command lines. The following is a simple example. Run the `pcs --help` command to query more commands available. + +``` +# pcs property set stonith-enabled=false +# pcs property set no-quorum-policy=ignore +``` + +Run the `pcs property` command to view all settings. + +![](./figures/HA-firstchoice-cmd.png) + +- Change the default status of **No Quorum Policy** to **ignore**, and the default status of **Stonith Enabled** to **false**, as shown in the following figure: + +![](./figures/HA-firstchoice.png) + +#### Adding Resources + +##### Adding Common Resources + +The multi-option drop-down list box in the system supports keyword matching. You can enter the keyword of the item to be configured and quickly select it. + +Apache and IPaddr are used as examples. + +Run the following commands to add the Apache and IPaddr resources: + +``` +# pcs resource create httpd ocf:heartbeat:apache +# pcs resource create IPaddr ocf:heartbeat:IPaddr2 ip=172.30.30.67 +``` + +Run the following command to check the cluster resource status: + +``` +# pcs status +``` + +![](./figures/HA-pcs-status.png) + +![](./figures/HA-add-resource.png) + +- Add Apache resources. + +![](./figures/HA-apache.png) + +- The resources are successfully added if the following information is displayed: + +![](./figures/HA-apache-suc.png) + +- The resources are created and started successfully, and run on a node, for example, **ha1**. The Apache page is displayed. + +![](./figures/HA-apache-show.png) + +- Add IPaddr resources. + +![](./figures/HA-ipaddr.png) + +- The resources are successfully added if the following information is displayed: + +![](./figures/HA-ipaddr-suc.png) + +- The resources are created and started successfully, and run on a node, for example, **ha1**. The HA web login page is displayed, and you can log in to the page and perform operations. When the resources are switched to **ha2**, the web page can still be accessed. + +![](./figures/HA-ipaddr-show.png) + +##### Adding Group Resources + +When you add group resources, at least one common resource is needed in the cluster. Select one or more resources and click **Create Group**. + +- **Note: Group resources are started in the sequence of subresources. Therefore, you need to select subresources in sequence.** + +![](./figures/HA-group.png) + +The resources are successfully added if the following information is displayed: + +![](./figures/HA-group-suc.png) + +##### Adding Clone Resources + +![](./figures/HA-clone.png) + +The resources are successfully added if the following information is displayed: + +![](./figures/HA-clone-suc.png) + +#### Editing Resources + +- **Enable**: Select a target resource that is not running from the resource node list. Enable the resource. +- **Disable**: Select a target resource that is running from the resource node list. Disable the resource. +- **Clearup**: Select a target resource from the resource node list and clear the resource. +- **Porting**: Select a target resource from the resource node list. The resource must be a common resource or group resource that is running. You can port the resource to a specified node. +- **Rollback**: Select a target resource from the resource node list. Before rolling back a resource, ensure that the resource has been ported. You can clear the porting settings of the resource and roll the resource back to the original node. After you click the button, the status of the resource item in the list is the same as that when the resource is enabled. +- **Remove**: Select a target resource from the resource node list and remove the resource. + +You can perform the preceding resource operations on the page shown in the following figure: + +![](./figures/HA-resoure-set.png) + +#### Setting Resource Relationships + +The resource relationship is used to set restrictions for target resources. Resource restrictions are classified as follows: **resource location**, **resource colocation**, and **resource ordering**. + +- **Resource location**: Set the runlevel of nodes in the cluster to determine the node where the resource runs during startup or switchover. The runlevels are Master and Slave in descending order. +- **Resource colocation**: Indicate whether the target resource and other resources in the cluster are running on the same node. For resources on the same node, the resource must run on the same node as the target resource. For resources on mutually exclusive nodes, the resource and the target resource must run on different nodes. +- **Resource ordering**: Set the ordering in which the target resource and other resources in the cluster are started. The preamble resource must run before the target resource runs. The postamble resource can run only after the target resource runs. + +After adding common resources or group resources, you can perform the preceding resource operations on the page shown in the following figure: + +![](./figures/HA-resource-relationship.png) + +#### ACLS + +ACLS is an access control list. You can click **Add** to add a user and manage the user access. + +![](./figures/HA-ACLS.png) \ No newline at end of file diff --git a/docs/zh/docs/A-Ops/overview.md b/docs/zh/docs/A-Ops/overview.md new file mode 100644 index 0000000000000000000000000000000000000000..cd3fe77186fcd48076a6a4aefd9d43442d95194a --- /dev/null +++ b/docs/zh/docs/A-Ops/overview.md @@ -0,0 +1,3 @@ +# A-Ops用户指南 + +本文介绍A-Ops智能运维框架以及智能定位、配置溯源等服务的安装与使用方法,使用户能够快速了解并使用A-Ops。用户能够借由A-Ops降低系统集群的运维成本,实现系统故障快速定位、配置项统筹管理等功能。 diff --git a/docs/zh/docs/Embedded/embedded.md b/docs/zh/docs/Embedded/embedded.md new file mode 100755 index 0000000000000000000000000000000000000000..4a1edc5df3d8343bb312c70d3245c39259a23dc7 --- /dev/null +++ b/docs/zh/docs/Embedded/embedded.md @@ -0,0 +1,131 @@ +本文档主要用于说明如何使用基于openEuler的面向嵌入式场景的版本。该版本的构建由Yocto完成,具体信息请参考[SIG-Yocto](https://gitee.com/openeuler/community/tree/master/sig/sig-Yocto) + +# 获取镜像 +openEuler已经预先构建了相应的镜像,支持arm和aarch64两种架构,并选择了qemu作为硬件开发板的承载,可以通过如下链接获得相应的镜像 + +- [qemu_arm](https://gitee.com/beilingxie/yocto-embedded-tools/tree/images/qemu-arm) +- [qemu_aarch64](https://gitee.com/beilingxie/yocto-embedded-tools/tree/images/qemu-aarch64) + +相应镜像的的基本信息如下: + +| 镜像类型 | 支持架构 | 开发板信息 | +| ------ | ------ | -----| +| qemu_arm | arm (32位, ARM Cortex A15) | 'virt' generic virtual platform | +| qemu_aarch64 | aarch64 (64位, ARM Cortex A57) | 'virt' generic virtual platform | + +使用者可以在QEMU的通用虚拟平台(virt)上,分别体验32位ARM架构和64位ARM架构下的嵌入式Linux开发 + +## 镜像内容 +每一类镜像又由3个部分组成,其相关信息如下: +| 镜像类型 | 名称 | 说明 | +| ------ | ------ | -----| +| 内核镜像 | zImage | 基于openEuler的linux 5.10内核镜像 | +| 极简根文件系统镜像 | initrd_tiny | 极简化的根文件系统镜像,只包含基本功能 | +| 标准根文件系统镜像 | initrd | 标准的根文件系统镜像,包含标准功能 | + +每次运行时,根据需要,选择内核镜像和相应的根文件系统镜像。 + +- 内核镜像 + - 内核的相关功能可参见如下配置 + - [arm(cortex a15)](https://gitee.com/openeuler/yocto-embedded-tools/blob/openEuler-21.09/config/arm/defconfig-kernel) + - [arm(cortex a57)](https://gitee.com/openeuler/yocto-embedded-tools/blob/openEuler-21.09/config/arm64/defconfig-kernel), 针对aarch64架构,额外增加了镜像自解压功能,可以参见相应的[patch](https://gitee.com/openeuler/yocto-embedded-tools/blob/openEuler-21.09/patches/arm64/0001-arm64-add-zImage-support-for-arm64.patch) +- 简化根文件系统(initrd_tiny) + - 包含功能:busybox, 基本的glibc库 + - 说明:虽然功能简单,但也只有很小的内存消耗,适合进行Linux内核的相关探索 +- 正常根文件系统(initrd) + - 包含功能:audit, cracklib,OpenSSH, Linux PAM,shadow, iSula容器 + - 说明:在简化根文件系统的基础之上,增加了安全加固、OpenSSH、iSula容器等功能,适合进行更加丰富的功能探索 + +# 运行镜像 + +建议使用QEMU5.0以上版本运行镜像,由于一些额外功能(网络、共享文件系统)需要依赖QEMU的virtio-net, virtio-fs等特性,如未在QEMU中使能,则运行是可能会产生错误,此时可能需要从源码重新编译QEMU。 + +运行镜像时,建议把内核镜像和根文件系统镜像放在同一目录下,后续说明以正常根文件系统为例(initrd) + +## 基本运行 + +基本运行时,qemu未使能网络和共享文件系统,使用者只能使用基本功能 + +arm +```sh +qemu-system-arm -M virt-4.0 -cpu cortex-a15 -nographic -kernel zImage -initrd initrd +``` +aarch64 +```sh +qemu-system-aarch64 -M virt-4.0 -cpu cortex-a57 -nographic -kernel zImage -initrd initrd +``` + +由于标准根文件系统镜像进行了安全加固,因此第一次启动时,需要为登录用户名root设置密码,且密码强度有相应要求, 需要数字、字母、特殊字符组合,例如openEuler@2021 + +## 使能共享文件系统 +通过共享文件系统,使得宿主机(host)和客户机(guest)共享文件,这样在宿主机上交叉编译的程序,拷贝到共享目录中,即可在客户机上运行 + +arm +```sh +qemu-system-arm -M virt-4.0 -cpu cortex-a15 -nographic -kernel zImage -initrd initrd -device virtio-9p-device,fsdev=fs1,mount_tag=host -fsdev local,security_model=passthrough,id=fs1,path=/tmp +``` +aarch64 +```sh +qemu-system-aarch64 -M virt-4.0 -cpu cortex-a57 -nographic -kernel zImage -initrd initrd -device virtio-9p-device,fsdev=fs1,mount_tag=host -fsdev local,security_model=passthrough,id=fs1,path=/tmp +``` + +此处选择宿主机的/tmp目录作为共享目录 + +在客户机启动并登录之后,需要运行如下命令,映射(mount)共享文件系统 +```sh +cd /tmp +mkdir host +mount -t 9p -o trans=virtio,version=9p2000.L host /tmp/host +``` +即把共享文件系统映射到客户机的/tmp/host目录下 + +## 使能网络 +通过qemu的virtio-net和宿主机上的虚拟网卡和网桥,可以使客户机访问网络 + +arm +```sh +qemu-system-arm -M virt-4.0 -cpu cortex-a15 -nographic -kernel zImage -initrd initrd -device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=/etc/qemu-ifup +``` +aarch64 +```sh +qemu-system-aarch64 -M virt-4.0 -cpu cortex-a57 -nographic -kernel zImage -initrd initrd -device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=/etc/qemu-ifup +``` + +在宿主机上需要建立名为tap0的虚拟网卡, 可以借助/etc/qemu-ifup脚本实现,其执行需要root权限,具体内容如下: + +```sh +#!/bin/bash +ifconfig $1 172.10.10.1 up +``` +通过qemu-ifup脚本,宿主机上将创建名为tap0的虚拟网卡,地址为172.10.10.1.客户机登陆后,执行如下命令: +```sh +ifconfig eth0 172.10.10.2 +``` +之后,宿主机和客户机就可以通过网络联通。如需客户机借助宿主机访问互联网,则需要在宿主机上建立网桥,此处不详述,如有需要,请自行查阅相关资料。 + +# 开发 + +## 环境准备 +当前镜像采用的linaro arm/aarch64 gcc 7.3.1工具链构建的,可以从如下链接中获取相应工具链: +- [linaro arm](https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabi/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi.tar.xz) +- [linrao arm sysroot](https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabi/sysroot-glibc-linaro-2.25-2018.05-arm-linux-gnueabi.tar.xz) +- [linaro aarch64](https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz) +- [linrao aarch64 sysroot](https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/sysroot-glibc-linaro-2.25-2018.05-aarch64-linux-gnu.tar.xz) + +## 用户态程序 +以构建一个hello.c为例,运行在aarch64正常根文件系统中,源码如下: +```c +#include + +int main(void) +{ + printf("hello openEuler\r\n"); +} +``` +然后使用对应的工具链编译, 相应命令如下: +```sh +export PATH=$PATH: +aarch64-linux-gnu-gcc --sysroot= hello.c -o hello +mv hello /temp +``` +把交叉编译好的hello程序拷贝到/tmp目录下,然后参照使能共享文件系统中的描述,使得客户机可以访问宿主机的目录,然后可以在客户机上运行hello。 diff --git "a/docs/zh/docs/Releasenotes/\345\205\263\351\224\256\347\211\271\346\200\247.md" "b/docs/zh/docs/Releasenotes/\345\205\263\351\224\256\347\211\271\346\200\247.md" index 2b3c4af2ac32fdee3a9d0d0b2b8aa41ce7ec2ad0..6ee6843b070ba47b303ff9bd96a834bcd4a42d03 100644 --- "a/docs/zh/docs/Releasenotes/\345\205\263\351\224\256\347\211\271\346\200\247.md" +++ "b/docs/zh/docs/Releasenotes/\345\205\263\351\224\256\347\211\271\346\200\247.md" @@ -1,171 +1,96 @@ # 关键特性 -## 全新的5.10内核 +## openEuler 21.09基于 Linux Kernel 5.10内核构建, 在进程调度、内存管理等方面带来10余处创新 深度优化调度、IO、内存管理,提供Arm64、x86、RISC-V等更多算力支持。 -- **调度器优化**,优化了 CFS Task 的公平性,新增 numa aware 异步调用机制,在 NVDIMM 初始化方面有明显的提升;优化 SCHED_IDLE 的调度策略,显著改善高优先级任务的调度延迟,降低对其他任务的干扰。 +- **内核动态抢占**,新增启动选preempt=none/voluntary/full,允许内核动态切换抢占模式。 -- **numa balancing 机制优化**,带来更好的亲和性、更高的使用率和更少的无效迁移。 +- **mremap性能优化**,通过移动 PMD/PUD 级别的表项,加速映射大块内存的速度。 -- **CPU 隔离机制增强**,支持中断隔离,支持 unbound kthreads 隔离,增强 CPU 核的隔离性,可以更好的避免业务间的相互干扰。 +- **per memcg lru lock**,采用per memcg lru_lock,减少云原生容器实例锁竞争,提升系统性能。 -- **cgroup单线程迁移性能优化**,消除对 thread group 读写信号量的依赖;引入Time Namespaces 使容器迁移更方便。 +- **大页内存管理优化**,通过共享映射方式将HugeTLB管理页中无实际作用的tail页释放掉,从而降低管理结构的开销,降低大页管理自身内存占用。 -- **系统容器限制容器内使用文件句柄数能力支持**,文件句柄包括普通文件句柄和网络套接字,启动容器时,可以通过指定`--files-limit`参数限制容器内打开的最大句柄数。 +- **TLB并发刷新支持**,本地TLB和远端TLB刷新并行,优化TLB shootdown流程加速TLB刷新,提升业务性能。 -- **PSI 能力支持**,PSI (Pressure Stall Information)提供了一种评估系统资源如 CPU、Memory、IO 压力的方法。准确的检测方法可以帮助资源使用者确定合适的工作量,同时也可以帮助系统制定高效的资源调度策略,最大化利用系统资源,最大化改善用户体验。 +- **大页vmalloc性能优化**,对于超过huge page的最小size的空间进行vmalloc()分配时,将会尝试使用 huge page 而不是 base page来映射内存,可以大大改善 TLB 的利用,降低TLB miss。 -- **进程间通信优化**,pipe/epoll_wait 唤醒机制优化,解决唤醒多个等待线程的性能问题。 -- **内存管理增强**,精细化内存控制、统计,异构内存,热插拔、内存初始化等功能均有改善,并提供更有效的用户控制接口; 热点锁及信号量优化,激进内存规整和碎片整理,优化vmap/vmalloc机制,显著提升内存申请效率提升; KASAN、kmemleak、slub_debug、oom等内存维测特性增强,提升内存问题定位及解决效率。 -- **Early Departure Time模型切换**,解决了原来发包过程中TCP框架的限制,根据调度策略给数据包设置EDT时间戳,避免大的队列缓存带来的时延,带来tcp性能的较大提高。 +## 新介质文件系统 +- **Eulerfs**,Eulerfs创新元数据软更新技术(Soft Update),基于指针的目录双视图计数机制,减少元数据同步开销,有效提升文件系统create、unlink、mkdir、rmdir系统调用性能。 -- **MultiPath TCP 支持**,可在移动与数据场景提升性能和可靠性,支持在负载均衡场景多条子流并行传输。 - -- **日志 fast commit 方法引入**,EXT4 引入了新的、更轻量级的日志方法 `-fast commit`,可以大大加快 `fsync` 等耗时较长的操作,带来更好的性能。 - -- **支持dm writecache 特性**,提升 SSD 大块顺序写性能,提高 DDR 持久性内存的性能。 - -- **支持 io_uring**, io_uring 是一个新的异步IO框架和实现,支持 polling 模式,在polling模式下,性能提升显著,与spdk接近,在队列深度较高时性能更好。 - -- **支持 ILP32**, 在鲲鹏920 Arm64 环境上支持 32 位的应用程序。 - -- **IMA 商用增强**,在开源 IMA 方案基础上,增强安全性、提升性能、提高易用性,助力商用落地。 - -- **支持 per task 栈检查**,增强对 ROP 攻击的防护能力。 - -- **MPAM资源管控**,支持 Arm64架构Cache QoS 以及内存带宽控制技术。 - -- **支持基于 SEDI 的 NMI 机制和基于 PMU 的 NMI 机制**,使能 hard lockup 检测;使能 perf nmi,能更精确的进行性能分析。 - -- **Arm64 平台支持虚拟机 CPU 热插拔**,提高资源配置的灵活性。 - -- **Arm64 kdump 增强**, 支持对 4G 以上地址的内存预留,使 kdump 能预留更多的内存空间,支持更大内存的机器。 - -- **支持 Raspberry PI 系列板卡**,树莓派的支持已经合入原生的 openEuler 21.03 内核,可以直接使用 openEuler 21.03 内核源码调试。 - -- **RISC-V 平台支持 KVM 虚拟化** - -- **支持 1822 智能网卡** - -## 内核热升级 -内核热升级是一种 OS 漏洞修复及升级解决方案,实现内核快速热替换,业务不感知。 - -- **Cpu Park、Quick Kexec 特性**加速系统启停,减少宕机时间,增加系统可用性。 - -- **Pin Memory、Pmem 特性**保证业务进程快速准确恢复,提升业务韧性。 - -- **内核热升级控制器**提供 gRPC 通信接口,容易使用。 ## 内存分级扩展 -支持多种内存、存储介质扩展系统内存容量,降低内存使用成本。 - -- **冷热页面识别**,通过内核态的内存页面忙闲统计机制,精确识别进程内存页面访问冷热分布。 +支持多种内存、存储介质扩展系统内存容量,降低内存使用成本。新增用户态交换支持 -- **淘汰策略可配置**,提供配置接口,可定制内存页面冷热分级策略。 +- **用户态交换(新增)**,通过etMem的策略配置,对于淘汰的冷内存,通过用户态swap功能交换到用户态存储中,达到用户无感知,性能由于内核态swap。 -- **平滑扩展**,冷页面自动换出到扩展内存,部署在其上的软件不需要改变和适配编程方式的情况下兼容的运行。 -- **多介质扩展支持**,支持SCM、XL Flash、NVMe SSD等多种介质作为扩展内存,根据介质自身访问速度指定内存冷热分层方案,达到扩展内存并减少性能损失的目的。 +## 云原生调度增强 +在云业务场景中,交互类延时敏感在线业务存在潮汐现象,CPU资源利用率普遍较低(不足15%),在线和离线业务混合部署是提升资源利用率的有效方式。在现有的内核资源分配和管理机制。 +- **QAS(Quality aware scheduler)**,可以确保在线任务对CPU的快速抢占,确定性的调度运行,同时压制离线任务干扰。 +- **OOM回收支持优先级**,优化OOM时内存回收调度算法,在发生OOM时,优先对低优先级的进程组进行内存回收,保障在线业务的正常运行。 -## 虚拟化功能和可维测能力增强 -增加热迁移 Pro 能力扩展,提升可维可测能力。 -- **热迁移Pro特性**,增强热迁移 multifd 支持 TLS,保障迁移过程数据安全;支持热迁移数据并行压缩,提升迁移性能;增加数据页面访问频率统计,支撑热迁移数据提前预测。 -- **性能调试工具(vmtop)**, 可以实时动态查看虚拟机的资源使用情况,包括CPU使用率,内存使用率等信息。新增扩展支持x86_64架构。 +## KubeOS +容器化操作系统KubeOS,实现云原生集群OS的统一容器化管理。 +- **OS容器化管理**,对接K8S容器和OS统一管理,原子化的生命周期管理。 +- **OS轻量化裁剪**,减少不必要的冗余包,可实现快速升级、替换等。 -- **IO悬挂支持**,IO发生错误时默认自动重试,超时会上报告警。 +## 轻量安全容器增强 +基于Stratovirt轻量虚拟化技术,实现容器级别的低负载和虚拟机高安全。 +- **支持UEFI启动**,支持UEFI启动、ACPI表的构建以及为虚拟机添加包括vrtio-pci在内的PCIe/PCI设备。 +- **支持VFIO**,提供将host上物理设备直通给虚拟机的能力,使虚拟机获得接近裸设备的高性能。 -## 轻量虚拟运行时(Stratovirt) -增加弹性内存、大页功能、系统调用过滤功能,增强IO子系统提升性能和稳定性。 +## iSulad增强 +- **shimv2**,shimv2 进程了收编 kata-runtime,kata-shim, kata-proxy进程,通过加载⼀次运⾏时并通过 RPC 调⽤来处理各种容器 +⽣命周期管理命令来简化体系结构,不必为每个容器⼀直运⾏⼀个容器运⾏时 -- **弹性内存支持**,根据工作负载的内存需求,实现内存的分配和回收, virtio-balloon内存回收速度达3GB/秒。 +## eggo支持容器管理双平面部署 +eggo是openEuler云原生Sig组K8S集群部署管理项目,提供高效稳定的集群部署集群的能力。 +- **集群配置版本化管理**,配置统一Git repo版本化管理,使用仓库汇总和跟踪集群的配置信息。 +- **X86/ARM双平面**,实现OS双平面集群化部署、监控、审计等场景。 -- **大页支持**,在轻量级框架下提供大页的支持,可为轻量级虚拟机提供连续的物理内存页面,提高虚拟机内存访问效率。 +## 边云协同框架 +提供统一的跨边云的协同框架(KubeEdge),实现边云之间的应用、平台服务等的管理与部署,跨边云的通信,以及跨边云的南向外设管理、控制与数据协同,边与云部署的组件存在差异,边侧主要部署EdgeCore、EdgeMesh Agent、数据服务、服务运行环境等;云侧主要部署CloudCore、EdgeMesh Server、运维管理、平台服务管理等。 +- **边缘南向服务**,南向接入Mapper,提供外设Pofile及解析机制,以及实现对不同南向外设的管理、控制、业务流的接入,可兼容EdgeX Foundry开源生态。 +- **边缘设备系统管理**, 通过设备OM的硬件层抽象层(HAL)实现对不同硬件/驱动的抽象与适配。 +- **边缘数据服务**,通过边缘数据服务实现消息、数据、媒体流的按需持久化,并具备数据分析和数据导出的能力。 +- **边缘平台服务市场**,实现边缘原生平台服务的统一生命周期管理,包括部署、运维、升级等 -- **系统调用过滤**,简化设备模型,增加系统调用过滤支持,最简配置下仅需使用35个系统调用,有效减小系统攻击面。 +## 嵌入式镜像 +提供轻量化、安全和容器等基础能力,支持ARM32、ARM64芯片架构。 +- **轻量化**,OS镜像<5M, 运行底噪<10 M, 以及<5S快速启动等能力。 +- **轻量容器**,面向嵌入式场景的轻量容器运行时,支持对接K8S集群管理软件,提供类IT应用部署和管理体验。 +- **多架构支持**,支持ARM32和ARM64芯片架构。 -- **IO子系统增强**,支持多通道并发IO能力支持,提升性能;支持IO-QOS能力,提升虚拟机IO流量管理的灵活性和稳定性。 +## 智能运维Aops -## 内核热升级 -内核热升级是一种 OS 漏洞修复及升级解决方案,实现内核快速热替换,业务不感知。 -- **Cpu Park、Quick Kexec 特性**加速系统启停,减少宕机时间,增加系统可用性。 -- **Pin Memory、Pmem 特性**保证业务进程快速准确恢复,提升业务韧性。 -- **内核热升级控制器**提供 gRPC 通信接口,容易使用。 +智能运维基本框架,提供配置溯源,架构感知,故障定位基础能力,支持快速排障和运维成本降低 -## 分级内存管理框架 -支持多种内存、存储介质统一管理,系统容量平滑扩展。 -- **冷热页面识别**,通过内核态的内存页面忙闲统计机制,精确识别进程内存页面访问冷热分布。 -- **淘汰策略可配置**,提供配置接口,可定制内存页面冷热分级策略。 -- **平滑扩展**,冷页面自动换出到扩展内存,部署在其上的软件不需要改变和适配编程方式的情况下兼容的运行。 -- **多介质扩展支持**,支持SCM、XL Flash、NVMe SSD等多种介质作为扩展内存,根据介质自身访问速度指定内存冷热分层方案,达到扩展内存并减少性能损失的目的。 +- **应用拓扑感知**,基于eBPF的低负载探针框架,提供应用级别的网络拓扑自动感知和检测能力。 -## 虚拟化功能和可维测能力增强 -增加热迁移 Pro 能力扩展,提升可维可测能力。 -- **热迁移Pro特性**,增强热迁移 multifd 支持 TLS,保障迁移过程数据安全;支持热迁移数据并行压缩,提升迁移性能;增加数据页面访问频率统计,支撑热迁移数据提前预测。 -- **性能调试工具(vmtop)**, 可以实时动态查看虚拟机的资源使用情况,包括CPU使用率,内存使用率等信息。新增扩展支持x86_64架构。 -- **IO悬挂支持**,IO发生错误时默认自动重试,超时会上报告警。 -- **RISC-V架构支持虚拟化热迁移** +- **配置溯源**,实现配置基线和比较功能,快速排除配置问题。 -## 轻量虚拟运行时(Stratovirt) -增加弹性内存、大页功能、系统调用过滤功能,增强IO子系统提升性能和稳定性。 -- **弹性内存支持**,根据工作负载的内存需求,实现内存的分配和回收, virtio-balloon内存回收速度达3GB/秒。 -- **大页支持**,在轻量级框架下提供大页的支持,可为轻量级虚拟机提供连续的物理内存页面,提高虚拟机内存访问效率。 -- **系统调用过滤**,简化设备模型,增加系统调用过滤支持,最简配置下仅需使用35个系统调用,有效减小系统攻击面。 -- **IO子系统增强**,支持多通道并发IO能力支持,提升性能;支持IO-QOS能力,提升虚拟机IO流量管理的灵活性和稳定性。 ->>>>>>> 40a1a0c3452b246a0e86c1c0b8967669c93deeb5 +- **智能定位**,提供异常检测和专家模式引擎,支持自定义故障树,对系统故障实时感知,及时修复系统故障,减少宕机时间和运维投入。 -## OpenStack Victoria集成 -简单、可大规模扩展、丰富、标准统一的云管理操作系统。更多特性,请参考OpenStack Victoria官方发行说明。 -<<<<<<< HEAD +## secPaver -- **集成openStack Vicoria版本**,使能基础设施即服务(IaaS)解决方案。 +secPaver是一款SELinux安全策略开发工具,用于辅助开发人员为应用程序开发安全策略。 -- **增强块存储服务能力**,增加容量扩展、快照和虚拟机镜像克隆等高级功能。 +- **策略管理**,提供高阶配置语言,根据策略配置文件内容生成SELinux策略文件,降低SElinux使用门槛。 -- **增强容器化部署和网络能力**,与容器能更好的集成。 -- **增加扩展服务支持**,支持控制面板管理、裸机部署、云资源追踪等扩展服务。 - -## Kubernetes 1.20 集成 - -用于自动部署,扩展和管理容器化应用程序的云原生操作系统它更多特性,请参考Kubernetes 1.20官方发行说明。 - -- **自动上线和回滚**,Kubernetes 会自动将应用或其配置的更改后的实例上线,同时监视应用程序运行状况,失败就会回滚之前所作更改。 - -- **服务发现和负载均衡**,服务发现和基于容器IP和DNS名称的负载均衡机支持。 - -- **存储编排**,支持多种存储后端的自动挂载,如本地存储、NFS、iSCSI、Gluster、Ceph等网络存储系统。 - -- **水平扩展**,支持命令行、UI手动操作扩展,以及基于 CPU 使用情况自动扩展方式。 - -## HA 高可用集群方案 - -麒麟软件贡献的高可用集群方案,故障秒级切换,为用户提供业务连续性保障、数据持续保护、灾难恢复的高可用环境。 - -- **支持多种保护模式**,双机热备、双机互备、多机备份(N+M)等多种保护模式支持,满足业务应用各种保护需求。 - -- **物理机场景和云场景双支持**,既可以在虚拟机池中进行配置高可用,也可以对物理服务器节点进行高可用保护。 - -- **支持网络(包括单心跳和双心跳模式)等心跳方式**,全方位监控共享数据资源,在极端情况下保障数据的一致性。 - -- **资源损耗低**,可在线部署,同时确保被保护应用的资源使用安全。 - -- **支持主流系统服务及应用软件**,如nginx、httpd、mariaDB等,支持二次开发。 - -- **支持HA-WEB人机交互接口**,如用户登录、集群状态展示、资源控制等。 - -- **支持HA-API机机交互接口**,如后端集群控制、资源管理、集群状态监控、资源状态监控等。 +## 更多的第三方应用支持 +- **KubeSphere**,KubeSphere 是在 Kubernetes 之上构建的以应用为中心的容器平台,完全开源,由青云科技发起,并由 openEuler 社区 SIG-KubeSphere 提供支持和维护。 +- **OpenStack Wallaby**,OpenStack版本更新到Wallaby。Wallaby是2021年4月份发布的最新稳定版本,包含nova、kolla、cyborg、tacker等核心项目的重要更新。 +- **OpenResty**,基于 Nginx 与 Lua 的高性能 Web 平台。 ## 更多桌面环境的支持 - 提供更多的开发桌面选择,更好的开发体验。 -<<<<<<< HEAD - -- **Xfce桌面支持**,Xfce是一款轻量级 Linux 桌面,与主流UI相比对资源占用小。 - -- **DDE桌面支持**,是统信软件旗下的一款linux桌面环境,具有美观,易用,高效等特点。 +- **DDE版本升级**,新增支持画板、音乐和影院应用。 +- **UKUI版本升级**,新增中文输入法和多媒体支持。 diff --git "a/docs/zh/docs/Releasenotes/\347\263\273\347\273\237\345\256\211\350\243\205.md" "b/docs/zh/docs/Releasenotes/\347\263\273\347\273\237\345\256\211\350\243\205.md" index a7c2c74f46c3235d68798b08f3a4175fad16f9c9..d965487369cb424f73034dff8aa4f51fc90501a3 100644 --- "a/docs/zh/docs/Releasenotes/\347\263\273\347\273\237\345\256\211\350\243\205.md" +++ "b/docs/zh/docs/Releasenotes/\347\263\273\347\273\237\345\256\211\350\243\205.md" @@ -48,6 +48,16 @@ openEuler发布件包括[ISO发布包](http://repo.openeuler.org/openEuler-21.03

openEuler源码ISO

+

openEuler-21.09-edge-aarch64-dvd.iso

+ +

AArch64架构的边缘ISO,包含了运行最小系统的核心组件

+ + +

openEuler-21.09-edge-x86_64-dvd.iso

+ +

x86_64架构的边缘ISO,包含了运行最小系统的核心组件

+ + diff --git "a/docs/zh/docs/StratoVirt/StratoVirt\344\273\213\347\273\215.md" "b/docs/zh/docs/StratoVirt/StratoVirt\344\273\213\347\273\215.md" index 72e75abf4f54e7b43f82e86009b22366e33cefd6..61fadea8b11a4b9b6e2e283368b4acab83a85fcb 100644 --- "a/docs/zh/docs/StratoVirt/StratoVirt\344\273\213\347\273\215.md" +++ "b/docs/zh/docs/StratoVirt/StratoVirt\344\273\213\347\273\215.md" @@ -12,9 +12,11 @@ StratoVirt在架构设计和接口上预留了组件化拼装的能力和接口 StratoVirt核心架构自顶向下分为三层: -- OCI兼容接口:兼容QMP(QEMU Machine Protocol)协议,具有完备的OCI兼容能力。 -- BootLoader:抛弃传统BIOS+GRUB的启动模式,实现了更轻更快的Bootloader。 -- MicroVM:虚拟化层,充分利用软硬协同能力,精简化设备模型;低时延资源伸缩能力。 +- 外部接口:兼容QMP(QEMU Monitor Protocol)协议,具有完备的OCI兼容能力,同时支持对接libvirt。 +- BootLoader:轻量化场景下抛弃传统BIOS+GRUB的启动模式实现快速启动,同时标准虚拟化场景下支持UEFI启动。 +- 模拟主板: + - microvm: 充分利用软硬协同能力,精简化设备模型,低时延资源伸缩能力。 + - 标准机型:提供ACPI表实现UEFI启动,支持添加virtio-pci以及VFIO直通设备等,极大提高虚拟机的I/O性能。 整体架构视图如**图1**所示。 @@ -22,4 +24,3 @@ StratoVirt核心架构自顶向下分为三层: ![](./figures/StratoVirt_architecture.png) - diff --git a/docs/zh/docs/StratoVirt/figures/StratoVirt_architecture.png b/docs/zh/docs/StratoVirt/figures/StratoVirt_architecture.png index fd1a07a5458b2b2a61ca062d8ec68d533dd6df20..e46e1f0bd2673ddf65794ced63885e2579a14325 100644 Binary files a/docs/zh/docs/StratoVirt/figures/StratoVirt_architecture.png and b/docs/zh/docs/StratoVirt/figures/StratoVirt_architecture.png differ diff --git "a/docs/zh/docs/StratoVirt/\350\231\232\346\213\237\346\234\272\347\256\241\347\220\206.md" "b/docs/zh/docs/StratoVirt/\350\231\232\346\213\237\346\234\272\347\256\241\347\220\206.md" index cc0de8d0c1aaffc2e27c36b8356217c6f86cb25c..6f4a1514b53d92534ef8a8184ce000e4fa89f53f 100644 --- "a/docs/zh/docs/StratoVirt/\350\231\232\346\213\237\346\234\272\347\256\241\347\220\206.md" +++ "b/docs/zh/docs/StratoVirt/\350\231\232\346\213\237\346\234\272\347\256\241\347\220\206.md" @@ -347,58 +347,68 @@ id:网卡的ID号,例如net-0。 -> {"return":{"actual":2147483648}} ``` +## 虚拟机内存快照 -## 虚拟机快照和从快照恢复 +### 简介 -StratoVirt支持对处于暂停状态的虚拟机制作快照。StratoVirt可以以快照文件为模板进行热启动,批量创建新的虚拟机。只要制作快照的节点在虚拟机启动完成并进入用户态之后,热启动就能够跳过内核的启动阶段和用户态服务的初始化阶段,在极短的时间内启动虚拟机。 +虚拟机内存快照是指将虚拟机的设备状态和内存信息保存在快照文件中。当虚拟机系统损坏时,可以使用内存快照将虚拟机恢复到快照对应时间点,从而提升系统的可靠性。 -**用法:** +StratoVirt 支持对处于暂停状态(suspend)的虚拟机制作快照,并且支持虚拟机以快照文件为虚拟机模板批量创建新的虚拟机。只要制作快照的时间点在虚拟机启动完成并进入用户态之后,快速启动就能够跳过内核启动阶段和用户态服务初始化阶段,在毫秒级完成虚拟机启动。 -**制作快照:** +### 互斥特性 -在虚拟机启动完成后,通过QMP命令暂停虚拟机: -``` -<- {"execute":"stop"} --> {"event":"STOP","data":{},"timestamp":{"seconds":1583908726,"microseconds":162739}} --> {"return":{}} -``` +虚拟机配置了如下设备或使用了如下特性时,不能制作和使用内存快照: -当虚拟机处于暂停状态下,能够通过以下QMP命令在特定的*绝对路径*创建虚拟机快照: -``` -<- {"execute":"migrate", "arguments":{"uri":"file:/path/to/template"}} --> {"return":{}} -``` +- vhost-net 设备 +- vfio 直通设备 +- balloon 设备 +- 大页内存 +- mem-shared 特性 +- 配置了内存后端文件 mem-path -在给定的路径下,StratoVirt将会创建两个文件: -```shell -$ ls path/to/template -memory state -``` +### 制作快照 -`state`文件包含虚拟机设备状态的信息,`memory`文件包含虚拟机guest内存的数据信息,文件大小与虚拟机guest内存配置正相关。 +针对 StratoVirt 虚拟机,可以参考如下步骤制作存储快照: -**从快照创建虚拟机:** +1. 创建并启动虚拟机。 -通过以下命令从快照中恢复虚拟机: +2. 在 Host 上执行 QMP 命令暂停虚拟机: -```shell -$ /usr/bin/stratovirt \ - ...... - -incoming file:path/to/template -``` -此时启动虚拟机的命令行中设备的种类和数量必须与创建快照时保持一致。其中和设备拓扑相关的,如cpu数量,guest内存大小,设备号和类型是不能改变的。一些设备后端,如网络设备对应的tap设备,console设备对应的字符设备,vsock设备对应的guest-cid是可以进行修改的。 + ```shell + <- {"execute":"stop"} + -> {"event":"STOP","data":{},"timestamp":{"seconds":1583908726,"microseconds":162739}} + -> {"return":{}} + + ``` -**参数** +3. 确认虚拟机处于暂停状态: -- uri: 快照的路径,当前版本只支持`file:`类型,后加上快照文件的绝对路径 + ```shell + <- {"execute":"query-status"} + -> {"return":{"running":true,"singlestep":false,"status":"paused"}} + + ``` -**查看快照状态** +4. 执行如下 QMP 命令,在任一指定的绝对路径下创建虚拟机快照,例如 /path/to/template 路径,参考命令如下: -可以通过`query-migrate`qmp命令来检查当前快照的状态: -``` -<- {"execute":"query-migrate"} --> {"return":{"status":"completed"}} -``` + ```shell + <- {"execute":"migrate", "arguments":{"uri":"file:/path/to/template"}} + -> {"return":{}} + + ``` + +5. 确认快照是否创建成功。 + + ```shell + <- {"execute":"query-migrate"} + + ``` + + 如果回显 {"return":{"status":"completed"}} ,说明快照创建成功。 + + 快照创建成功,会在指定路径 /path/to/template 生成 memory 和 state 两个目录。`state`文件包含虚拟机设备状态的信息,`memory`文件包含虚拟机内存的数据信息,memory 文件大小接近配置的虚拟机内存。 + +### 查询快照状态 当前在整个快照过程中,存在5种状态: @@ -408,26 +418,68 @@ $ /usr/bin/stratovirt \ - `Completed`: 快照制作成功 - `Failed`: 快照制作失败 -### 注意事项 +可以通过在 Host 执行`query-migrate`qmp 命令查询当前快照的状态,如当虚拟机快照制作成功时查询: + +```shell +<- {"execute":"query-migrate"} +-> {"return":{"status":"completed"}} + +``` + +### 恢复虚拟机 + +#### 注意事项 - 快照以及从快照启动特性支持的机型包括: - microvm - - q35(x86_64平台) + - q35(x86_64) - virt(aarch64平台) - 在使用快照恢复时,配置的设备必须与制作快照时保持一致 -- 当使用microvm机型,并且在快照前使用了磁盘/网卡的热插特性,在恢复时需要将热插的磁盘/网卡配置进启动命令行 +- 当使用 microvm 机型,并且在快照前使用了磁盘/网卡的热插特性,在恢复时需要将热插的磁盘/网卡配置进启动命令行 +#### 从快照文件中恢复虚拟机 +**命令格式** -### 互斥特性 +```shell +stratovirt -incoming URI + +``` -- 配置了以下设备时,不能使用快照及相关特性: - - vhost-net设备 - - vfio直通设备 - - balloon设备 -- 虚拟机使用了以下特性时,不能使用快照及相关特性: - - 大页内存 - - mem-shared开关 - - 内存后端文件(mem-path) +**参数说明** +URI:快照的路径,当前版本只支持 `file` 类型,后加上快照文件的绝对路径 + +**示例** + +假设制作快照所使用的虚拟机是通过以下命令创建的: + +```shell +$ stratovirt \ + -machine microvm \ + -kernel /path/to/kernel \ + -smp 1 -m 1024 \ + -append "console=ttyS0 pci=off reboot=k quiet panic=1 root=/dev/vda" \ + -drive file=/path/to/rootfs,id=rootfs,readonly=off,direct=off \ + -device virtio-blk-device,drive=rootfs \ + -qmp unix:/path/to/socket,server,nowait \ + -serial stdio + +``` + +那么,使用快照恢复虚拟机的参考命令如下(此处假设快照存放的路径为 /path/to/template ): + +```shell +$ stratovirt \ + -machine microvm \ + -kernel /path/to/kernel \ + -smp 1 -m 1024 \ + -append "console=ttyS0 pci=off reboot=k quiet panic=1 root=/dev/vda" \ + -drive file=/path/to/rootfs,id=rootfs,readonly=off,direct=off \ + -device virtio-blk-device,drive=rootfs \ + -qmp unix:/path/to/another_socket,server,nowait \ + -serial stdio \ + -incoming file:/path/to/template + +``` diff --git "a/docs/zh/docs/desktop/HA\347\232\204\344\275\277\347\224\250\345\256\236\344\276\213.md" "b/docs/zh/docs/desktop/HA\347\232\204\344\275\277\347\224\250\345\256\236\344\276\213.md" new file mode 100644 index 0000000000000000000000000000000000000000..58900c40514bca4a3712a91e9b07b166af6b7659 --- /dev/null +++ "b/docs/zh/docs/desktop/HA\347\232\204\344\275\277\347\224\250\345\256\236\344\276\213.md" @@ -0,0 +1,214 @@ +# HA使用实例 + +本章介绍如何快速使用HA高可用集群,以及添加一个实例。若不了解怎么安装,请参考[HA的安装与部署文档](./HA的安装与部署.md\)。 + + + - [HA使用实例](#HA使用与实例) + - [快速使用指南](#快速使用指南) + - [登陆页面](#登陆页面) + - [主页面](#主页面) + - [导航栏](#导航栏) + - [顶部操作区](#顶部操作区) + - [资源节点列表区](#资源节点列表区) + - [节点操作浮动区](#节点操作浮动区) + - [首选项配置](#首选项配置) + - [添加资源](#添加资源) + - [添加普通资源](#添加普通资源) + - [添加组资源](#添加组资源) + - [添加克隆资源](#添加克隆资源) + - [编辑资源](#编辑资源) + - [设置资源关系](#设置资源关系) + - [高可用mysql实例配置](#高可用mysql实例配置) + - [配置虚拟IP](#配置虚拟IP) + - [配置NFS存储](#配置NFS存储) + - [配置mysql](#配置mysql) + - [添加上述资源为组资源](#添加上述资源为组资源) + + +## 快速使用指南 + +- 以下操作均以社区新开发的管理平台为例。 + +### 登陆页面 +用户名为`hacluster`,密码为该用户在主机上设置的密码。 + +![](./figures/HA-api.png) + +### 主页面 +登录系统后显示主页面,主页面由四部分组成:侧边导航栏、顶部操作区、资源节点列表区以及节点操作浮动区。 + +以下将详细介绍这四部分的特点与使用方法。 + +![](./figures/HA-home-page.png) + +#### 导航栏 +侧边导航栏由两部分组成:高可用集群软件名称和 logo 以及系统导航。系统导航由三项组成:【系统】、【集群配置】和【工具】。【系统】是默认选项,也是主页面的对应项,主要展示系统中所有资源的相关信息以及操作入口;【集群配置】下设【首选项配置】和【心跳配置】两项;【工具】下设【日志下载】和【集群快捷操作】两项,点击后以弹出框的形式出现。 + +#### 顶部操作区 +登录用户是静态显示,鼠标滑过用户图标,出现操作菜单项,包括【刷新设置】和【退出登录】两项,点击【刷新设置】,弹出【刷新设置】对话框,包含【刷新设置】选项,可以设置系统的自动刷新模式,包括【不自动刷新】、【每 5 秒刷新】和【每 10 秒刷新】三种选择,默认选择【不自动刷新】、【退出登录】即可注销本次登录,系统将自动跳到登录页面,此时,如果希望继续访问系统,则需要重新进行登录。 + +![](./figures/HA-refresh.png) + +#### 资源节点列表区 +资源节点列表集中展现系统中所有资源的【资源名】、【状态】、【资源类型】、【服务】、【运行节点】等资源信息,以及系统中所有的节点和节点的运行情况等节点信息。同时提供资源的【添加】、【编辑】、【启动】、【停止】、【清理】、【迁移】、【回迁】、【删除】和【关系】操作。 + +#### 节点操作浮动区 +节点操作浮动区域默认是收起的状态,每当点击资源节点列表表头中的节点时,右侧会弹出节点操作扩展区域,如图所示,该区域由收起按钮、节点名称、停止和备用四个部分组成,提供节点的【停止】和【备用】操作。点击区域左上角的箭头,该区域收起。 + +### 首选项配置 +以下操作均可用命令行配置,现只做简单示例,若想使用更多命令可以使用``pcs --help``进行查询。 + +``` +# pcs property set stonith-enabled=false +# pcs property set no-quorum-policy=ignore +``` +``pcs property``查看全部设置 + +![](./figures/HA-firstchoice-cmd.png) + +- 点击侧边导航栏中的【首选项配置】按钮,弹出【首选项配置】对话框。将No Quorum Policy和Stonith Enabled由默认状态改为如下对应状态;修改完成后,点击【确定】按钮完成配置。 + +![](./figures/HA-firstchoice.png) + +#### 添加资源 +##### 添加普通资源 +鼠标点击【添加普通资源】,弹出【创建资源】对话框,其中资源的所有必填配置项均在【基本】页面内,选择【基本】页面内的【资源类型】后会进一步给出该类资源的其他必填配置项以及选填配置项。填写资源配置信息时,对话框右侧会出现灰色文字区域,对当前的配置项进行解释说明。全部必填项配置完毕后,点击【确定】按钮即可创建普通资源,点击【取消】按钮,取消本次添加动作。【实例属性】、【元属性】或者【操作属性】页面中的选填配置项为选填项,不配置不会影响资源的创建过程,可以根据场景需要可选择修改,否则将按照系统默认值处理。 + +下面以apache为例,添加apache资源 +``` +# pcs resource create httpd ocf:heartbeat:apache +``` +查看资源运行状态 +``` +# pcs status +``` + +![](./figures/HA-pcs-status.png) + +- 添加apache资源 + +![](./figures/HA-add-resource.png) +- 若回显为如下,则资源添加成功 + +![](./figures/HA-apache-suc.png) +- 资源创建成功并启动,运行于其中一个节点上,例如ha1;成功访问apache界面。 + +![](./figures/HA-apache-show.png) + +##### 添加组资源 +添加组资源时,集群中需要至少存在一个普通资源。鼠标点击【添加组资源】,弹出【创建资源】对话框。【基本】页面内均为必填项,填写完毕后,点击【确定】按钮,即可完成资源的添加,点击【取消】按钮,取消本次添加动作。 + +- **注:组资源的启动是按照子资源的顺序启动的,所以选择子资源时需要注意按照顺序选择。** + +![](./figures/HA-group.png) + +若回显为如下,则资源添加成功 + +![](./figures/HA-group-suc.png) + +##### 添加克隆资源 +鼠标点击【添加克隆资源】,弹出【创建资源】对话框。【基本】页面内填写克隆对象,资源名称会自动生成,填写完毕后,点击【确定】按钮,即可完成资源的添加,点击【取消】按钮,取消本次添加动作。 + +![](./figures/HA-clone.png) + +若回显为如下,则资源添加成功 + +![](./figures/HA-clone-suc.png) +#### 编辑资源 +- 启动资源:资源节点列表中选中一个目标资源,要求:该资源处于非运行状态。对该资源执行启动动作。 +- 停止资源:资源节点列表中选中一个目标资源,要求:该资源处于运行状态。对该资源执行停止操作。 +- 清理资源:资源节点列表中选中一个目标资源,对该资源执行清理操作。 +- 迁移资源:资源节点列表中选中一个目标资源,要求:该资源为处于运行状态的普通资源或者组资源,执行迁移操作可以将资源迁移到指定节点上运行。 +- 回迁资源:资源节点列表中选中一个目标资源,要求:该资源已经完成迁移动作,执行回迁操作,可以清除该资源的迁移设置,资源重新迁回到原来的节点上运行。 +点击按钮后,列表中该资源项的变化状态与启动资源时一致。 +- 删除资源:资源节点列表中选中一个目标资源,对该资源执行删除操作。 + +#### 设置资源关系 +资源关系即为目标资源设定限制条件,资源的限制条件分为三种:资源位置、资源协同和资源顺序。 +- 资源位置:设置集群中的节点对于该资源的运行级别,由此确定启动或者切换时资源在哪个节点上运行,运行级别按照从高到低的顺序依次为:Master Node、Slave 1。 +- 资源协同:设置目标资源与集群中的其他资源是否运行在同一节点上,同节点资源表示该资源与目标资源必须运行在相同节点上,互斥节点资源表示该资源与目标资源不能运行在相同的节点上。 +- 资源顺序:设置目标资源与集群中的其他资源启动时的先后顺序,前置资源是指目标资源运行之前,该资源必须已经运行;后置资源是指目标资源运行之后,该资源才能运行。 + +## 高可用mysql实例配置 +- 先单独配置三个普通资源,待成功后添加为组资源。 +### 配置虚拟IP +在首页中点击添加-->添加普通资源,并按如下进行配置。 + +![](./figures/HA-vip.png) + +- 资源创建成功并启动,运行于其中一个节点上,例如ha1;可以ping通并连接,登录后可正常执行各种操作;资源切换到ha2运行;能够正常访问。 +- 若回显为如下,则资源添加成功 + +![](./figures/HA-vip-suc.png) + +### 配置NFS存储 +- 另外找一台机器作为nfs服务端进行配置 + +安装软件包 + +``` +# yum install -y nfs-utils rpcbind +``` +关闭防火墙 +``` +# systemctl stop firewalld && systemctl disable firewalld +``` +修改/etc/selinux/config文件中SELINUX状态为disabled +``` +# SELINUX=disabled +``` +启动服务 +``` +# systemctl start rpcbind && systemctl enable rpcbind +# systemctl start nfs-server && systemctl enable nfs-server +``` +服务端创建一个共享目录 +``` +# mkdir -p /test +``` +修改NFS配置文件 +``` +# vim /etc/exports +# /test *(rw,no_root_squash) +``` +重新加载服务 +``` +# systemctl reload nfs +``` + +客户端安装软件包,先把mysql安装上,为了把下面nfs挂载到mysql数据路径 +``` +# yum install -y nfs-utils mariadb-server +``` +在首页中点击添加-->添加普通资源,并按如下进行配置NFS资源。 + +![](./figures/HA-nfs.png) + +- 资源创建成功并启动,运行于其中一个节点上,例如ha1;nfs成功挂载到/var/lib/mysql路径下。资源切换到ha2运行;nfs从ha1节点取消挂载,并自动在ha2节点上挂载成功。 +- 若回显为如下,则资源添加成功 + +![](./figures/HA-nfs-suc.png) + +### 配置mysql +在首页中点击添加-->添加普通资源,并按如下进行配置mysql资源。 + +![](./figures/HA-mariadb.png) + +- 若回显为如下,则资源添加成功 + +![](./figures/HA-mariadb-suc.png) + +### 添加上述资源为组资源 +- 按资源启动顺序添加三个资源 + +在首页中点击添加-->添加组资源,并按如下进行配置组资源。 + +![](./figures/HA-group-new.png) + +- 组资源创建成功并启动,若回显与上述三个普通资源成功现象一致,则资源添加成功 + +![](./figures/HA-group-new-suc.png) + +- 将ha1节点备用,成功迁移到ha2节点,运行正常 + +![](./figures/HA-group-new-suc2.png) \ No newline at end of file diff --git "a/docs/zh/docs/desktop/HA\347\232\204\345\256\211\350\243\205\344\270\216\351\203\250\347\275\262.md" "b/docs/zh/docs/desktop/HA\347\232\204\345\256\211\350\243\205\344\270\216\351\203\250\347\275\262.md" new file mode 100644 index 0000000000000000000000000000000000000000..0aa6f2f0a3b5ac7e7866abf07cad84a6a110e98f --- /dev/null +++ "b/docs/zh/docs/desktop/HA\347\232\204\345\256\211\350\243\205\344\270\216\351\203\250\347\275\262.md" @@ -0,0 +1,185 @@ +# HA的安装与部署 + +本章介绍如何安装和部署HA高可用集群。 + + +- [HA的安装与部署](#ha的安装与部署) + - [安装与部署](#安装与部署) + - [修改主机名称及/etc/hosts文件](#修改主机名称及etchosts文件) + - [配置yum源](#配置yum源) + - [安装HA软件包组件](#安装ha软件包组件) + - [设置hacluster用户密码](#设置hacluster用户密码) + - [修改`/etc/corosync/corosync.conf`文件](#修改etccorosynccorosyncconf文件) + - [管理服务](#管理服务) + - [关闭防火墙](#关闭防火墙) + - [管理pcs服务](#管理pcs服务) + - [管理pacemaker服务](#管理pacemaker服务) + - [管理corosync服务](#管理corosync服务) + - [节点鉴权](#节点鉴权) + - [访问前端管理平台](#访问前端管理平台) + + +## 安装与部署 +- 环境准备:需要至少两台安装了openEuler 20.03 LTS SP2的物理机/虚拟机(现以两台为例),安装方法参考《openEuler 20.03 LTS SP2 安装指南》。 + +### 修改主机名称及/etc/hosts文件 +- **注:两台主机均需要进行以下操作,现以其中一台为例。** + +在使用HA软件之前,需要确认修改主机名并将所有主机名写入/etc/hosts文件中。 +- 修改主机名 +``` +# hostnamectl set-hostname ha1 +``` + +- 编辑`/etc/hosts`文件并写入以下字段 +``` +172.30.30.65 ha1 +172.30.30.66 ha2 +``` + +### 配置yum源 +成功安装系统后,会默认配置好yum源,文件位置存放在`/etc/yum.repos.d/openEuler.repo`文件中,HA软件包会用到以下源: +``` +[OS] +name=OS +baseurl=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/OS/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/OS/$basearch/RPM-GPG-KEY-openEuler + +[everything] +name=everything +baseurl=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/everything/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/everything/$basearch/RPM-GPG-KEY-openEuler + +[EPOL] +name=EPOL +baseurl=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/EPOL/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS-SP2/OS/$basearch/RPM-GPG-KEY-openEuler +``` + +### 安装HA软件包组件 +``` +# yum install -y corosync pacemaker pcs fence-agents fence-virt corosync-qdevice sbd drbd drbd-utils +``` + +### 设置hacluster用户密码 +``` +# passwd hacluster +``` + +### 修改`/etc/corosync/corosync.conf`文件 +``` +totem { + version: 2 + cluster_name: hacluster + crypto_cipher: none + crypto_hash: none +} +logging { + fileline: off + to_stderr: yes + to_logfile: yes + logfile: /var/log/cluster/corosync.log + to_syslog: yes + debug: on + logger_subsys { + subsys: QUORUM + debug: on + } +} +quorum { + provider: corosync_votequorum + expected_votes: 2 + two_node: 1 + } +nodelist { + node { + name: ha1 + nodeid: 1 + ring0_addr: 172.30.30.65 + } + node { + name: ha2 + nodeid: 2 + ring0_addr: 172.30.30.66 + } + } +``` +### 管理服务 +#### 关闭防火墙 +``` +# systemctl stop firewalld +``` +修改/etc/selinux/config文件中SELINUX状态为disabled +``` +# SELINUX=disabled +``` + +#### 管理pcs服务 +- 启动pcs服务: +``` +# systemctl start pcsd +``` + +- 查询pcs服务状态: +``` +# systemctl status pcsd +``` + +若回显为如下,则服务启动成功。 + +![](./figures/HA-pcs.png) + +#### 管理pacemaker服务 +- 启动pacemaker服务: +``` +# systemctl start pacemaker +``` + +- 查询pacemaker服务状态: +``` +# systemctl status pacemaker +``` + +若回显为如下,则服务启动成功。 + +![](./figures/HA-pacemaker.png) + +#### 管理corosync服务 +- 启动corosync服务: +``` +# systemctl start corosync +``` + +- 查询corosync服务状态: +``` +# systemctl status corosync +``` + +若回显为如下,则服务启动成功。 + +![](./figures/HA-corosync.png) + +### 节点鉴权 +- **注:一个节点上执行即可** +``` +# pcs host auth ha1 ha2 +``` + +### 访问前端管理平台 +上述服务启动成功后,打开浏览器(建议使用:Chrome,Firfox),在浏览器导航栏中输入`https://localhost:2224`即可。 +- 此界面为原生管理平台 + +![](./figures/HA-login.png) + +若安装社区新开发的管理平台请参考此文档`https://gitee.com/openeuler/ha-api/blob/master/docs/build.md` +- 下面为社区新开发的管理平台 + +![](./figures/HA-api.png) + +- 下一章将介绍如何快速使用HA高可用集群,以及添加一个实例。请参考[HA的使用实例文档](./HA的使用实例.md\)。 \ No newline at end of file