Home > Server > Install OpenVZ di CentOS

Install OpenVZ di CentOS

January 7th, 2011 Categories: Server
Web Hosting Murah
Dapatkan web hosting murah dengan Bandwidth Unmetered, cPanel terbaru, Auto Installer.
Domain Murah
Daftar domain .Com / .Net / .Org / .Info
hanya Rp. 110.000/ tahun

Langkah-langkah instalasi & Setting OpenVZ di CentOS

1. Sebelum memulai instalasi OpenVZ tambahkan dulu repo OpenVZ ke konfigurasi yum (instalasi pakai yum).

cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
rpm –import http://download.openvz.org/RPM-GPG-Key-OpenVZ

2. OpenVZ repositori memiliki beberapa versi kernel yang berbeda, (untuk lebih detailnya cek disini: http://wiki.openvz.org/Kernel_flavors), atau gunakan perintah berikut:

yum search ovzkernel

Contoh hasil :

[root@server1 yum.repos.d]# yum search ovzkernel
Loading “fastestmirror” plugin
Loading mirror speeds from cached hostfile
* base: ftp.halifax.rwth-aachen.de
* openvz-kernel-rhel5: openvz.proserve.nl
* updates: ftp.halifax.rwth-aachen.de
* addons: ftp.halifax.rwth-aachen.de
* openvz-utils: openvz.proserve.nl
* extras: ftp.halifax.rwth-aachen.de
openvz-kernel-rhel5 100% |=========================| 951 B 00:00
primary.xml.gz 100% |=========================| 22 kB 00:00
openvz-ker: ################################################## 14/14
openvz-utils 100% |=========================| 951 B 00:00
primary.xml.gz 100% |=========================| 6.7 kB 00:00
openvz-uti: ################################################## 26/26
ovzkernel-ent.i686 : The Linux kernel compiled for huge mem capable machines.
ovzkernel-PAE.i686 : The Linux kernel compiled for PAE capable machines.
ovzkernel-ent-devel.i686 : Development package for building kernel modules to match the ent kernel.
ovzkernel-PAE-devel.i686 : Development package for building kernel modules to match the PAE kernel.
ovzkernel.i686 : Virtuozzo Linux kernel (the core of the Linux operating system)
ovzkernel-xen.i686 : The Linux kernel compiled for Xen VM operations
ovzkernel-xen-devel.i686 : Development package for building kernel modules to match the kernel.
ovzkernel-devel.i686 : Development package for building kernel modules to match the kernel.
[root@server1 yum.repos.d]#

3. Pilih salah satu versi OpenVZ yang sesuai dengen kernel mesin Anda. Kemudian install,

yum install ovzkernel

Proses instalasi seharusnya secara otomatis akan memperbarui setingan GRUB bootloader. Pastikan setingan baru telah ditambahkan, buka setingan bootloader dgn text editor. Contoh dengan nano,

nano /boot/grub/menu.lst

# 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/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS OpenVZ (2.6.18-53.1.19.el5.028stab053.14)
root (hd0,0)
kernel /vmlinuz-2.6.18-53.1.19.el5.028stab053.14 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-53.1.19.el5.028stab053.14.img
title CentOS (2.6.18-92.1.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.1.1.el5 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-92.1.1.el5.img
title CentOS (2.6.18-92.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-92.el5.img

CentOS OpenVZ <= Tambahannya.

4. Selanjutnya instal beberapa tool tambahan untuk OpenVZ user

yum install vzctl vzquota

5. Buka /etc/sysctl.conf

nano /etc/sysctl.conf

pastikan sudah ada setingan spt berikut ini:

[...]
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1
[...]

Untuk memodifikasi setingan sysctl, gunakan perintah

sysctl -p

Penting: Langkah berikut ini sangat penting, apabila ip virtual machine kita berbeda dengan subnet IP host system. Jika tidak melakukan langkah berikut networking tidak akan berfungsi pada virtual machine yang baru saja kita buat.

6. Buka /etc/vz/vz.conf dan set NEIGHBOUR_DEVS ke all:

nano /etc/vz/vz.conf

[...]
NEIGHBOUR_DEVS=all
[...]

7. OpenVZ mengharus SELinux dalam kondisi disable. Buka /etc/sysconfig/selinux dan set value dari SELINUX ke disabled.

nano /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

8. Reboot sistem

reboot

9. Sampai disini jika proses reboot tidak muncul eror, Berarti proses instalasi OpenVZ telah selesai dan berhasil.

10. Cek kernel OpenVZ untuk memastikan OpenVZ telah terinstal dengan baik.

uname -r

[root@server1 ~]# uname -r
2.6.18-53.1.19.el5.028stab053.14
[root@server1 ~]#

thanks for street.walker

Mencari Hosting Murah berkualitas ? HostGuin.Com adalah solusi tepat!





|
Tags: , , ,