Ukuphatha iseva ye-OpenVZ (II)

Sanibona futhi nonke. Okokuqala, ngifuna ukunibonga nonke ngokwamukelwa okuhle engibe nakho KusukaLinux futhi, ikakhulukazi, kubasebenzi ngokwenza konke lokhu kwenzeke. Ngiyethemba ukuthi ngingaqhubeka nokusebenzisana ngokuzayo nokuthi lo mphakathi uyakhula. Kepha imizwa eyanele okwamanje, ake sehle siye ebhizinisini.

Kulesi senzakalo ngizonikezela konke okuthunyelwe ekubhekaneni nakho konke okuphathelene nokufakwa kwe- I-OpenVZ ohlelweni lwethu. Ngakho-ke sizobe sesikulungele konke kokuthunyelwe okulandelayo ukuqala ukusebenza.

Uma ukhumbula ifayili le- indatshana edlule, sikusho lokho njengamanje I-OpenVZ inokusekelwa okufanele kufakwe kukho konke ku- I-Red Hat/I-CentOS 6 njengoba ku I-Debian 7. Sizobuyekeza isinyathelo sakho sokufaka kuzo zombili izinhlelo.

Ukufakwa ku-Red Hat / CentOS 6

Lapho ufaka uhlelo lwesisekelo asikho isidingo sokwenza noma yikuphi ukucushwa okukhethekile. Kunconywa kuphela ukusebenzisa uhlelo olulandelayo lokwahlukanisa:

  • / Ukwahlukanisa: kohlelo lwesisekelo ne-openvz software. Ngokufakwa okugcwele (okunesibonisi sokuqhafaza) kufanele okungenani kube ne-3 GB, okungenani uma kusetshenziswa inguqulo okuncane o khipha.
  • Shintsha ukwahlukanisa: Kwendawo eshintshanayo. Sebenzisa usayizi onconyiwe ngokusho kwenqama yethu.
  • / Vz ukwahlukanisa: Yilapho iziqukathi nayo yonke imininingwane yazo izogcinwa khona. Kunconywa ukwaba yonke indawo esele kule ngxenye.

Lapho sesifake uhlelo lwesisekelo, siyaqhubeka nokufaka isoftware I-OpenVZ. Into yokuqala ukufaka okugciniwe I-OpenVZ eqenjini lethu ukuze sikwazi ukulanda yonke isoftware. Ukufaka nokuphatha I-OpenVZ kuyadingeka ukuthi ube nezimvume umphathi omkhulu, ngakho-ke sivula i-terminal efana izimpande futhi senza okulandelayo:

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

I-OpenVZ isebenzisa inguqulo eguquliwe ye- i-kernel linux. Ngomyalo olandelayo sizoyifaka:

#yum install vzkernel

Izinyathelo ezimbili ezilandelayo azidingeki ukufakwa okusha (kusukela enguqulweni 4.4 ye vzctl) kepha ngizophawula ngazo ukuqinisekisa ukuhambisana nezinguqulo ezindala.

Into yokuqala ukunika amandla ezinye izinketho ze- i-kernel. Sihlela ifayela sysctl.conf nomhleli wethu oyintandokazi:

#vim /etc/sysctl.conf

Futhi sengeza okulandelayo ekugcineni:

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

Udinga futhi ukukhubaza Selinux, ukuze ku CentOS Inikwe amandla ngokuzenzakalela futhi ingadala izinkinga:

#echo "SELINUX=disabled" > /etc/sysconfig/selinux

Kusukela manje kuya phambili siqhubeka ngezinyathelo zawo wonke umuntu. Sizofaka amathuluzi adingekayo wokuphathwa kwe- I-OpenVZ:

#yum install vzctl ploop

Ukwenza amakhophi wesipele sizofaka ithuluzi umagaba. Njengoba uhlobo lwezinqolobane luphelelwe yisikhathi, sizolanda iphakheji ngomzuzu:

#wget http://download.openvz.org/contrib/utils/vzdump/vzdump-1.2-4.noarch.rpm

Futhi siyifaka:

#rpm -ivh rpm -ivh vzdump-1.2-4.noarch.rpm

Manje njengoba konke sesikulungele, kusele kuphela ukuqala kabusha umshini ukuze ulayishe omusha i-kernel ngezinketho esizilungiselele.

Ukufakwa ku-Debian 7

Ukufaka I-OpenVZ en I-Debian 7, into yokuqala okufanele uyicabangele ukwahlukanisa. Njengaphakathi CentOS, Kunconywa ukudala ukwahlukaniswa kwesiqondisi I-OpenVZ lapho iziqukathi zizoba khona futhi ezithatha sonke isikhala esingeqile sezinye izingxenye ezithile (imvamisa esinye ku / esinye njengendawo yokushintshanisa). Kepha kwehlukile ku- CentOS, lo mkhombandlela uwukuthi:

