RHEL5下的OpenVZ安装与配置

  1. 云栖社区>
  2. 博客>
  3. 正文

RHEL5下的OpenVZ安装与配置

五岳之巅 2009-12-11 15:51:38 浏览433
展开阅读全文
[root@localhost ~]# cd /etc/yum
yum/ yum.conf yum.repos.d/
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
rhel-debuginfo.repo
[root@localhost yum.repos.d]# wget http://download.openvz.org/openvz.repo
--10:21:00-- http://download.openvz.org/openvz.repo
正在解析主机 download.openvz.org... 64.131.90.11
Connecting to download.openvz.org|64.131.90.11|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2931 (2.9K) [text/plain]
Saving to: `openvz.repo'

100%[========================

===============>] 2,931 10.7K/s in 0.3s

10:21:02 (10.7 KB/s) - `openvz.repo' saved [2931/2931]

[root@localhost yum.repos.d]# rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
[root@localhost yum.repos.d]# yum install ovzkernel -smp
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
Loading "security" plugin
usage: yum [options]

Command line error: no such option: -s
[root@localhost yum.repos.d]# yum install ovzkernel-smp
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
Loading "security" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
openvz-kernel-rhel5 100% |=========================| 951 B 00:00
openvz-utils 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 25 kB 00:02
################################################## 14/14
primary.xml.gz 100% |=========================| 6.2 kB 00:00
################################################## 26/26
Parsing package install arguments
No Match for argument: ovzkernel-smp
Nothing to do
[root@localhost yum.repos.d]# yum install ovzkernel-enterprise
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
Loading "security" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
No Match for argument: ovzkernel-enterprise
Nothing to do
[root@localhost yum.repos.d]# yum install ovzkernel
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
Loading "security" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for ovzkernel to pack into transaction set.
ovzkernel-2.6.18-164.2.1. 100% |=========================| 485 kB 00:15
---> Package ovzkernel.i686 0:2.6.18-164.2.1.el5.028stab066.7 set to be installed
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
ovzkernel i686 2.6.18-164.2.1.el5.028stab066.7 openvz-kernel-rhel5 19 M

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 19 M
Is this ok [y/N]: y
Downloading Packages:
(1/1): ovzkernel-2.6.18-1 100% |=========================| 19 MB 25:03
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: ovzkernel ######################### [1/1]

Installed: ovzkernel.i686 0:2.6.18-164.2.1.el5.028stab066.7
Complete!

[root@localhost yum.repos.d]# vi /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title OpenVZ (2.6.18-164.2.1.el5.028stab066.7)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.2.1.el5.028stab066.7 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-164.2.1.el5.028stab066.7.img
title Red Hat Enterprise Linux Server (2.6.18-53.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-53.el5.img
-- INSERT --
[root@localhost yum.repos.d]# vi /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

-- INSERT --
[root@localhost yum.repos.d]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
[root@localhost yum.repos.d]# yum install vzctl vzquota
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
Loading "security" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
openvz-kernel-rhel5 100% |=========================| 951 B 00:00
openvz-utils 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 5.8 kB 00:00
################################################## 26/26
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for vzctl to pack into transaction set.
vzctl-3.0.23-1.i386.rpm 100% |=========================| 19 kB 00:07
---> Package vzctl.i386 0:3.0.23-1 set to be updated
---> Downloading header for vzquota to pack into transaction set.
vzquota-3.0.12-1.i386.rpm 100% |=========================| 3.7 kB 00:07
---> Package vzquota.i386 0:3.0.12-1 set to be updated
--> Running transaction check
--> Processing Dependency: libvzctl-0.0.2.so for package: vzctl
--> Processing Dependency: vzctl-lib = 3.0.23-1 for package: vzctl
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for vzctl-lib to pack into transaction set.
vzctl-lib-3.0.23-1.i386.r 100% |=========================| 2.7 kB 00:00
---> Package vzctl-lib.i386 0:3.0.23-1 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
vzctl i386 3.0.23-1 openvz-utils 143 k
vzquota i386 3.0.12-1 openvz-utils 82 k
Installing for dependencies:
vzctl-lib i386 3.0.23-1 openvz-utils 175 k

Transaction Summary
=============================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 400 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): vzctl-3.0.23-1.i38 100% |=========================| 143 kB 00:20
(2/3): vzquota-3.0.12-1.i 100% |=========================| 82 kB 00:20
(3/3): vzctl-lib-3.0.23-1 100% |=========================| 175 kB 00:22
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: vzctl-lib ######################### [1/3]
Installing: vzquota ######################### [2/3]
Installing: vzctl ######################### [3/3]

Installed: vzctl.i386 0:3.0.23-1 vzquota.i386 0:3.0.12-1
Dependency Installed: vzctl-lib.i386 0:3.0.23-1
Complete!
[root@localhost yum.repos.d]# reboot

网友评论

登录后评论
0/500
评论