= 叢集 = == 1.佈署成Cluster == 1. 可使用 DRBL 或 !CloneZilla 來佈署 Cluster 2. 此次為了方便,可直接使用隔壁桌的電腦 ---- == 2.第二台機器的設定 == * 更改第二台主機名稱 node02 {{{ $ sudo vim /etc/hostname $ sudo hostname -f /etc/hostname CTRL + D $ sudo /etc/init.d/gdm restart }}} * 重複單機的 0 ~ 4 步驟 * 確認 /etc/hosts 有彼此的資訊 * 設定兩台的 auto login {{{ $ ssh-keygen -P "" $ cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys $ scp -r ~/.ssh node02:~/ $ ssh node02 $ ssh node01 CTRL + D }}} ---- == 3.安裝 ONE == * '''''__3.1 安裝需要的套件__''''' {{{ $ sudo aptitude install ruby sqlite3 libsqlite3-0 libsqlite3-dev libsqlite3-ruby \ libxmlrpc-c3 libxmlrpc-c3-dev scons g++ flex bison }}} * '''''__[http://www.opennebula.org/doku.php?id=software 3.2 下載 ONE 和安裝]__''''' {{{ $ tar zxvf one-1.2.0.tar.gz $ cd one-1.2.0 $ scons $ sudo mkdir /home/one $ sudo ./install.sh -d /home/one }}} * '''''__3.3 配置 ONE__''''' {{{ $ sudo vim /etc/profile export ONE_LOCATION=/home/one export ONE_XMLRPC=http://localhost:2633/RPC2 export PATH=$ONE_LOCATION/bin:$PATH $ source /etc/profile }}} * '''''__3.4 啟動 ONE__''''' {{{ $ sudo $ONE_LOCATION/bin/one start }}} ---- == 4.使用 ONE 於 Xen Cluster == * '''''__4.1 新增 Host/dom0 到 ONE pool__''''' {{{ $ sudo onehost add node01 im_xen vmm_xen tm_ssh $ sudo onehost add node02 im_xen vmm_xen tm_ssh $ sudo onehost list }}} * '''''__4.1 使用 ONE 來開啟 VM__''''' {{{ $ cat /etc/xen/xen01.one NAME = hadoop01 CPU = 1 MEMORY = 156 OS = [ kernel = /boot/vmlinuz-2.6.22.9, initrd = /boot/initrd.img-2.6.22.9, root = sda1, kernel_cmd = "ro xencons=tty console=tty1"] DISK = [ source = /home/domains/xen01/disk.img, clone = no, target = sda1, readonly = no] DISK = [ type = swap, size = 512, target = "sda2", readonly = "no" ] NIC = [NETWORK = "net", IP = "X.X.X.X"] $ sudo onevm create xen01.one $ sudo onevm list }}} ---- == 5.設定 ONE 的網路 == {{{ $ sudo vim /etc/xen/net.one $ sudo onevnet create net.one }}} ---- == 6.使用 ONE 開啟 Cluster == {{{ $ cd /home/one $ ./one_create_cluster.sh }}} ---- == 7.測試 Live Migration == * '''''__7.1 建立共享的Storage (使用NFS)__''''' {{{ // node01 的設定 $ vim /etc/export // node02 的設定 $ sudo mount -t nfs node01@/home/one /home/one }}} * '''''__7.2 Live Migrate__''''' {{{ $ sudo onevm livemigrate xen01 node02 $ sudo onevm list }}}