OpenVZ: erinevus redaktsioonide vahel

Allikas: Kuutõrvaja
Mine navigeerimisribaleMine otsikasti
Jj (arutelu | kaastöö)
New page: XEN tehnoloogia pole alati sobiv eriti kui pole soovi kasutada erinevaid operatsoonisüstemee vaid sama os põhiseid eraldatud masinaid. OpenVZ ideaalne lahendus. ===Install=== emerge op...
 
Jj (arutelu | kaastöö)
Resümee puudub
5. rida: 5. rida:
===Install===
===Install===


emerge openvz-sources
emerge openvz-sources


cd /usr/src/linux
cd /usr/src/linux
make menuconfig
make menuconfig
make && make modules_install
make && make modules_install
make install
make install


emerge vzctl
emerge vzctl
rc-update add vz default
rc-update add vz default
/etc/init.d/vz start
/etc/init.d/vz start


modprobe simfs
modprobe simfs
modprobe vzethdev
modprobe vzethdev
wget ftp://mirrors.tera-byte.com/pub/gentoo/releases/x86/2007.0/stages/stage3-x86-2007.0.tar.bz2
wget ftp://mirrors.tera-byte.com/pub/gentoo/releases/x86/2007.0/stages/stage3-x86-2007.0.tar.bz2


mv /home/stage3-x86-2007.0.tar.bz2 /vz/template/cache
mv /home/stage3-x86-2007.0.tar.bz2 /vz/template/cache
bunzip2 stage3-x86-2007.0.tar.bz2
bunzip2 stage3-x86-2007.0.tar.bz2
mv stage3-x86-2007.0.tar stage3.tar
mv stage3-x86-2007.0.tar stage3.tar
gzip stage3.tar
gzip stage3.tar


vzctl create 800 --ostemplate stage3
vzctl create 800 --ostemplate stage3
vzctl start 800
vzctl start 800
vzctl enter 800
vzctl enter 800


===Võrgu seadistus===
===Võrgu seadistus===


vzctl set 900 --veth_add veth900.0,00:12:34:56:78:9A,eth0,00:12:34:56:78:9B --save
vzctl set 900 --veth_add veth900.0,00:12:34:56:78:9A,eth0,00:12:34:56:78:9B --save
ifconfig veth900.0 0
ifconfig veth900.0 0


Warning: --veth_add option is outdated use --netif_add instead
Warning: --veth_add option is outdated use --netif_add instead
Configure meminfo: 49152
Configure meminfo: 49152
Configure veth devices: veth101.0
Configure veth devices: veth101.0
Saved parameters for VE 800
Saved parameters for VE 800


echo 1 > /proc/sys/net/ipv4/conf/veth900.0/forwarding
echo 1 > /proc/sys/net/ipv4/conf/veth900.0/forwarding
echo 1 > /proc/sys/net/ipv4/conf/veth900.0/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/veth900.0/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
vzctl exec 900 ifconfig eth0 0
vzctl exec 900 ifconfig eth0 0
vzctl exec 900 ifconfig eth0 193.40.0.193 netmask 255.255.255.128
vzctl exec 900 ifconfig eth0 193.40.0.193 netmask 255.255.255.128
vzctl exec 900 route add default dev eth0
vzctl exec 900 route add default dev eth0
route add 193.40.0.193 dev veth900.0
route add 193.40.0.193 dev veth900.0
   
   


# ifconfig veth900.0
# ifconfig veth900.0
  veth900.0 Link encap:Ethernet  HWaddr 00:12:34:56:78:9A
  veth900.0 Link encap:Ethernet  HWaddr 00:12:34:56:78:9A
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
60. rida: 60. rida:
===Edasine häälestus===
===Edasine häälestus===


mkdir /vz/root/800/usr/portage
mkdir /vz/root/800/usr/portage
mount -o bind /usr/portage /vz/root/800/usr/portage
mount -o bind /usr/portage /vz/root/800/usr/portage


In order for VE to work, some nodes should be present in VE's /dev. For
In order for VE to work, some nodes should be present in VE's /dev. For
73. rida: 73. rida:
distribution-dependent; please add info for your distro here.
distribution-dependent; please add info for your distro here.


nano /etc/conf.d/rc
nano /etc/conf.d/rc
RC_DEVICES="static"
RC_DEVICES="static"




80. rida: 80. rida:


http://wiki.openvz.org/Virtual_Ethernet_device
http://wiki.openvz.org/Virtual_Ethernet_device
http://wiki.openvz.org/Gentoo_template_creation
http://wiki.openvz.org/Gentoo_template_creation

Redaktsioon: 4. jaanuar 2008, kell 19:12

XEN tehnoloogia pole alati sobiv eriti kui pole soovi kasutada erinevaid operatsoonisüstemee vaid sama os põhiseid eraldatud masinaid. OpenVZ ideaalne lahendus.

Install

emerge openvz-sources
cd /usr/src/linux
make menuconfig
make && make modules_install
make install
emerge vzctl
rc-update add vz default
/etc/init.d/vz start
modprobe simfs
modprobe vzethdev
wget ftp://mirrors.tera-byte.com/pub/gentoo/releases/x86/2007.0/stages/stage3-x86-2007.0.tar.bz2
mv /home/stage3-x86-2007.0.tar.bz2 /vz/template/cache
bunzip2 stage3-x86-2007.0.tar.bz2
mv stage3-x86-2007.0.tar stage3.tar
gzip stage3.tar
vzctl create 800 --ostemplate stage3
vzctl start 800
vzctl enter 800

Võrgu seadistus

vzctl set 900 --veth_add veth900.0,00:12:34:56:78:9A,eth0,00:12:34:56:78:9B --save
ifconfig veth900.0 0
Warning: --veth_add option is outdated use --netif_add instead
Configure meminfo: 49152
Configure veth devices: veth101.0
Saved parameters for VE 800
echo 1 > /proc/sys/net/ipv4/conf/veth900.0/forwarding
echo 1 > /proc/sys/net/ipv4/conf/veth900.0/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
vzctl exec 900 ifconfig eth0 0
vzctl exec 900 ifconfig eth0 193.40.0.193 netmask 255.255.255.128
vzctl exec 900 route add default dev eth0
route add 193.40.0.193 dev veth900.0

# ifconfig veth900.0
veth900.0 Link encap:Ethernet  HWaddr 00:12:34:56:78:9A
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6569 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7785 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1011288 (987.5 Kb)  TX bytes:7733410 (7.3 Mb)


Edasine häälestus

mkdir /vz/root/800/usr/portage
mount -o bind /usr/portage /vz/root/800/usr/portage

In order for VE to work, some nodes should be present in VE's /dev. For modern distributions, udev is taking care of it. For a variety of reasons udev doesn't make much sense in a VE, so the best thing to do is to disable udev and create needed device nodes manually.

Note that in some distributions /dev is mounted on tmpfs — this will not work in case of static /dev. So what you need to do is find out where /dev is being mounted on tmpfs and remove this. This is highly distribution-dependent; please add info for your distro here.

nano /etc/conf.d/rc
RC_DEVICES="static"


Lingid

http://wiki.openvz.org/Virtual_Ethernet_device

http://wiki.openvz.org/Gentoo_template_creation