歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux教程

CentOS6.x安裝Xen4.2虛擬化實踐

雖然RHEL6默認不支持xen虛擬化,但是互聯網有大量的第三方源以及開源組織提供了xen4 on RHEL/CentOS6 xen的安裝,繼續開源xen應用與發展,本文采用Xen Made Easy項目網站提供的第三方安裝源,方便快捷。

本文只是實踐安裝過程,注明:安裝環境適用采用物理機進行安裝,VMware workstation環境安裝不成功。

官方安裝文檔:http://xen.crc.id.au/support/guides/install/

一、環境說明

1. 本文采用CentOS6.5 x64,安裝開發包及開發工具。

2. 關閉selinux

XenServer如何添加本地存儲 http://www.linuxidc.com/Linux/2013-06/86433.htm

開啟並配置Citrix XenServer的SNMP服務 http://www.linuxidc.com/Linux/2013-01/78487.htm

CentOS/Linux安裝 XS-Tools (XenServer) http://www.linuxidc.com/Linux/2012-10/71607.htm

XenServer教程:XenCneter實現熱遷移步驟 http://www.linuxidc.com/Linux/2012-10/71606.htm

二、開始安裝

1. 安裝bridge-utils package

[root@xen ~]# yum install bridge-utils
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
epel/metalink | 5.4 kB 00:00
* base: centos.ustc.edu.cn
* epel: mirror01.idc.hinet.net
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
base | 3.7 kB 00:00
epel | 4.4 kB 00:00
epel/primary_db | 6.2 MB 01:07
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 3.7 MB 00:09
Setting up Install Process
Package bridge-utils-1.2-10.el6.x86_64 already installed and latest version
Nothing to do

2. 安裝crc.id.au安裝源

[root@xen ~]# yum install http://au1.mirror.crc.id.au/repo/kernel-xen-release-6-5.noarch.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* epel: mirror01.idc.hinet.net
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
Setting up Install Process
kernel-xen-release-6-5.noarch.rpm | 10 kB 00:00
Examining /var/tmp/yum-root-myODPk/kernel-xen-release-6-5.noarch.rpm: kernel-xen-release-6-5.noarch
Marking /var/tmp/yum-root-myODPk/kernel-xen-release-6-5.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package kernel-xen-release.noarch 0:6-5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================
Installing:
kernel-xen-release noarch 6-5 /kernel-xen-release-6-5.noarch 3.5 k

Transaction Summary
================================================================================================================================================================================
Install 1 Package(s)

Total size: 3.5 k
Installed size: 3.5 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : kernel-xen-release-6-5.noarch 1/1
Verifying : kernel-xen-release-6-5.noarch 1/1

Installed:
kernel-xen-release.noarch 0:6-5

Complete!
[root@xen ~]#

3. 安裝xen虛擬化

