scstÓëtgtµÄʹÓÃ˵Ã÷ ÏÂÔر¾ÎÄ

SCST½Ó¿Ú

ÔÚÃüÁîÐÐÊäÈëscstadmin¾Í¿ÉÒԲ鿴scstadminµÄÃüÁîÐвÎÊý£¬¿ÉÒÔÖ±¹ÛµÄ¿´µ½scstadminËùÓеIJÎÊýºÍ½âÊÍ£¬»¹ÓÐÊÂÀý¡£

Ò»¡¢»ù±¾²Ù×÷£º

£¨1£© ¨Cconfig ÓÃÖ¸¶¨µÄÅäÖÃÎļþÅäÖÃscst¡£ÎªÅäÖÃÎļþ·¾¶ ±ÈÈ磺ÊäÈë scstadmin ¨Cconfig /etc/scst.conf ¶ÁÈ¡/etc/scst.conf ϵͳÆô¶¯Ê±»á×Ô¶¯¶ÁÈ¡/etc/scst.confµÄÅäÖÃ

£¨2£© ¨Cclearconfig Çå³ýËùÓеÄscstÅäÖ㨵«scstÅäÖÃÎļþûÓб»Çå³ý£©

£¨3£© ¨Cwriteconfig °Ñµ±Ç°µÄscstÅäÖÃдÈëÅäÖÃÎļþ¡£ÎªÅäÖÃÎļþ·¾¶ ±ÈÈ磺ÊäÈëscstadmin ¨Cwriteconfig /etc/scst.conf °ÑÅäÖÃдÈëscst.conf

£¨4£© ¨Ccheckconfig ¼ì²éµ±Ç°scstÅäÖÃÓëÅäÖÃÎļþÊÇ·ñÏàͬ¡£ÎªÅäÖÃÎļþ·

¾¶

£¨5£© ¨Csession ²é¿´µ±Ç°scstÓëËùÓÐinitiator¶ËµÄÁ¬½Ó״̬ ±ÈÈ磺ÊäÈë scstadmin ¨Csessionºó »áÁгöÏÂ±í£º

ÆäÖкì¿ò²¿·ÖÊÇÒѾ­Á¬½ÓµÄ¿Í»§¶Ë¡£ Target NameÀ¸»áÏÔʾÕâÐÐÁ¬½ÓµÄÁ¬½ÓÀàÐÍ£¨ib fc»òiscsi£© Initiator Name»áÁгöinitiator¶ËµÄÃû×Ö(ibÁ¬½ÓÊÇGuid¡¢fcÊÇWWNp¡¢iscsiÊÇiqnºÅ) Group Name»áÁгöÕâÐÐÁ¬½ÓʹÓõÄGroup×éÃû¡£ ¶þ¡¢ É豸²Ù×÷ £¨1£©-adddev -handler -path -options -blocksize ÏòhandlerÌí¼ÓÒ»¸ö¿éÉ豸 ½âÊÍһϲÎÊý£ºÊÇÌí¼ÓºóµÄ´ÅÅÌÃû³Æ£¬¿ÉÒÔËæÒâÆðÃû¡£ ÊÇhanglerµÄÀàÐÍ£¬ÕâÀïÎÒÃDZØÐëÖ¸¶¨Îªvdisk ÊÇÒªÌí¼Ó´ÅÅ̵Ä·¾¶£¬±ÈÈç/dev/vg0/iscsi0 ÊÇÑ¡ÔñÉ豸µÄ¶Áȡģʽ£¬ÆäÖÐÓÐÈçÏÂÑ¡ÏîWRITE_THROUGH, READ_ONLY, NV_CACHE, BIO,Èç²»¼ÓoptionsÑ¡ÏÔòĬÈÏΪfile_ioģʽ ÊÇÓ³ÉäºóµÄ´ÅÅÌ¿é´óС£¬Èç¹û²»¼Ó-blocksizeÑ¡ÏÔòĬÈÏ¿é´óСΪ512 ±ÈÈçÊäÈë scstadmin -adddev DISK01 -handler vdisk -path /vdisks/disk01.dsk -options READ_ONLY,WRITE_THROUGH¾ÍÊÇÌí¼ÓÒ»¸ö·¾¶Îª/vdisks/disk01.dskµÄ´ÅÅÌ£¬´ÅÅÌÃû³ÆΪDISK01£¬Ä£Ê½ÎªÖ»¶ÁµÄºÍWRITE_THROUGHģʽ£¬Ä¬ÈÏ¿é´óС512¡£

