This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
технология_openvz [2011/11/30 10:52] 127.0.0.1 внешнее изменение |
технология_openvz [2012/02/21 10:38] val |
||
---|---|---|---|
Line 2: | Line 2: | ||
[[http://ru.wikipedia.org/wiki/OpenVZ]] | [[http://ru.wikipedia.org/wiki/OpenVZ]] | ||
+ | |||
+ | ===== Ubuntu 10.04 ===== | ||
[[https://help.ubuntu.com/community/OpenVZ]] | [[https://help.ubuntu.com/community/OpenVZ]] | ||
- | ===== Установка ===== | + | ==== Сборка ядра с поддержкой OpenVZ ==== |
- | <code> | + | |
- | root@hostX:~# sudo apt-get install linux-openvz vzctl | + | |
- | </code> | + | |
- | + | ||
- | What would you like to do about menu.lst? | + | |
- | + | ||
- | install the package maintainer's version | + | |
+ | [[http://wiki.openvz.org/Download/kernel/2.6.32/2.6.32-feoktistov.1]] | ||
+ | ==== Установка утилит OpenVZ ==== | ||
<code> | <code> | ||
- | root@hostX:~# shutdown -r now | + | root@gate:~# apt-get install linux-openvz vzctl |
- | root@hostX:~# uname -a | + | root@gate:~# cat /etc/sysctl.d/10-openvz.conf |
- | + | </code><code> | |
- | root@hostX:~# cat /etc/sysctl.conf | + | net.ipv4.conf.default.forwarding = 1 |
- | ... | + | net.ipv4.conf.default.proxy_arp = 1 |
- | net.ipv4.conf.default.forwarding=1 | + | net.ipv4.ip_forward = 1 |
- | net.ipv4.conf.default.proxy_arp=1 | + | |
- | net.ipv4.conf.eth0.proxy_arp = 1 | + | |
- | + | ||
- | net.ipv4.ip_forward=1 | + | |
net.ipv4.conf.all.rp_filter = 1 | net.ipv4.conf.all.rp_filter = 1 | ||
kernel.sysrq = 1 | kernel.sysrq = 1 | ||
- | net.ipv4.conf.default.send_redirects = 1 | + | net.ipv4.conf.default.send_redirects = 0 |
- | net.ipv4.conf.all.send_redirects = 0 | + | </code><code> |
+ | root@gate:~# sysctl -p | ||
- | root@hostX:~# sysctl -p | + | root@gate:~# ln -s /var/lib/vz /vz |
- | + | ||
- | root@hostX:~# ln -s /var/lib/vz /vz | + | |
</code> | </code> | ||
- | ===== Создание виртуальной машины ===== | + | ==== Создание виртуальной машины ==== |
<code> | <code> | ||
- | hostX:~# cd /var/lib/vz/template/cache/ | + | root@gate:~# cd /var/lib/vz/template/cache/ |
- | hostX:~# wget | + | |
+ | root@gate:...# wget http://download.openvz.org/template/precreated/contrib/ubuntu-10.04-minimal_10.04_i386.tar.gz | ||
- | http://download.openvz.org/template/precreated/contrib/ubuntu-8.04.2-i386-minimal.tar.gz | + | root@gate:~# vzctl create 101 --ostemplate ubuntu-10.04-minimal_10.04_i386 |
- | hostX:~# cd | + | |
- | hostX:~# vzctl create 101 --ostemplate ubuntu-8.04.2-i386-minimal | + | |
- | hostX:~# vzctl set 101 --ipadd 172.16.1.100+X --save | + | root@gate:~# vzctl set 101 --ipadd 172.16.1.100+X --save |
- | hostX:~# vzctl set 101 --hostname serverX.class.un --save | + | root@gate:~# vzctl set 101 --hostname server.corpX.un --save |
- | hostX:~# vzctl set 101 --nameserver 172.16.1.50 --save | + | root@gate:~# vzctl set 101 --nameserver 172.16.1.254 --save |
- | root@hostX:~# cat /etc/vz/conf/101.conf | + | root@gate:~# cat /etc/vz/conf/101.conf |
... | ... | ||
IP_ADDRESS="172.16.1.100+X" | IP_ADDRESS="172.16.1.100+X" | ||
Line 55: | Line 46: | ||
NAMESERVER="172.16.1.50" | NAMESERVER="172.16.1.50" | ||
- | hostX:~# vzctl start 101 | + | root@gate:~# vzctl start 101 |
- | hostX:~# vzctl enter 101 | + | root@gate:~# vzctl enter 101 |
</code> | </code> |