• 欢迎访问速搜资源吧,如果在网站上找不到你需要的资源,可以在留言板上留言,管理员会尽量满足你!

【速搜问答】OpenVZ是什么

问答 admin 2年前 (2020-08-20) 426次浏览 已收录 0个评论

汉英对照:
Chinese-English Translation:

OpenVZ是基于Linux内核的操作系统级虚拟化技术。OpenVZ允许物理服务器运行多个操作系统,该技术常用于虚拟专用服务器。 与VMware和Xen这种硬件辅助虚拟化技术相比,OpenVZ的主机与客户系统都必须是Linux。

OpenVZ is an operating system level virtualization technology based on Linux kernel. OpenVZ allows physical servers to run multiple operating systems, a technology commonly used in virtual private servers. Compared with VMware and Xen, the host and client systems of OpenVZ must be Linux.

OpenVZ 是基于 Linux 内核的操作系统级虚拟化技术。OpenVZ 允许物理服务器运行多个操作系统,该技术常用于虚拟专用服务器。 与 VMware 这种虚拟机和 Xen 这种硬件辅助虚拟化技术相比,OpenVZ 的主机与客户系统都必须是 Linux。但是,OpenVZ 声称这样做有性能上的优势。

OpenVZ is an operating system level virtualization technology based on Linux kernel. OpenVZ allows physical servers to run multiple operating systems, a technology commonly used in virtual private servers. Compared with VMware and Xen, the host and client systems of OpenVZ must be Linux. However, OpenVZ claims to have performance advantages.

根据 OpenVZ 网站的说法,使用 OpenVZ 与使用独立的实体服务器相比,性能只会有 1-3%的损失。

According to the OpenVZ website, there is only 1-3% performance loss with OpenVZ compared to using a stand-alone physical server.

OpenVZ 的 Linux 客户系统其实是共享 OpenVZ 主机 Linux 系统的内核,也就意味着 OpenVZ 的 Linux 客户系统不能升级内核。

The Linux client system of OpenVZ actually shares the kernel of OpenVZ host Linux system, which means that the Linux client system of OpenVZ cannot upgrade the kernel.

OpenVZ 是 SWsoft, Inc.公司开发的专有软件 Virtuozzo(Virtuozzo 虚拟机还支持 Windows 客户系统)的基础。OpenVZ 的授权为 GPLv2。

OpenVZ is the foundation of the proprietary software virtuozzo (virtuzzo virtual machine also supports Windows client system) developed by swsoft, Inc. OpenVZ is licensed to gplv2.

OpenVZ 由两部分组成,一个经修改过的 Linux 内核与一套用户工具。

OpenVZ consists of two parts, a modified Linux kernel and a set of user tools.

核心

core

OpenVZ 的核心是 Linux 内核,并进行了修改以加入对 OpenVZ 虚拟环境的支持。修改后的核心提供了虚拟化,隔离,资源管理和检查点机制。

The core of OpenVZ is Linux kernel, which has been modified to support OpenVZ virtual environment. The modified core provides virtualization, isolation, resource management and checkpoint mechanisms.

虚拟化和隔离

Virtualization and isolation

每一个虚拟环境都是一个单独的个体,表现得和一个物理服务器所表现的相同。每一个虚拟环境都有其自己的:

Each virtual environment is a separate entity that behaves like a physical server. Each virtual environment has its own:

文件

file

系统库、应用软件,虚拟化的/proc 及/sys,虚拟化的锁等等。

System library, application software, virtualized / proc and / sys, virtualized lock, etc.

用户和用户组

Users and user groups

每一个虚拟环境都有其自己的 root 用户、用户和用户组。

Each virtual environment has its own root user, user and user group.

进程树

Process tree

虚拟环境只能看见其自己的行程(从 init 开始)。PID 也是虚拟化的,所以 init 的 PID 是 1。

Virtual environments can only see their own itinerary (starting with init). PID is also virtualized, so init’s PID is 1.

