| 1 | = LXC - Linux Containers = |
| 2 | |
| 3 | == 2014-01-11 == |
| 4 | |
| 5 | * <參考> [http://ofirm.wordpress.com/2014/01/05/creating-a-virtualized-fully-distributed-hadoop-cluster-using-linux-containers/ Creating a virtualized fully-distributed Hadoop cluster using Linux Containers] |
| 6 | * 測試環境:Debian Wheezy 7.1 netinstall ISO with [http://github.com/jazzwang/preseed preseed] |
| 7 | {{{ |
| 8 | jazz@debian:~$ lsb_release -a |
| 9 | No LSB modules are available. |
| 10 | Distributor ID: Debian |
| 11 | Description: Debian GNU/Linux 7.3 (wheezy) |
| 12 | Release: 7.3 |
| 13 | Codename: wheezy |
| 14 | }}} |
| 15 | * 安裝 LXC |
| 16 | {{{ |
| 17 | jazz@debian:~$ sudo apt-get install lxc |
| 18 | }}} |
| 19 | * 產生虛擬機器 |
| 20 | {{{ |
| 21 | jazz@debian:~$ sudo lxc-create -t debian -n test1 |
| 22 | jazz@debian:~$ sudo lxc-start -d -n test1 |
| 23 | }}} |
| 24 | * 安裝 LXC Web Panel |
| 25 | {{{ |
| 26 | root@debian:~# wget http://lxc-webpanel.github.io/tools/install.sh -O - | bash |
| 27 | }}} |
| 28 | * <狀況> 指令可以建立 LXC VM, 但網頁似乎不太靈光。 |
| 29 | |
| 30 | == 2014-01-12 == |
| 31 | |
| 32 | * 測試環境:Ubuntu 12.04 LTS |
| 33 | {{{ |
| 34 | jazz@jazzbook:~$ lsb_release -a |
| 35 | No LSB modules are available. |
| 36 | Distributor ID: Ubuntu |
| 37 | Description: Ubuntu 12.04.2 LTS |
| 38 | Release: 12.04 |
| 39 | Codename: precise |
| 40 | }}} |
| 41 | * 感覺上 LXC 1.0 的功能比較齊全(Ex. 支援根據 DNS 分配 IP 的機制),因此直接採用 precise-backports 套件庫中的 lxc 1.0 版本 |
| 42 | {{{ |
| 43 | echo "deb http://free.nchc.org.tw/ubuntu precise-backports main universe" > /tmp/precise-backport.list |
| 44 | sudo mv /tmp/precise-backport.list /etc/apt/sources.list.d/ |
| 45 | sudo apt-get update |
| 46 | }}} |
| 47 | * 安裝 LXC 1.0 版本 |
| 48 | {{{ |
| 49 | sudo apt-get install lxc |
| 50 | }}} |