| | 1 | = Integrate Xen and Lustre on CentOS 5.1 = |
| | 2 | == 1. 簡介 == |
| | 3 | * 目標 : [[BR]] |
| | 4 | 編譯具有 lustre 與 Xen 功能的 CentOS 5.1 核心。 |
| | 5 | * 方法 : [[BR]] |
| | 6 | CentOS 5.1 在安裝時, 便會提示是否要直接安裝具有'''虛擬化'''功能的核心, 我們可以藉由這個核心開機, 在新增 lustre 的相關 kernel 模組即可. |
| | 7 | 這個方式較先前要編譯的方式簡單也快速許多, 以下是詳細的步驟. |
| | 8 | == 2. 編譯步驟 == |
| | 9 | === 2.1 使用 yum 安裝所需要的套件 : === |
| | 10 | * 2.1.1 '''gcc''' |
| | 11 | * 2.1.2 '''openssl-devel''' |
| | 12 | * 2.1.3 '''zlib-devel''' |
| | 13 | * 2.1.4 '''python-devel''' |
| | 14 | * 2.1.5 '''libX11-devel''' |
| | 15 | * 2.1.6 '''ncurses-devel''' |
| | 16 | * 2.1.7 '''diffstat''' |
| | 17 | * 2.1.8 '''rpm-build''' |
| | 18 | {{{ |
| | 19 | [root@lustre_xen ~]# yum install gcc openssl-devel zlib-devel python-devel libX11-devel ncurses-devel diffstat rpm-build |
| | 20 | }}} |
| | 21 | === 2.2 下載所需要的檔案 : === |
| | 22 | * 2.2.1 '''lustre-1.6.5'''[[BR]] |
| | 23 | Lustre 自從被 Sun 公司所併購之後,目前最新的套件必須先至 Sun 的網站免費註冊之後才可下載,[http://www.sun.com/software/products/lustre/get.jsp 前往下載]。以 lustre-1.6.5 為例,檔案名稱為 lustre-1.6.5.tar.gz。 |
| | 24 | {{{ |
| | 25 | [root@lustre_xen ~] tar -zxvf lustre-1.6.5.tar.gz |
| | 26 | }}} |
| | 27 | * 2.2.2 '''linux-2.6.18-53.1.14.el5.tar.bz2''' |
| | 28 | Lustre 自從被 Sun 公司所併購之後,目前最新的套件必須先至 Sun 的網站免費註冊之後才可下載,[http://www.sun.com/software/products/lustre/get.jsp 前往下載]。以 lustre-1.6.5 為例,檔案名稱為 linux-2.6.18-53.1.14.el5.tar.bz2 |
| | 29 | {{{ |
| | 30 | [root@lustre_xen ~] tar -jxvf linux-2.6.18-53.1.14.el5.tar.bz2 -C /usr/src/ |
| | 31 | }}} |
| | 32 | * 2.2.3 '''quilt''' |
| | 33 | {{{ |
| | 34 | [root@lustre_xen ~] wget ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/5/i386/quilt-0.46-1.el5.i386.rpm |
| | 35 | [root@lustre_xen ~] rpm -ivh quilt-0.46-1.el5.i386.rpm |
| | 36 | }}} |
| | 37 | === 2.3 編譯 lustre 所提供的 kernel === |
| | 38 | * 2.3.1 接著就可以開始編譯剛剛解壓縮到 /usr/src 的核心檔案,此核心檔案是由 lustre 的官方網站所提供,並且提供可編譯出具有 xen + lustre 功能模組的設定檔 |
| | 39 | (config/kernel-2.6.18-i686-xen.config),將此核心檔案編譯成模組,最後在開機時讀入此模組,便可以成為一個具有 lustre + xen 功能的核心了 |
| | 40 | * 2.3.2 首先,由於這是一個尚未 patch 過 lustre 的核心(Sun網站在下載此檔的地方有附註),因此在編譯之前,我們先 patch 這個核心 |
| | 41 | {{{ |
| | 42 | [root@luxen ~]# cd /usr/src/linux-2.6.18-53.1.14/ |
| | 43 | [root@luxen linux-2.6.18-53.1.14]# ln -s /root/lustre-1.6.5/lustre/kernel_patches/patches/ . |
| | 44 | [root@luxen linux-2.6.18-53.1.14]# ln -s /root/lustre-1.6.5/lustre/kernel_patches/series/2.6-rhel5.series series |
| | 45 | }}} |
| | 46 | * 2.3.3 成功 patch 之後,開始進行編譯並且安裝核心模組 |
| | 47 | {{{ |
| | 48 | [root@luxen linux-2.6.18-53.1.14]# make && make install && make moduels_install |
| | 49 | [root@luxen linux-2.6.18-53.1.14]# mkinitrd /boot/initrd-2.6.18-prep.img 2.6.18-prep |
| | 50 | }}} |
| | 51 | * 2.3.4 修改 /boot/grub/menu.lst 如下 |
| | 52 | {{{ |
| | 53 | [root@luxen linux-2.6.18-53.1.14]# cat /boot/grub/menu.lst |
| | 54 | # grub.conf generated by anaconda |
| | 55 | # |
| | 56 | # Note that you do not have to rerun grub after making changes to this file |
| | 57 | # NOTICE: You have a /boot partition. This means that |
| | 58 | # all kernel and initrd paths are relative to /boot/, eg. |
| | 59 | # root (hd0,0) |
| | 60 | # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 |
| | 61 | # initrd /initrd-version.img |
| | 62 | #boot=/dev/sda |
| | 63 | default=0 |
| | 64 | timeout=5 |
| | 65 | splashimage=(hd0,0)/grub/splash.xpm.gz |
| | 66 | hiddenmenu |
| | 67 | title CentOS (2.6.18-prep) |
| | 68 | root (hd0,0) |
| | 69 | kernel /xen.gz-2.6.18-53.el5 |
| | 70 | module /vmlinuz-2.6.18-prep ro root=/dev/VolGroup00/LogVol00 rhgb quiet |
| | 71 | module /initrd-2.6.18-prep.img |
| | 72 | title CentOS (2.6.18-53.el5xen) |
| | 73 | root (hd0,0) |
| | 74 | kernel /xen.gz-2.6.18-53.el5 |
| | 75 | module /vmlinuz-2.6.18-53.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet |
| | 76 | module /initrd-2.6.18-53.el5xen.img |
| | 77 | }}} |
| | 78 | * 2.3.5 重新開機啟動讀入具有 lustre 功能的模組 |
| | 79 | {{{ |
| | 80 | [root@luxen linux-2.6.18-53.1.14]# reboot |
| | 81 | }}} |