/ var / lib / vz

Lapho sesiqedile ukumisa uhlelo ngendlela esiyithandayo, siyaqhubeka nokufaka I-OpenVZ. Into yokuqala ukufaka amakhosombe. Ukwenza lokhu senza lo myalo:

cat < /etc/apt/sources.list.d/openvz-rhel6.list
deb http://download.openvz.org/debian wheezy main
# deb http://download.openvz.org/debian wheezy-test main
EOF

Ngalo myalo omncane sengeze ikhosombe le- I-OpenVZ ohlelweni lwethu. Ngemuva kwalokho kufanele ulande ukhiye I-GPG ukusayina okugcina:

#wget http://ftp.openvz.org/debian/archive.key
#apt-key add archive.key

Futhi senza isibuyekezo ukuze izinqolobane zibuyekezwe:

#apt-get update

Manje singaqala ukufaka konke esikudingayo. Into yokuqala nebaluleke kakhulu ukufaka i- I-Kernel kushintshiwe. Senza kanjalo:

#apt-get install linux-image-openvz-amd64

Ngemuva kokwenza lokhu, kubaluleke kakhulu ukwenza isinyathelo esilandelayo ngaphambi kokuqalisa kabusha uhlelo. Okufanele sikwenze ukuhlela ifayili sysctl.conf ukufaka amanye amapharamitha kufayela le- i-kernel:

#vim /etc/sysctl.conf

Futhi sengeza umbhalo olandelayo ekugcineni:

# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
net.ipv4.ip_forward = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv4.conf.default.proxy_arp = 0
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
# Enables the magic-sysrq key
kernel.sysrq = 1
# We do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

Manje sesingaqala kabusha uhlelo. Eqinisweni, kunconywa ukukwenza ukuze ibhuthi nge-OpenVZ kernel. Ngemuva kwalokhu, sifaka amathuluzi adingekayo wokuphathwa kwe- I-OpenVZ:

#apt-get install vzctl vzquota ploop

Futhi ngalokhu siqeda konke okuhlobene nokufakwa kwe- I-OpenVZ. Uma konke kuhambe kahle sizobe sesikulungele ukusingatha iziqukathi.

Ngaphambi kokuvalelisa, ngizokutshela ukuthi, ezingxenyeni ezilandelayo zalesi sifundo, yonke ikhodi izobe ihlolwe kukhompyutha nge I-CentOS 6.4. Lokho ozokusebenzisa Debian kufanele uyicabangele. Umehluko mhlawumbe uzoba mncane. Okuyinhloko kuzoba indawo ye- I-OpenVZ (lapho iziqukathi zitholakala phakathi kwezinye izinto). Okwamanje ku CentOS Itholakala / vze Debian uzoyithola ku- / var / lib / vz. Uma unenkinga noma ukungabaza okuhlobene nalokhu noma yini enye, unganqikazi ukushiya amazwana futhi ngizozama ukusiza ngangokunokwenzeka.

Yilokhu okwamanje. Ingxenye elandelayo izokhuluma ngesinye sezihloko ezibaluleke kakhulu: ukwenziwa kweziqukathi nokuphathwa kwayo okuyisisekelo. Sizobonana ngaleso sikhathi. Impilo ende nokuchuma.


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-2, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   ubuthathu kusho

    Kuhle! Ngiyabonga kakhulu ngokuthunyelwa ku-OpenVZ. Nginokungabaza okuncane mayelana nokwahlukanisa. Lapho ufaka i-OS, ingabe uncoma ukudala ukwahlukanisa umkhombandlela we / var?

    1.    UJoseph Alejandro Vazquez kusho

      Yebo, njengoba i-athikili isho: "kuCentOS itholakala / i-vz, eDebian uzoyithola ku / var / lib / vz." Cacisa, ekuhlukaniseni ukufakwa kwe-debian, kukuvumela ukuthi wenze ukwahlukanisa okwenziwa ngesandla, uthatha leyo nketho bese ubeka: / var / lib / vz futhi izokwakha futhi ifake ukwahlukanisa kuleso sikhombisi ngaphandle kokuphazamiseka okukhulu, yebo / var Kuzoba umkhombandlela kuphela enkombeni yakho yezimpande, ngakho-ke zonke izingodo zakho zizolayishwa ku / ukwahlukanisa hhayi ku / var / lib / vz, nginakho kanjena futhi akunankinga, ngithemba ukuthi ngikucacisele wena.