What is LXC (Linux Containers)
LXC is a lightweight virtualization solution for Linux, sometimes called "chroot on steroids". It leverages a set of Linux kernel features (control groups, kernel namespaces etc) to provide isolation between groups of processes running on the host. In other words, in most cases the containers (virtual machines) are using the host kernel and operating system, but are isolated as if they are running on their own environent (including their own IP addresses etc).
In practical terms, I found that the LXC containers start in a sub-second. They have no visible memory overhead – for example, if a container runs the namenode, only the namenode consumes RAM, based on its java settings. They also consume very little disk space, and their file system is just stored directly in the host file system (under /var/lib/lxc/container_name/rootfs), which is very useful. You don't need to statically decide how much RAM or virtual cores to allocate each (though you could) – they consume just what they need. Actually, while the guests are isolated from each other, you can see all their processes together in the host using the ps. command as root..
Some other notes – LXC is already used by Apache Mesos and Dockers, amongst others. A "1.0" release is targeted next month (February). If you are using RHEL/CentOS, LXC is provided as a "technical preview" on RHEL 6 (likely best to use a current update).
If you want a detailed introduction, Stéphane Graber which is one of the LXC maintainer started an excellent ten-post series on LXC a couple of weeks ago.
Read full article from Creating a virtualized fully-distributed Hadoop cluster using Linux Containers | Big Data, Small Font
No comments:
Post a Comment