网络

network

虚拟的网络设备,允许虚拟环境拥有自己的 IP 地址,以及一组 netfilter 及路由规则。

Virtual network device, allowing virtual environment to have its own IP address, as well as a set of Netfilter and routing rules.

设备

equipment

如果需要,任何虚拟环境都可以授予访问真正设备,如网络接口、串口、磁盘分区等的权力。

If needed, any virtual environment can grant access to real devices, such as network interfaces, serial ports, disk partitions, and so on.

进程间通信对象

Interprocess communication object

共享内存、信号量、消息传递。

Shared memory, semaphores, messaging.

资源管理

resource management

OpenVZ 的资源管理包括三个部分:两级磁盘配额,公平的 CPU 调度器,以及 user beancounters。这些资源在虚拟环境的运行过程中可以调整,可以不必重启动。

OpenVZ resource management includes three parts: two-level disk quota, fair CPU scheduler, and user beancounters. These resources can be adjusted during the running process of virtual environment, and it is unnecessary to restart.

两级磁盘配额

Two level disk quota

每一个虚拟环境都有其自己的磁盘配额,以磁盘的 block 数和 inode(大概相当于文档的数目)的数目来计算。在虚拟环境中,可以通过标准的工具来设置 UNIX 用户和用户组的磁盘配额。

Each virtual environment has its own disk quota, which is calculated by the number of disk blocks and the number of inodes (approximately equivalent to the number of documents). In a virtual environment, disk quotas for UNIX users and user groups can be set by standard tools.

CPU 调度器

CPU scheduler

OpenVZ 中的调度器是一个两级的公平分享调度策略的实现。

The scheduler in OpenVZ is an implementation of a two-level fair sharing scheduling strategy.

在第一级,调度器根据每个虚拟环境的 cpuunits 的值决定哪一个虚拟环境被分配 CPU 时间片。在第二级,标准的 Linux 调度器使用标准的 Linux 进程优先级和相关机制决定该虚拟环境中的哪一个进程获得 CPU。

In the first level, the scheduler determines which virtual environment is allocated CPU time slices according to the value of CPU units of each virtual environment. At the second level, the standard Linux scheduler uses the standard Linux process priority and related mechanisms to determine which process in the virtual environment gets the CPU.

检查点机制和动态迁移

Checkpoint mechanism and dynamic migration

2006 年 4 月中旬的 OpenVZ 发布了动态迁移和检查点功能。这使得在将一个虚拟环境从一个物理服务器迁移到另一个物理服务器的过程中不需要进行关机。这个过程被称为动态迁移:一个虚拟环境被冻结,然后它的所有状态被存到磁盘中的一个文件中;这个文件被传输到另外一个机器,然后虚拟环境在那里被解冻(恢复)。整个过程的延迟时间只有数秒。由于状态通常被完整地保护,这个暂停看起来就像一个正常的计算延迟。

OpenVZ released dynamic migration and checkpointing in mid April 2006. This makes it unnecessary to shut down a virtual environment during the migration from one physical server to another. This process is called dynamic migration: a virtual environment is frozen, and then all its state is saved to a file on disk; the file is transferred to another machine, where the virtual environment is thawed (restored). The delay time of the whole process is only a few seconds. Since state is usually fully protected, this pause looks like a normal computational delay.

用户级工具

User level tools

OpenVZ 提供了命令行工具来管理虚拟环境(vzctl)和虚拟环境中的软件(vzpkg)。

OpenVZ provides command-line tools to manage virtual environment (vzctl) and software in virtual environment (vzpkg).

vzctl

vzctl

这是一个简单的用于管理一个虚拟环境的高级命令行工具。

This is a simple advanced command line tool for managing a virtual environment.

模板与 vzpkg

Template and vzpkg

