CentOS5.1, OpenVZインストール

repoを用意します。

[root@test1 etc]# cd yum.repos.d/
[root@test1 yum.repos.d]# ls
CentOS-Base.repo
[root@test1 yum.repos.d]# wget http://download.openvz.org/openvz.repo
--07:39:14--  http://download.openvz.org/openvz.repo
           => `openvz.repo'
07:39:15 (1.79 MB/s) - `openvz.repo'[2179/2179]
[root@test1 yum.repos.d]# ls
CentOS-Base.repo  openvz.repo
[root@test1 yum.repos.d]# rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ

openVZをインストールします。

[root@test1 yum.repos.d]# yum install ovzkernel

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Removing:
 lksctp-tools            i386       1.0.2-6.4E.1     installed         144 k
Removing for dependencies:
 lksctp-tools-devel      i386       1.0.2-6.4E.1     installed         137 k

Transaction Summary
=============================================================================
Install      0 Package(s)
Update       0 Package(s)
Remove       2 Package(s)
Total download size: 0
Is this ok [y/N]: y
[root@test1 ~]# yum install ovzkernel

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 ovzkernel               i686       2.6.18-53.1.6.el5.028stab053.6  openvz-kernel-rhel5   17 M

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 17 M
Is this ok [y/N]: y

grub.confを編集してOpenVZが起動するようにします。

[root@test1 ~]# cd /boot/grub/
[root@test1 grub]# vi 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-53.1.6.el5.028stab053.6)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-53.1.6.el5.028stab053.6 ro root=/dev/sda5
        initrd /initrd-2.6.18-53.1.6.el5.028stab053.6.img
title CentOS-4 i386 (2.6.9-34.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-34.EL ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.9-34.EL.img

sysctl.confを編集します。

[root@test1 grub]# cd /etc/
[root@test1 etc]# vi 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.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.proxy_arp = 0

# Controls source route verification
net.ipv4.conf.all.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

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

kernel.ve_allow_kthreads = 1

selinuxを起動しないようにします。

[root@test1 etc]# vi /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

modprobe.confを編集します。

[root@test1 etc]# vi /etc/modprobe.conf

alias eth0 e1000
alias eth1 e1000
alias scsi_hostadapter aic7xxx
alias usb-controller ohci-hcd
options ip_conntrack ip_conntrack_enable_ve0=1

OSを再起動。

広告

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト / 変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト / 変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト / 変更 )

Google+ フォト

Google+ アカウントを使ってコメントしています。 ログアウト / 変更 )

%s と連携中