£¨2£©-removedev -handler ´ÓhandlerÖÐÒƳýÒ»¸öÒÑÌí¼ÓµÄÅÌ¡£ ±ÈÈçÊäÈëscstadmin -removedev DISK01 ¨Chandler vdisk »á°ÑÉÏÒ»²½Ìí¼Ó½øµÄÅÌ´ÓhandlerÖÐÒƳý¡£

£¨3£©-resyncdev -handler ¶¯Ì¬¸ü¸Ä´ÅÅÌÈÝÁ¿ºó£¬Ò첽֪ͨ¡£×¢ÒâÕâ¸ö

ÃüÁîÖ»ÓÐÔÚscst 1.0.1.1ÒÔºóµÄ°æ±¾²ÅÓС££¨Ö»¶ÔiscsiÓÐЧ£© Èý¡¢×é²Ù×÷ £¨1£©-addgroup ´´½¨Ò»¸ö×é ¡£Îª×éÃû¡£ ±ÈÈçscstadmin ¨Caddgroup HOST01 ´´½¨Ò»¸öÃûΪHOST01µÄ×é £¨2£©-removegroup ɾ³ýÒ»¸öÒÑ´´½¨µÄ×é ËÄ¡¢Óû§²Ù×÷ £¨1£©-adduser -group Ìí¼ÓÒ»¸öÓû§µ½×é¡£²ÎÊý ·ÖÈýÖÖ£º¹âÏËΪWWNPºÅ£¬IBΪGuid£¬iSCSIΪiqnÃû³Æ¡£ Ϊ×éÃû ±ÈÈçscstadmin -adduser 50:06:0B:00:00:39:71:78 ¨Cgroup HOST1 Ïò×éHOST1Ìí¼ÓÒ»¸öÔ¶¶ËFC¿¨µÄWWNPºÅ £¨2£©-removeuser -group ´Ó×éÖÐɾ³ýÒ»¸öÓû§¡£ £¨3£©-clearuser ¨Cgroup Çå¿ÕÖ¸¶¨×éµÄËùÓÐÓû§¡£ Îå¡¢Ïò×éÖÐÌí¼Ó»òÐÞ¸ÄÉ豸µÄ²Ù×÷ £¨1£©-assigndev -group -lun ΪµÚ¶þ²½ £¨¡°¶þ¡¢É豸²Ù×÷¡±£©ÖÐÏòhandlerÌí¼ÓµÄÉ豸Ãû³Æ¡£ Ö¸¶¨ÒªÌí¼ÓµÄ×éÃû ΪlunºÅ£¬×¢Ò⣺ÿ×éµÄlunºÅ±ØÐë´Ó0¿ªÊ¼£¡£¡ ±ÈÈçscstadmin -assigndev DISK01 -group HOST01 -lun 0£¬Ïò×éHOST01ÖÐÌí¼ÓÒ»¸öDISK01µÄÅÌ£¬´Ë¿éÅ̵ÄlunºÅΪ0 £¨2£©-releasedev -group ´ÓÖ¸¶¨×éÖÐÒƳýÒ»¸öÒÑÌí¼ÓµÄÉ豸¡£ £¨3£©-cleardevs ¨Cgroup Çå¿ÕÖ¸¶¨×éÖÐËùÓÐÒÑÌí¼ÓµÄÅÌ¡£ ¿ªÆô¹Ø±Õ·þÎñ£º (1) /etc/init.d/iscsi-scst Ϊiscsi·þÎñ (2) /etc/init.d/openibd Ϊib¿¨·þÎñ£¬Èç¹û¹Ø±Õ£¬Ôòib¿¨»áping²»Í¨¡£ (3) /proc/scsi_tgt/qla_isp/X XΪÕâ¸öĿ¼ÏÂÒ»¸öÎļþÃûΪÊý×ÖµÄÎļþ£¬ÏòXдÈëenable all»òÕßdisable all»á¿ªÆô¹Ø±Õ¹âÏË¿¨µÄ·þÎñ¡£ ±ÈÈçecho ¡°enable all¡± >/proc/scsi_tgt/qla_isp/2 ¿ªÆô¹âÏË¿¨Á¬½Ó ¹âÏË¿¨µÄÁ¬½ÓÒ²¿ÉÒÔͨ¹ýscstadminÃüÁî¹Ø±Õ¡£±ÈÈçtarget¶ËµÄ¹âÏË¿¨port WWNºÅΪ21£º00£º00£º1b£º32£º92£º5b£º72 scstadmin ¨Cenable 21£º00£º00£º1b£º32£º92£º5b£º72 ¿ªÆô´Ë¹âÏË¿¨·þÎñ scstadmin ¨Cdisable 21£º00£º00£º1b£º32£º92£º5b£º72¹Ø±Õ¹âÏË¿¨·þÎñ ²é¿´µ±Ç°scstÉèÖ㺠scst»áÔÚ/proc/scsi_tgtĿ¼ÏÂÊä³öÐÅÏ¢¡£ÎÒÃÇ¿ÉÒÔͨ¹ý²é¿´Õâ¸öĿ¼ÏµÄÎļþÀ´Á˽⵱ǰscstµÄÅäÖᣠ£¨1£©/proc/scsi_tgt/groupsĿ¼ÏÂÿһ¸öÎļþ¼ÐµÄÃû³ÆΪÒѾ­´´½¨µÄ×飬¿É½øÈëÕâ¸öÎļþ¼Ð²é¿´Ã¿×éÌí¼Ó½øµÄÉ豸ºÍÓû§Ãû¡£

