wiki:Reading/XenP/cluster

Version 8 (modified by rock, 16 years ago) (diff)

--

叢集

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 有彼此的資訊
    // node01 和 node02 的 /etc/hosts
    $ sudo vim /etc/hosts
    192.168.X.X node01
    192.168.X.X node02
    
  • 設定兩台的 auto login
    $ su root
    $ ssh-keygen -P ""
    $ cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
    $ scp -r ~/.ssh node02:~/
    
    $ ssh node02
    $ ssh node01
    CTRL + D
    CTRL + D
    
  • 設定共享的 Storage
    // node01 的設定
    $ vim /etc/export
    /home/one   192.X.X.X(rw,sync,async,no_root_squash,no_subtree_check)
    /home/domains  192.X.X.X(rw,sync,async,no_root_squash,no_subtree_check)
    $ /etc/init.d/nfs-kernel-server start
    $ showmount -a
    
    // node02 的設定
    $ sudo mount.nfs node01@/home/one /home/one
    $ sudo mount.nfs node01@/home/domains /home/domains
    $ mount
    

3.安裝 ONE

  • 3.1 安裝需要的套件
    $ sudo aptitude install ruby sqlite3 libsqlite3-0 libsqlite3-dev libsqlite3-ruby \
    libxmlrpc-c3 libxmlrpc-c3-dev scons g++ flex bison
    
  • 3.2 下載 ONE 和安裝
    $ tar zxvf one-1.2.0.tar.gz
    $ cd one-1.2.0
    $ scons
    $ sudo mkdir /home/one 
    
    // 配置 ONE 環境變數
    $ vim ~/.bashrc
    export ONE_LOCATION=/home/one
    export ONE_XMLRPC=http://localhost:2633/RPC2
    export PATH=$PATH:$ONE_LOCATION/bin
    $ source ~/.bashrc
    
    $ sudo ./install.sh -d /home/one
    
  • 3.3 啟動 ONE
    $ $ONE_LOCATION/bin/one start
    

4.使用 ONE 於 Xen Cluster

  • 4.0 編輯 ONE 設定檔
    $ cd /home/one
    $ vim etc/oned.conf
    
  • 4.1 新增 Host/dom0 到 ONE pool
    $ onehost add node01 im_xen vmm_xen tm_nfs
    $ onehost add node02 im_xen vmm_xen tm_nfs
    
    $ 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.2 Live Migrate
    $ sudo onevm livemigrate xen01 node02 
    $ sudo onevm list
    

Attachments (2)

Download all attachments as: .zip