[root@xen ~]# yum install xen
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* epel: mirror01.idc.hinet.net
* extras: centos.ustc.edu.cn
* kernel-xen: au1.mirror.crc.id.au
* updates: centos.ustc.edu.cn
kernel-xen | 2.9 kB 00:00
kernel-xen/primary_db | 66 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package xen.x86_64 0:4.2.4-4.el6 will be installed
base/filelists_db | 5.9 MB 00:14
epel/filelists_db | 8.7 MB 00:20
extras/filelists_db | 11 kB 00:00
kernel-xen/filelists_db | 821 kB 00:07
updates/filelists_db | 2.2 MB 00:03
--> Processing Dependency: xen-runtime = 4.2.4-4.el6 for package: xen-4.2.4-4.el6.x86_64
--> Processing Dependency: xen-licenses = 4.2.4-4.el6 for package: xen-4.2.4-4.el6.x86_64
--> Processing Dependency: xen-libs = 4.2.4-4.el6 for package: xen-4.2.4-4.el6.x86_64
--> Processing Dependency: xen-hypervisor = 4.2.4-4.el6 for package: xen-4.2.4-4.el6.x86_64
--> Processing Dependency: xen-doc = 4.2.4-4.el6 for package: xen-4.2.4-4.el6.x86_64
--> Processing Dependency: yajl for package: xen-4.2.4-4.el6.x86_64
--> Processing Dependency: libxenstore.so.3.0()(64bit) for package: xen-4.2.4-4.el6.x86_64
--> Processing Dependency: libxenguest.so.4.2()(64bit) for package: xen-4.2.4-4.el6.x86_64
--> Processing Dependency: libxenctrl.so.4.2()(64bit) for package: xen-4.2.4-4.el6.x86_64
--> Running transaction check
---> Package xen-doc.x86_64 0:4.2.4-4.el6 will be installed
---> Package xen-hypervisor.x86_64 0:4.2.4-4.el6 will be installed
--> Processing Dependency: qemu-img for package: xen-hypervisor-4.2.4-4.el6.x86_64
---> Package xen-libs.x86_64 0:4.2.4-4.el6 will be installed
---> Package xen-licenses.x86_64 0:4.2.4-4.el6 will be installed
---> Package xen-runtime.x86_64 0:4.2.4-4.el6 will be installed
---> Package yajl.x86_64 0:1.0.7-3.el6 will be installed
--> Running transaction check
---> Package qemu-img.x86_64 2:0.12.1.2-2.415.el6_5.10 will be installed
--> Processing Dependency: libusbredirparser.so.1()(64bit) for package: 2:qemu-img-0.12.1.2-2.415.el6_5.10.x86_64
--> Processing Dependency: libgfxdr.so.0()(64bit) for package: 2:qemu-img-0.12.1.2-2.415.el6_5.10.x86_64
--> Processing Dependency: libgfrpc.so.0()(64bit) for package: 2:qemu-img-0.12.1.2-2.415.el6_5.10.x86_64
--> Processing Dependency: libgfapi.so.0()(64bit) for package: 2:qemu-img-0.12.1.2-2.415.el6_5.10.x86_64
--> Running transaction check
---> Package glusterfs-api.x86_64 0:3.4.0.57rhs-1.el6_5 will be installed
---> Package glusterfs-libs.x86_64 0:3.4.0.57rhs-1.el6_5 will be installed
---> Package usbredir.x86_64 0:0.5.1-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================
Installing:
xen x86_64 4.2.4-4.el6 kernel-xen 1.0 M
Installing for dependencies:
glusterfs-api x86_64 3.4.0.57rhs-1.el6_5 updates 55 k
glusterfs-libs x86_64 3.4.0.57rhs-1.el6_5 updates 240 k
qemu-img x86_64 2:0.12.1.2-2.415.el6_5.10 updates 596 k
usbredir x86_64 0.5.1-1.el6 base 40 k
xen-doc x86_64 4.2.4-4.el6 kernel-xen 989 k
xen-hypervisor x86_64 4.2.4-4.el6 kernel-xen 4.4 M
xen-libs x86_64 4.2.4-4.el6 kernel-xen 352 k
xen-licenses x86_64 4.2.4-4.el6 kernel-xen 52 k
xen-runtime x86_64 4.2.4-4.el6 kernel-xen 5.8 M
yajl x86_64 1.0.7-3.el6 base 27 k

Transaction Summary
================================================================================================================================================================================
Install 11 Package(s)