£¨2£©/proc/scsi_tgt/vdiskϵÄvdiskÎļþ¿ÉÒԲ鿴µ±Ç°Ìí¼Ó½øhandlerµÄÉ豸ÃûÒÔ¼°É豸ÐÅÏ¢¡£±ÈÈçcat /proc/scsi/vdisk/vdisk¡£Ìí¼ÓÁË8¿éÅÌ£¬×¢ÒâOptionsÕâÐÐÖ¸¶¨ÁËÿ¿éÅ̵ÄÀàÐÍ£¬WTÊÇWRITE_THROUGH£¬NIOÊÇNULLIO£¬NVÊÇNV_CACHE

(3)ÒÔÉÏΪÁ½¸ö×îÖØÒªµÄÎļþ¼Ð£¬/proc/scsi_tgt/ÏÂÆäËûµÄÎļþÒ²¿ÉÒÔcat£¬±ÈÈçcat /proc/scsi_tgt/threadΪscstÔËÐеÄÏß³ÌÊý¡£cat /proc/scsi_tgt/session²é¿´µ±Ç°µÄÁ¬½ÓÐÅÏ¢£¬Ï൱ÓÚÃüÁîscstadmin ¨Csession¡£

scst target µÄiscsi²ÎÊýÉèÖÃ

/etc/iscsi-scstdÎļþÊÇÅäÖÃiscsiµÄÅäÖÃÎļþ£¬ÆäÖÐÿÐÐ#ºÅ¶¼ÊÇ×¢ÊÍ£¬¿ÉÒÔÈ¥µô#ºÅ£¬²¢ÇÒÐ޸IJÎÊýÀ´¶Ôiscsi targetµÄÊôÐÔ½øÐÐÐ޸ġ£ (1)Õ˺ŽӿÚ

È¥µôIncomingUserµÄ×¢ÊÍ·ûºÅ£¬¿ÉÔö¼Ó´ËÐеÄÓû§¡£(Ö§³Ö¶àÕ˺Å)ÏÂͼΪfrankºÍjoeÁ½¸öÕ˺Å

±È½ÏÖØÒªµÄÅäÖÃÈçÏÂ

°ÑÕâ¸öÕ˺ÅÃÜÂëÉèÖÃÒÔºó£¬ÔÚwindowsµÄMicrosoft iSCSI Initiator¿ÉÒÔʹÓÃÈçϹ¦ÄÜ£º

chapÈÏÖ¤£¬name ÊÇjoe ÃÜÂëÊÇsecretaaaaaaa¡£×¢Ò⣬ÃÜÂë±ØÐ벻СÓÚ12룬²»È»iscsi·þÎñÆô¶¯²»ÁË¡£

iscsi-conf»¹ÓÐÆäËû²ÎÊýÉèÖ㬰Ñ×¢ÊÍÈ¥µô£¬¾Í¿ÉÒÔÉèÖᣠ(2)CRCУÑé½Ó¿Ú