可以用 OpenVZ 的模板快速部署 OpenVZ Linux 虚拟机,OpenVZ 的模板可在 OpenVZ 的网站下载。不同 Linux 发行版所用的模板不同。比如,使用 CentOS 7 的模板部署采用 CentOS 7 发行版的 OpenVZ 虚拟机,使用 Debian 8 的模板部署采用 Debian 8 发行版的 OpenVZ 虚拟机等。

OpenVZ templates can be used to quickly deploy OpenVZ Linux virtual machines. OpenVZ templates can be downloaded from OpenVZ website. Different Linux distributions use different templates. For example, using CentOS 7 template deployment uses CentOS 7 distribution OpenVZ virtual machine, using Debian 8 template deployment using Debian 8 distribution OpenVZ virtual machine.

OpenVZ 的特色

Features of OpenVZ

可扩展性

Scalability

由于 OpenVZ 使用了一个单独的核心模型,它就和 2.6 版的 Linux 核心有着同样的可扩展性。它支持高达 64 个 CPU 和 64G 内存,一个单独的虚拟环境可以扩放到整个物理服务器,比如说使用所有的 CPU 和所有的内存。

Because OpenVZ uses a separate core model, it has the same scalability as the 2.6 Linux core. It supports up to 64 CPUs and 64g of memory, and a single virtual environment can be extended to the entire physical server, such as using all the CPU and all the memory.

密度

density

OpenVZ 可以在一台相当好的硬件上运行上百个虚拟环境(主要瓶颈是内存和 CPU)。

OpenVZ can run hundreds of virtual environments on a fairly good hardware (the main bottlenecks are memory and CPU).

图标显示了虚拟环境上的 Apache HTTP Server 响应时间与虚拟环境数目的关系。测量是在一台有 768M 内存的机器上进行的;每一个虚拟环境都运行一组通常的进程:init、syslogd、crond、sshd 和 Apache。Apache 用来提供静态页面,而这些页面是由 http_load 所读取,然后测度第一个响应的时间。就如你看到的一样,随着虚拟环境的数量增加,响应时间由于内存存储和交换而变得更长。

The icon shows the relationship between Apache HTTP server response time and the number of virtual environments on the virtual environment. The measurement is carried out on a machine with 768m memory; each virtual environment runs a set of common processes: init, syslogd, crond, sshd, and Apache. Apache is used to provide static pages, which are provided by HTTP_ Load, and then measures the time of the first response. As you can see, as the number of virtual environments increases, the response time becomes longer due to memory storage and swapping.

在这种场景下,在一个 768M 内存的硬件上运行高达 120 个这样的虚拟环境是可能的。并以线性的方式外推,所以可以在 1 台 2G 内存的硬件上运行 320 个这样的虚拟环境。

In this scenario, it is possible to run up to 120 such virtual environments on a 768m memory hardware. And extrapolate in a linear way, so 320 such virtual environments can be run on one 2G memory hardware.

集中管理

centralized management

一台 OpenVZ 物理服务器(也称为硬件节点)的拥有者(root)可以看见所有虚拟环境的进程和文件。这使得大规模的管理成为可能。试想想当你是用 VMware 或 Xen 来做服务器集成的情况:为了给你的 10 个虚拟服务器进行安全更新,你必须登录到每一台机器并运行更新过程,这跟你为 10 台物理服务器进行更新是一样的。

The owner (root) of an OpenVZ physical server (also known as the hardware node) can see all the processes and files of the virtual environment. This makes large-scale management possible. Imagine if you are using VMware or Xen for Server Integration: in order to make security updates for your 10 virtual servers, you must log in to each machine and run the update process, which is the same as you update for 10 physical servers.

在 OpenVZ,你可以运行一个简单的 shell 脚本,就可以一次更新所有(或只是你选择的)虚拟环境。

In OpenVZ, you can run a simple shell script to update all (or just your chosen) virtual environments at once.


速搜资源网 , 版权所有丨如未注明 , 均为原创丨转载请注明原文链接:【速搜问答】OpenVZ是什么
喜欢 (0)
[361009623@qq.com]
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址