差異處
這裏顯示兩個版本的差異處。
下次修改 | 前次修改 | ||
tech:centos_iscsi [2009/03/19 06:22] – 建立 jonathan | tech:centos_iscsi [2022/06/10 09:07] (目前版本) – [參考網址] jonathan | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== Centos 5 上配置 iSCSI 設定 ====== | ||
+ | ===== iSCSI 主機端 ===== | ||
+ | * 安裝 iscsitarget <code sh> | ||
+ | yum install kernel-devel openssl-devel gcc rpm-build | ||
+ | rpm -q kernel-devel openssl-devel gcc rpm-build | ||
+ | wget http:// | ||
+ | tar -xvf iscsitarget-1.4.18.tar.gz | ||
+ | cd iscsitarget-1.4.18 | ||
+ | make | ||
+ | make install | ||
+ | </ | ||
+ | ++++ 看執行過程|< | ||
+ | [root@pd920 ~]# rpm -q kernel-devel openssl-devel gcc rpm-build | ||
+ | kernel-devel-2.6.18-128.7.1.el5 | ||
+ | kernel-devel-2.6.18-164.el5 | ||
+ | openssl-devel-0.9.8e-12.el5 | ||
+ | openssl-devel-0.9.8e-12.el5 | ||
+ | gcc-4.1.2-44.el5 | ||
+ | rpm-build-4.4.2.3-9.el5 | ||
+ | [root@pd920 ~]# cd source/ | ||
+ | [root@pd920 source]# wget http:// | ||
+ | --06: | ||
+ | 正在查找主機 nchc.dl.sourceforge.net... 211.79.60.17, | ||
+ | 正在連接 nchc.dl.sourceforge.net|211.79.60.17|: | ||
+ | 已送出 HTTP 要求,正在等候回應... 200 OK | ||
+ | 長度: 121290 (118K) [application/ | ||
+ | Saving to: `iscsitarget-1.4.18.tar.gz' | ||
+ | |||
+ | 100%[=================================================================================================================================> | ||
+ | |||
+ | 07:04:28 (85.5 KB/s) -- 已儲存 ‘iscsitarget-1.4.18.tar.gz’ [121290/ | ||
+ | |||
+ | FINISHED --07: | ||
+ | Downloaded: 1 files, 118K in 1.4s (85.5 KB/s) | ||
+ | [root@pd920 source]# tar -xvf iscsitarget-0.4.18.tar.gz | ||
+ | iscsitarget-1.4.18/ | ||
+ | iscsitarget-1.4.18/ | ||
+ | iscsitarget-1.4.18/ | ||
+ | iscsitarget-1.4.18/ | ||
+ | iscsitarget-1.4.18/ | ||
+ | : | ||
+ | : | ||
+ | iscsitarget-1.4.18/ | ||
+ | iscsitarget-1.4.18/ | ||
+ | iscsitarget-1.4.18/ | ||
+ | iscsitarget-1.4.18/ | ||
+ | iscsitarget-1.4.18/ | ||
+ | [root@c2q-q9400 source]# cd iscsitarget-1.4.18 | ||
+ | [root@c2q-q9400 iscsitarget-1.4.18]# | ||
+ | Applying Patch compat-2.6.29.patch | ||
+ | patching file kernel/ | ||
+ | Applying Patch compat-2.6.28.patch | ||
+ | patching file kernel/ | ||
+ | Applying Patch compat-2.6.25-2.6.27.patch | ||
+ | patching file kernel/ | ||
+ | : | ||
+ | CC [M] / | ||
+ | CC [M] / | ||
+ | LD [M] / | ||
+ | Building modules, stage 2. | ||
+ | MODPOST | ||
+ | CC / | ||
+ | LD [M] / | ||
+ | make[1]: Leaving directory `/ | ||
+ | </ | ||
+ | |||
+ | * 建立 iSCSI 使用硬碟空間區塊< | ||
+ | make / | ||
+ | dd if=/ | ||
+ | dd if=/ | ||
+ | </ | ||
+ | |||
+ | * 設定 IET daemon <code sh> | ||
+ | vi / | ||
+ | </ | ||
+ | # | ||
+ | # | ||
+ | ALL 192.168.11.236 | ||
+ | </ | ||
+ | vi / | ||
+ | </ | ||
+ | #ALL:ALL | ||
+ | </ | ||
+ | vi / | ||
+ | </ | ||
+ | Target iqn.2009-10.com.ichiayi: | ||
+ | # | ||
+ | # | ||
+ | Lun 0 Path=/ | ||
+ | Lun 1 Path=/ | ||
+ | Lun 2 Path=/ | ||
+ | Alias iSCSI for ichiayi | ||
+ | MaxConnections | ||
+ | InitialR2T | ||
+ | ImmediateData | ||
+ | </ | ||
+ | |||
+ | * 設定與啟動 iSCSI-Target 服務 <code sh> | ||
+ | chkconfig iscsi-target on | ||
+ | service iscsi-target start | ||
+ | </ | ||
+ | |||
+ | ===== iSCSI 使用端 ===== | ||
+ | * 安裝 iscsi-initiator-utils <code sh> | ||
+ | yum install iscsi-initiator-utils | ||
+ | </ | ||
+ | |||
+ | * 設定與啟動 iSCSI-initiator <code sh> | ||
+ | vi / | ||
+ | </ | ||
+ | node.startup = automatic | ||
+ | node.session.timeo.replacement_timeout = 120 | ||
+ | node.conn[0].timeo.login_timeout = 15 | ||
+ | node.conn[0].timeo.logout_timeout = 15 | ||
+ | node.conn[0].timeo.noop_out_interval = 15 | ||
+ | node.conn[0].timeo.noop_out_timeout = 15 | ||
+ | node.session.initial_login_retry_max = 10 | ||
+ | node.session.cmds_max = 128 | ||
+ | node.session.queue_depth = 32 | ||
+ | node.session.iscsi.InitialR2T = No | ||
+ | node.session.iscsi.ImmediateData = Yes | ||
+ | node.session.iscsi.FirstBurstLength = 262144 | ||
+ | node.session.iscsi.MaxBurstLength = 16776192 | ||
+ | node.conn[0].iscsi.MaxRecvDataSegmentLength = 131072 | ||
+ | discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768 | ||
+ | node.session.iscsi.FastAbort = No | ||
+ | </ | ||
+ | vi / | ||
+ | </ | ||
+ | InitiatorName=iqn.2009-10.com.ichiayi: | ||
+ | </ | ||
+ | chkconfig --list | grep iscsi | ||
+ | </ | ||
+ | ++++ 看執行過程|< | ||
+ | [root@vm-mail ~]# chkconfig --list | grep iscsi | ||
+ | iscsi | ||
+ | iscsid | ||
+ | </ | ||
+ | |||
+ | * 找尋 iSCSI-target 與重起 iSCSI-initiator< | ||
+ | iscsiadm -m discovery -t sendtargets -p 192.168.11.250 | ||
+ | service iscsi restart | ||
+ | </ | ||
+ | ++++ 看執行過程|< | ||
+ | [root@pdc-e2160 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.11.250 | ||
+ | 192.168.11.250: | ||
+ | [root@vm-mail ~]# service iscsi start | ||
+ | iscsid 已停止執行但 pid 檔案仍在 | ||
+ | Turning off network shutdown. Starting iSCSI daemon: | ||
+ | | ||
+ | 正在設置 iSCSI 目標(targets): | ||
+ | Login to [iface: default, target: iqn.2009-10.com.ichiayi: | ||
+ | | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | * 如果出現無法登入的狀況,可能要調整權限設定的部份 | ||
+ | * 可以透過 iscsiadm 工具執行檢視問題點 Exp. <code sh> | ||
+ | iscsiadm -m node -p 192.168.11.250 -T iqn.2009-10.com.ichiayi: | ||
+ | * 如果有正常連上就會有以上的訊息 login to [xxx] : successful | ||
+ | </ | ||
+ | |||
+ | * 使用 iSCSI 磁碟< | ||
+ | fdisk -l | ||
+ | </ | ||
+ | </ | ||
+ | ===== 參考網址 ===== | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * https:// | ||
+ | |||
+ | {{tag> | ||