°²×°¹ý³Ì:
1.°²×°rhel5.1 x64°æ±¾,°²×°Ê±Ñ¡ÔñËùÓпª·¢Ïà¹ØÄÚÈÝ;
2.Éý¼¶Äں˵½µ±Ê±×îа汾(´Ówww.kernel.org ÏÂÔØ2.6.25.7,Ä¿µÄÊÇΪÁ˸üºÃÖ§³Ökvm),Éý¼¶¹ý³ÌÈçÏÂ:
a.ÏÂÔؽâѹËõ
b.# make mrproper
c.# make menuconfig(Õâ¸öʱºò°ÑÐéÄ⻯µÄÄÚÈÝÈ¥µô,ÄÚºËÄÚǶµÄkvm°æ±¾±È½Ï¾É)
d.#make
e.#make modules_install
f.#make install
g.ÐÞ¸Ä/boot/grub/menu.lst,ÈÃϵͳĬÈÏ´ÓÐÂÄÚºËÆô¶¯
3.ÏÂÔØ°²×°kvm,Èí¼þºÍÎĵµµØÖ·http://kvm.qumranet.com/kvmwiki
a.ÐÞ¸ÄÖ÷»úbiosÖÐ,VTΪON,
b.°²×°kvm,Ò²¾ÍÊÇconfigure,make,make installÈý²½Çú,
c.¼ÓÔØkvmµÄÁ½¸öÄ£¿é,modprobe kvm,modprobe kvm-intel(amdÏàӦʹÓÃkvm-adm)
4.ʹÓÃkvm°²×°ÐéÄâ»ú
a.´´½¨ÐéÄâÎļþ,qume-img create -f vmdk /test/host1.img 10G,qume-img create -f vmdg /test/data.img 10G,´´½¨µÄ¾µÏñÎļþºÍvmwareµÄÐéÄâÅÌÒ»Ñù,ÓÐÊý¾Ýʱ×Ô¶¯À©³ä.
b.ÉèÖÃkvmµÄÍøÂç:
¢Ù.Ö÷»úÉÏÐèÒª×öÒ»¸öÇŽӲÅÄÜÈÃÐéÄâ»úºÍÖ÷»úipÁ¬Í¨,ÐèÒª°²×°Ä¬ÈÏ°²×°ÊÇûÓеÄbridge-utils-1.1-2,
¢Ú.#/usr/sbin/brctl addbr br0
¢Û.#brctl addif br0 eth0
¢Ü.Ôö¼ÓÎļþ/etc/sysconfig/network-scripts/ifcfg-br0À´±£Ö¤Ã¿´ÎÖØÆô×Ô¶¯Æô¶¯Õâ¸öÇŽÓ:
DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
¢Ý.ÐÞ¸Ä/etc/sysconfig/network-scripts/ifcfg-eth0Ìí¼ÓBRIDGEÀ´Ö¸¶¨ÇŽÓÔÚÕâ¸ö½ÚµãÆô¶¯:BRIDGE=br0
¢Þ.Ôö¼ÓÒ»¸ö½Å±¾ÔÙÐéÄâÆ÷Æô¶¯Ê±ºòͨ¹ýÕâ¸öÐéÄâÍø¿¨ºÍÖ÷»ú¼°ÍâÍøͨÐÅqemu-ifup,²¢Ìí¼Ó¿ÉÖ´ÐÐȨÏÞ:
ÒýÓÃ:#!/bin/sh
set -x
switch=br0
if [ -n "$1" ];then
/usr/bin/sudo /usr/bin/tunctl -u `whoami` -t $1
/usr/bin/sudo /sbin/ip link set $1 up
sleep 0.5s
/usr/bin/sudo /usr/sbin/brctl addif $switch $1
exit 0
else
echo "Error: no interface specified"
exit 1
fi
¢ß.¿ªÊ¼°²×°ÐéÄâ»ú,qume-system-x86_64 -hda /test/hosting.img -hdb /test/data.img(ϵͳʶ±ðµ½µÄhdaºÍhdb) -m 800(Ëù·ÖÅäµÄÄÚ´æ) -net nic,model=rtl8139 -net tap,script=/qemu-ifup(Íø¿¨Ðͺż°Ê¹ÓÃÐéÄâÍø¿¨×öÇŽÓ) -cdrom /test/rhel1.img(ËùʹÓõĹâÅ̾µÏñÎļþ) -boot b(a,b,c¶ÔÓ¦ÈíÅÌ,¹âÅÌ,Ó²ÅÌ)
4.netappÄ£ÄâÆ÷µÄ°²×°
a.sh°²×°ºórun.shÔËÐÐ
b.ÅäÖÃinitiator groups,×¢²árac¸÷½ÚµãµÄinitiator,
c.aggreate¡úvolume¡úlun¡úlun map,
e.½øÐÐÍøÂçµÄÅäÖÃ,ÓÉÓÚnetappµÄÄ£ÄâÆ÷ÔÚʹÓÃbr0ʱ×ÜÈÏΪÕâ²»ÊÇÒ»¸ö¿Éʶ±ðµÄÉ豸,Òò´ËÎÒÖ»ÄÜŪÁ˸ödummyÉ豸À´¸øËûÓÃ,ÅäÖùý³ÌÈçÏÂ:
¢Ù.ÏÂÔØpiobd²¢°²×°:http://www.dur.ac.uk/c.c.dean/piobd/
¢Ú.×ödummyµÄÅäÖÃ:/etc/modprobe.confÀïÃæÌí¼ÓÈçÏÂÐÐ:
alias dummy0 dummy
options dummy numdummies=1
ÔÚ/etc/sysconfig/network-sciptesÀïÃæÌí¼ÓÎļþifcfg-dummy0:
ÒýÓÃ:# Dummy Network Device
DEVICE=dummy0
BOOTPROTO=none
ONBOOT=yes
IPV6INIT=no
TYPE=Ethernet
MACADDR=01:02:03:04:05:06
IPADDR=192.168.1.1
NETMASK=255.255.255.0
ARP=yes
¢Û¼ÓÔØÄ£¿édummy,ifup dummy0 up,ºó½«/sim/setup.shÀïÃæµÄethÌæ»»³ÉdummyÖØÐÂÖ´ÐÐ/sim/setup.sh;
¢ÜnetappÄ£ÄâÆ÷×ÔÉíÍø¿¨ipµØÖ·µÄÅäÖÃ,ÅäÖÃÁ½¸öºÍdummy0ÏàͬÍø¶ÎµÄip¼´¿É.
¢ÝÍø¹Ø¼°Â·ÓɵÄÅäÖÃ---host1,ÎÒÔÚ/etc/rc5.d/ÀïÃæÌí¼ÓÎļþS99brup,ÄÚÈÝÈçÏÂ:
ÒýÓÃ:[root@host1 rc5.d]# more S99brup
echo "1">/proc/sys/net/ipv4/ip_forward -----------------ÆôÓÃipת·¢ÈÃhost2ͨ¹ýbr0ת·¢µ½dummy0
ifconfig br0:100 177.177.100.102 netmask 255.255.255.0 up------ÅäÖÃracµÄprivateÍø¿¨
cd /sim
./bgrun.sh---------------------------ºǫ́Æô¶¯netappÄ£ÄâÆ÷,Èç¹û²»ÏȽøÈë·¾¶½«»áÕÒµ½²»Ä£ÄâÆ÷µÄÒ»¸ö¿âº¯Êý.´ËÍâÒª°²×°expertºó²ÅÄÜÔÙºǫ́ÔËÐÐÕâ¸ö³ÌÐò,rhel°²×°¹âÅÌÀïÃæ¾ÍÓÐÕâ¸ö°ü
/etc/init.d/piobd restart------------piobdÖØÆô
sleep 100---------------µÈ´ýnetappÄ£ÄâÆ÷ÍêÈ«Æô¶¯
/etc/init.d/iscsi restart----ÖØÆôiscsiÀ´Ë¢ÐÂÄ£ÄâÆ÷ÌṩµÄiscsi lun
chmod 777 /dev/sd*----ÿ´ÎiscsiÖØÐÂʶ±ðÉ豸ºóȨÏÞ¶¼ÊÇÖ»ÓÐroot¿É¶Á,ËùÒԸɴà¸Ä¶¯Ò»ÏÂ.
host2ÉÏ/etc/rc5.d/S10network½Å±¾ÀïÌí¼ÓÈçÏÂÄÚÈÝ:
ifconfig eth0:100 177.177.100.103 netmask 255.255.255.0 up
route add -net 177.177.177.0 netmask 255.255.255.0 gw 192.219.19.52 dev eth0-------------Ìí¼Ó177.177.177.0Íø¶Îµ½192.219.19.0Íø¶ÎµÄ·ÓÉ.
¢Þhost1ºÍhost2ÉϽøÐÐÆô¶¯Ë³ÐòµÄÅäÖÃ,È·±£host1ÉÏiscsiÔÚpiobdºÍÍøÂçÆô¶¯Ö®ºóÆô¶¯,Õâ¸ö¿ÉÒÔÐÞ¸Ä/etc/rc5.d/SxxÖÐxxµÄ´óСÀ´ÊµÏÖ.
5.Ö÷»ú¼°ÐéÄâ»úÉÏiscsi initiatorµÄ°²×°ºÍÅäÖÃ
a.°²×°iscsi-initiator,²é¿´iscsi-initiator name:/etc/iscsi/initiator-name
b.ÔÚnetappÐéÄâ»úÉÏ×¢²áinitiator-group,lun¡úiscsi enable
c.ÔÚlinuxÖ÷»úÉϽøÐÐiscsiÉ豸µÄÅäÖÃ:
ÒýÓÃ:¢Ù[root@host1 client]# more /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.1994-05.com.redhat:10e9c034314c
¢Ú# service iscsid start
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
# chkconfig iscsid on
¢Û# iscsiadm -m discovery -t sendtargets -p 177.177.177.200
177.177.177.200:3260,1000 iqn.1992-08.com.netapp:sn.99909261
177.177.177.201:3260,1001 iqn.1992-08.com.netapp:sn.99909261
[root@d2850l12 ~]# iscsiadm -m node -T iqn.1992-08.com.netapp:sn.99909261 -p 177.177.177.200 -l
[root@d2850l12 ~]# iscsiadm -m node -T iqn.1992-08.com.netapp:sn.99909261 -p 177.177.177.201 -l
7.crsµÄ°²×°,Ñ¡ÔñʹÓÃoracle 11g,¿ªÊ¼Ê¹ÓÃÁËoracle 10g,½á¹û10gÐèÓÃʹÓÃraw,ÿ´Î×öocrµÄ¸ñʽ»¯Ê±ºò¶¼±¨´í,ºóÀ´¸É´àʹÓÃoracle 11gÖ±½ÓÓÿéÉ豸.
a.±¾À´Ê¹ÓÃdevice mapper,µ«ÊÇ¿ªÊ¼ÎÒûÓмƻ®ºÃ°ÑnetappµÄÄ£ÄâÆ÷°²×°µ½ÁËhost2ÉÏ,ÓÉÓÚÕâ¸ö»úÆ÷ÊÇÐéÄâ»ú,½á¹ûÔÚhost2Éϵ½linkµÄʱºò×ÜÊDZȽϳ¤Ê±¼äÕâ¸ö»úÆ÷ûÓÐÏìÓ¦,×îºóhost1»áÈÏΪiscsi1Á¬½ÓµÄÉ豸ÎÞЧ,vote diskaµÄʧ°Üµ¼ÖÂÕâ¸ö½Úµãpanic.ËùÒÔÒÔºóµÄ°²×°ÊÇÔÚhost1ÉÏ°²×°netappµÄÄ£ÄâÆ÷,ͬʱÓÐʱºòdevice mapper¸üÐÂdm-xxʱ²»ÊǺܼ°Ê±,³öÏÖÉ豸ÎļþÕÒ²»µ½µÄÇé¿ö,ºóÀ´ocr¼°asm¶¼Ê¹ÓÃ/dev/disk/by-idÀïÃæµÄÉèÖÃ,¶øÇÒÓиöºÃ´¦ÊǼ°Ê±ÓдÅÅ̵ÄÌí¼Óɾ³ýÕâÀïÃæµÄÃû×Ö¶¼²»»á±ä¶¯.
b.runInstaller,°²×°µÄ¿ªÊ¼½×¶Î×ܱ¨libxp.so.6ÕÒ²»µ½µÄ´í,·ÑÁ˺ܶ๦·ò,ºóÀ´·¢ÏÖÊÇouiʹÓõÄjavaÊÇ32bit,µ±Ê±»¹¿¼ÂǹýÖ¸¶¨java_homeÖ®ÀàµÄ·½Ê½ÈÃouiʹÓÃ64bitµÄjava,µ«ÊÇÎÒûÓÐÕÒµ½°ì·¨,×îºó·¢ÏÖ°ì·¨ºÜ¼òµ¥,°²×°¸ö32bitµÄlibxp¾ÍÐÐÁË.
c.ÒòΪhost1ÉÏʹÓÃbr0,host2ʹÓÃeth0À´×öpublicÍø¿¨,vipÍø¿¨ÎÒÈÃËüÃÇʹÓÃbr0ºÍeth0µÄ±ðÃûÀ´ÊµÏÖ,crsÅäÖÃÍê³Éºó·¢ÏÖÁ½¸öÉÏÃ涼ʹÓÃbr0É豸,µ«host2Éϸù±¾¾ÍûÓÐÕâ¸öÉ豸,Õâ¸ö¿ÉÒÔʹÓÃsrvctlÀ´ÐÞ¸Ä:srvctl modify nodeapps -n host2 -A ipaddress/netmask/eth0
d.ÒòΪÆôÓÃÁË11gµÄAuto Memory Management(?),¶ÔÎÒµÄ/dev/shm×ÜÊÇÓдóСµÄÒªÇó,Óм¸´ÎinstanceÆð²»À´¾ÍÒòΪÕâ¸ö¶«Î÷̫С,ËùÓв»µÃÒÔµÄʱºòÒ²µÃÊÖ¶¯È¥ÐÞ¸ÄÆä´óС:mount tmpfs /dev/shm -t tmpfs -o size=1g