Total download size: 13 M
Installed size: 33 M
Is this ok [y/N]: y
Downloading Packages:
(1/11): glusterfs-api-3.4.0.57rhs-1.el6_5.x86_64.rpm | 55 kB 00:00
(2/11): glusterfs-libs-3.4.0.57rhs-1.el6_5.x86_64.rpm | 240 kB 00:01
(3/11): qemu-img-0.12.1.2-2.415.el6_5.10.x86_64.rpm | 596 kB 00:03
(4/11): usbredir-0.5.1-1.el6.x86_64.rpm | 40 kB 00:00
(5/11): xen-4.2.4-4.el6.x86_64.rpm | 1.0 MB 00:06
(6/11): xen-doc-4.2.4-4.el6.x86_64.rpm | 989 kB 00:05
(7/11): xen-hypervisor-4.2.4-4.el6.x86_64.rpm | 4.4 MB 00:17
(8/11): xen-libs-4.2.4-4.el6.x86_64.rpm | 352 kB 00:02
(9/11): xen-licenses-4.2.4-4.el6.x86_64.rpm | 52 kB 00:01
(10/11): xen-runtime-4.2.4-4.el6.x86_64.rpm | 5.8 MB 00:50
(11/11): yajl-1.0.7-3.el6.x86_64.rpm | 27 kB 00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 122 kB/s | 13 MB 01:52
warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID 5838f88d: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kernel-xen
Importing GPG key 0x5838F88D:
Userid : Steven Haigh <[email protected]>
Package: kernel-xen-release-6-5.noarch (@/kernel-xen-release-6-5.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-kernel-xen
Is this ok [y/N]: y
Retrieving key from http://www.crc.id.au/repo/RPM-GPG-KEY-kernel-xen
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : yajl-1.0.7-3.el6.x86_64 1/11
Installing : glusterfs-libs-3.4.0.57rhs-1.el6_5.x86_64 2/11
Installing : glusterfs-api-3.4.0.57rhs-1.el6_5.x86_64 3/11
Installing : usbredir-0.5.1-1.el6.x86_64 4/11
Installing : 2:qemu-img-0.12.1.2-2.415.el6_5.10.x86_64 5/11
Installing : xen-hypervisor-4.2.4-4.el6.x86_64 6/11
Installing : xen-doc-4.2.4-4.el6.x86_64 7/11
Installing : xen-4.2.4-4.el6.x86_64 8/11
在 xen-watchdog 服務中讀取信息時出錯:沒有那個文件或目錄
Installing : xen-licenses-4.2.4-4.el6.x86_64 9/11
Installing : xen-libs-4.2.4-4.el6.x86_64 10/11
Installing : xen-runtime-4.2.4-4.el6.x86_64 11/11
Verifying : xen-licenses-4.2.4-4.el6.x86_64 1/11
Verifying : 2:qemu-img-0.12.1.2-2.415.el6_5.10.x86_64 2/11
Verifying : xen-4.2.4-4.el6.x86_64 3/11
Verifying : xen-hypervisor-4.2.4-4.el6.x86_64 4/11
Verifying : glusterfs-libs-3.4.0.57rhs-1.el6_5.x86_64 5/11
Verifying : yajl-1.0.7-3.el6.x86_64 6/11
Verifying : glusterfs-api-3.4.0.57rhs-1.el6_5.x86_64 7/11
Verifying : xen-runtime-4.2.4-4.el6.x86_64 8/11
Verifying : xen-doc-4.2.4-4.el6.x86_64 9/11
Verifying : xen-libs-4.2.4-4.el6.x86_64 10/11
Verifying : usbredir-0.5.1-1.el6.x86_64 11/11

Installed:
xen.x86_64 0:4.2.4-4.el6

Dependency Installed:
glusterfs-api.x86_64 0:3.4.0.57rhs-1.el6_5 glusterfs-libs.x86_64 0:3.4.0.57rhs-1.el6_5 qemu-img.x86_64 2:0.12.1.2-2.415.el6_5.10 usbredir.x86_64 0:0.5.1-1.el6
xen-doc.x86_64 0:4.2.4-4.el6 xen-hypervisor.x86_64 0:4.2.4-4.el6 xen-libs.x86_64 0:4.2.4-4.el6 xen-licenses.x86_64 0:4.2.4-4.el6
xen-runtime.x86_64 0:4.2.4-4.el6 yajl.x86_64 0:1.0.7-3.el6

Complete!
[root@xen ~]#

查看安裝

[root@xen ~]# ls -l /boot/xen.gz
lrwxrwxrwx 1 root root 12 8月 5 10:13 /boot/xen.gz -> xen-4.2.4.gz
[root@xen ~]#
[root@xen ~]#

更多詳情見請繼續閱讀下一頁的精彩內容: http://www.linuxidc.com/Linux/2014-08/105554p2.htm

Copyright © Linux教程網 All Rights Reserved