LXC Linux Containers provides the resource management through the control groups aka process containers and resource isolation through the namespaces.
Installation
-
The basic installation of lxc containers requires three package:
apt-get install bridge-utils debootstrap lxc
-
We need to mount the virtual control group file system on /cgroup:
mkdir /cgroup
echo "cgroup /cgroup cgroup defaults 0 0" >> /etc/fstab
mount -a
Network Bridge
- Add network bridge to primary network interface (file /etc/network/interfaces):
# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_fd 0
bridge_maxwait 0
bridge_stp off
-
Restart networking:
/etc/init.d/networking restart
What is amazing about lxc is how it is savy to resources. A newly started container takes not much but just extra 1M of memory.
No comments :
Post a Comment