Minggu, 17 Januari 2016

Masih dengan VPS ....


Step by Step Install dan Setting OpenVZ di CentOS

Install dan Setting OpenVZ di CentOS
1. Sebelum memulai instal OpenVZ sebaiknya menambahkan repo pertama konfigurasi yum (instal menggunakan 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 jelasnya cek di sini: http://wiki.openvz.org/Kernel_flavors), atau menggunakan perintah:
yum search ovzkernel
Berikut adalah contoh output
[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 versi yang sesuai dari OpenVZ kernel dengen oleh mesin Anda. kemudian instal
yum install ovzkernel
Proses instalasi harus secara otomatis memperbarui pengaturan bootloader GRUB. Pastikan pengaturan baru telah ditambahkan, pergi ke pengaturan bootloader dengan editor teks favorit Anda (saya menggunakan nano),
nano /boot/grub/menu.lst
misalnya pengaturan bootloader GRUB nya seperti berikut:
# 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
4. Berikutnya menginstal beberapa alat tambahan untuk pengguna OpenVZ
yum install vzctl vzquota
5. Buka /etc/sysctl.conf
nano /etc/sysctl.conf
pastikan pengaturan seperti berikut:
[…]
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 mengubah pengaturan sysctl, gunakan perintah
sysctl -p
Penting: Langkah ini sangat penting, jika kita berbeda mesin virtual ip dengan IP subnet sistem host. Jika tidak melakukan langkah-langkah berikut networking tidak akan bekerja pada mesin virtual baru saja kita buat.
6. Buka /etc /vz/vz.conf Dan set NEIGHBOUR_DEVS Ke semua:
nano /etc/vz/vz.conf
Seting untuk NEIGHBOUR_DEVS
[…]
NEIGHBOUR_DEVS=all
[…]
7. OpenVZ mengharus SELinux dalam kondisi disable. Buka /etc/sysconfig/ selinux dan mengatur nilai SELinux untuk dinonaktifkan.
nano /etc/sysconfig/selinux
Seting untuk 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 di sini, jika proses tidak muncul kesalahan reboot, berarti proses instalasi OpenVZ telah selesai dan sukses.
10. Periksa untuk memastikan OpenVZ, OpenVZ kernel telah terpasang dengan benar.
uname -r
for Kernel OpenVZ installed:
[root@server1 ~]# uname -r
2.6.18-53.1.19.el5.028stab053.14
[root@server1 ~]#


http://www.blog.riauhost.net/step-by-step-install-dan-setting-openvz-di-centos.html 

Tidak ada komentar: