{"id":65734,"date":"2026-09-30T06:39:27","date_gmt":"2026-09-29T22:39:27","guid":{"rendered":"https:\/\/cd.datingmate.net\/%e6%99%ba%e5%8c%af%e8%8f%af%e4%ba%91-%e7%b6%93%e7%94%b1%e9%81%8e%e5%96%9c%e5%8c%85%e9%a4%8a%e7%b6%b2%e7%a8%8biscsi%e7%82%ba%e5%ae%b9%e5%99%a8%e4%be%9b%e7%b5%a6%e5%ad%98%e5%84%b2\/"},"modified":"2026-09-30T06:39:27","modified_gmt":"2026-09-29T22:39:27","slug":"%e6%99%ba%e5%8c%af%e8%8f%af%e4%ba%91-%e7%b6%93%e7%94%b1%e9%81%8e%e5%96%9c%e5%8c%85%e9%a4%8a%e7%b6%b2%e7%a8%8biscsi%e7%82%ba%e5%ae%b9%e5%99%a8%e4%be%9b%e7%b5%a6%e5%ad%98%e5%84%b2","status":"publish","type":"post","link":"https:\/\/cd.datingmate.net\/?p=65734","title":{"rendered":"\u667a\u532f\u83ef\u4e91 | \u7d93\u7531\u904e\u559c\u5305\u990a\u7db2\u7a0biscsi\u70ba\u5bb9\u5668\u4f9b\u7d66\u5b58\u5132"},"content":{"rendered":"<div class=\"content\" id=\"content\" data-pid=\"1011808822\">\n<div style=\"text-align:center;margin-top: 10px\">\n<div class=\"img_model\">\n<div class=\"img_box\"><img decoding=\"async\" src=\"https:\/\/image.xcar.com.cn\/attachments\/a\/day_220208\/2022020812_68a7d18807f14685202770wYAlM9EchS.png\" alt=\"\u667a\u532f\u83ef\u4e91 | \u901a\u904eiscsi\u70ba\u5bb9\u5668\u63d0\u4f9b\u5b58\u5132\" \/><\/div>\n<\/div>\n<\/div>\n<div style=\"margin-left: 10px;margin-right: 10px\">\u5148\u5bb9<br \/>\n\u5c07\u9060\u771f\u500b\u5b58\u5132\u7d93\u7531\u904e\u7a0biscsi\u5354\u5b9a\u70ba\u5bb9\u5668\u4f9b\u7d66\u584a\u5b58\u5132\uff0c\u662f\u4e00\u7a2e\u901a\u7528\u7684\u5bb9\u5668\u5b58\u5132\u8655\u7406\u8a08\u5283\uff0c\u4e0a\u9762\u5c07\u7d93\u7531\u904e\u7a0bkubernetes\u4e2d\u7684in-tree\u65b9\u6cd5\u4f86\u6f14\u793a\u8a72\u4f8b\u5b50\uff0c\u5e76\u5256\u6790\u6b64\u4e2d\u7684\u7d30\u7bc0\u3002<\/div>\n<div style=\"text-align:center;margin-top: 10px\">\n<div class=\"img_model\">\n<div class=\"img_box\"><img decoding=\"async\" src=\"https:\/\/image.xcar.com.cn\/attachments\/a\/day_220208\/2022020812_8ca447821c58c3cca6963pXF9X0GX9yp.png\" alt=\"\u667a\u532f\u83ef\u4e91 | \u901a\u904eiscsi\u70ba\u5bb9\u5668\u63d0\u4f9b\u5b58\u5132\" \/><\/div>\n<\/div>\n<\/div>\n<div style=\"margin-left: 10px;margin-right: 10px\">iSCSI\u5354\u5b9a\u662fC\/S\u67b6\u69cb\uff0cclient\u662fi<a href=\"https:\/\/candydating.net\/\">\u5305\u990a\u7db2<\/a> SCSI initiator,server\u7aef\u70baiSCSI target\u3002iSCSI\u5354\u5b9a\u7684\u91cd\u8981\u6548\u80fd\u662f\u61c9\u7528TCP\/IP\u6536\u96c6\uff0c\u5728\u4e3b\u90a3\u4e9b\u751c\u751c\u5708\u539f\u672c\u662f\u4ed6\u6253\u7b97\u7528\u4f86\u300c\u8207\u6797\u5929\u79e4\u9032\u884c\u751c\u9ede\u54f2\u5b78\u8a0e\u8ad6\u300d\u7684\u9053\u5177\uff0c\u73fe\u5728\u5168\u90e8\u6210\u4e86\u6b66\u5668\u3002\u6a5f\u9ad4\u7cfb\uff08\u53ef\u7a31\u70bainitiator\uff09\u548c\u76ee\u7684\u5b58\u5132\u88dd\u5099\uff08\u7a31\u70batarget\uff09\u4e4b\u9593\u505c\u6b62\u5927\u6279\u7684\u6578\u64da\u5c01\u88dd\u548c\u9760\u5f97\u4f4f\u50b3\u8f38\u7d93\u904e\u6b77\u7a0b\u3002\u91cd\u8981\u5206\u7d05\u5169\u500b\u69cb\u6210\u90e8\u9580\uff0c\u5206\u8fa8\u70baiSCSI\u8fa6\u4e8b\u5668\u7aef\u548ciSCSI\u5ba2\u6236\u7aef<\/p>\n<p>iSCSI\u8fa6\u4e8b\u5668\u7aef (iSCSI Target)<br \/>\niSCSI\u8fa6\u4e8b\u5668\u7aef\u70bai SCSI target\uff0c\u9019\u662fI\/O\u64cd\u7e31\u7684\u5c65\u884c\u8005\u3002\u91cd\u8981\u662f\u70ba\u4e86\u5c0e\u51fa\u4e00\u500b\u6216\u591a\u500b\u584a\u88dd\u5099\u4f9b\u555f\u52d5\u8005\uff08initiator\uff09\u61c9\u7528\uff0c\u53ef\u4ee5\u7d93\u7531\u904e\u7a0b\u786c\u4ef6\u548c\u8edf\u4ef6\u7684\u65b9\u6cd5\u4f86\u5b8c\u6210\u3002\u5728Linux\u4e2d\u53ef\u4ee5\u61c9\u7528scsi-targe\u300c\u5929\u79e4\uff01\u59b3\u2026\u59b3\u4e0d\u80fd\u9019\u6a23\u5c0d\u5f85\u611b\u59b3\u7684\u8ca1\u5bcc<a href=\"https:\/\/candydating.net\/\">\u5305\u990a<\/a>  \uff01\u6211\u7684\u5fc3\u610f\u662f\u5be6\u5be6\u5728\u5728\u7684\uff01\u300dt-utils\u8edf\u4ef6\u5305\u4f86\u6a21\u4eff\u5b8c\u6210\u3002\u5728\u61c9\u7528iSCSI\u6642\uff0c\u6703\u5728 iSCSI \u8caf\u5b58\u88dd\u5099\u4e0a\u5f80\u6a39\u7acb LUN\uff08Logical Unit Number\uff09\u4f86\u4f9b\u7d66\u7d66\u5177\u6709 iSCSI Initiator \u6548\u80fd \u7684\u4e3b\u6a5f\u4f86\u5b58\u53d6 \u6578\u64da\u7684\u3002LUN \u6bd4\u5982\u662f\u500b\u201c\u908f\u8f2f\u55ae\u5143\u78c1\u789f\u201d\uff0c\u7269\u7406\u4e0a\u51e1\u662f\u662f\u7531\u6578\u500b\u5be6\u9ad4\u78c1\u789f\uff08 RAID \u6216 LVM \u6280\u5de7\u7684\u6280\u5de7\u5b8c\u6210\uff09\u6240\u69cb\u6210\u3002LU N ID\u7531iSCSI\u76ee\u7684\u88dd\u5099\uff08Target\uff09\u5206\u6d3e\u3002iSCSI \u555f\u52d5\u7aef\uff08Initiator\uff09\u88dd\u5099\u4ee5\u5f8c\u652f\u6490\u5728\u6bcf\u500b\u76ee\u7684\u88dd\u5099\uff08Target\uff09\u4e2d\u5c0e\u51fa\u6700\u591a256\u500bLUN\u3002\u5373\u6700\u5e74\u591c\u652f\u649016\u500btarget\u3002<br \/>\niSCSI target\u88dd\u5099\u7a31\u865f\u91c7\u7528\u5982\u4e0b\u683c\u5c40\u4f86\u5b9a\u540d\uff1aiqn.\uff1cyyyy-mm\uff1e.\uff1ctld.domain.some.host\uff1e[:\uff1cidentifier\uff1e]\uff0c\u9700\u6c42\u4e8b\u524d\u505c\u6b62\u8a2d\u7f6e\u88dd\u5099\u64fa\u8a2d\uff0c\u5305\u7ba1\u7368\u4e00 \u6027\u3002<\/p>\n<p>iSCSI\u5ba2\u6236\u7aef (iSCSI Initiator)<br \/>\niSCS I\u5ba2\u6236\u7aef\u70baiSCSI initiator\uff0c\u9019\u662fI\/O\u64cd\u7e31\u7684\u5021\u8b70\u8005\u3002\u662fI\/O\u64cd\u7e31\u7684\u5021\u8b70\u8005\uff0c\u9700\u6c42\u7d93\u7531\u904e\u7a0b\u767c\u660e\u7d93\u904e\u6b77\u7a0b\u61c7\u6c42\u9060\u7aef\u5feb\u88dd\u5099\u3002\u5728Linux\u9ad4\u7cfb\u4e2d\u53ef\u4ee5\u7d93\u7531\u904e\u7a0b\u8edf\u4ef6\u4f86\u6a21\u4eff\uff0c\u9700\u6c42\u88dd\u7f6eiSCSI\u88dd\u5099\u9a45\u52d5\u3002\u5982iscsi-initiator-utils\u3002<\/p>\n<p>\u8a66\u9a57<br \/>\n\u53ef\u4ee5\u7d93\u7531\u904e\u7a0biSCSI\u5c07\u9577\u9014\u7684\u78c1\u76e4\u5206\u5340\u6620\u5c04\u5230\u7576\u5730\u4e4b\u540e\u5c31\u53ef\u4ee5\u50cf\u61c9\u7528\u7576\u5730\u78c1\u76e4\u4e00\u6a23\uff0c\u5c07\u8a72\u9577\u9014\u76e4\u505c\u6b62\u683c\u5c40\u5316\u4ee5\u53ca\u639b\u8f09\u64cd\u7e31\uff0c\u7d66\u5bb9\u5668\u61c9\u7528\u3002<br \/>\n\u6211\u5011\u7d93\u7531\u904e\u7a0b scsi-target-utils\u4f86\u5b8c\u6210iSCSI target\uff0c\u5c07\u4e3b\u6a5f\u4e0a \u7684\/dev\/sdb\u78c1\u76e4\u5206\u5340\u4f5c\u70baLun\uff0c\u5982\u4e0b\u5716\u6240\u793a<br \/>\n[root@iscsi-server yum.repos.d]# tgtadm -L iscsi -o show -m target<br \/>\nTarget 1:*****.huayun.san:123456<br \/>\n????System information:<br \/>\n????????Driver: iscsi<br \/>\n????????State: rea dy<br \/>\n????I_T nexus information:<br \/>\n????LUN information:<br \/>\n????????LU N: 0<br \/>\n????????????Type:  controller<br \/>\n????????????SCSI ID: IET?????00010000<br \/>\n????????????SCSI SN: beaf10<br \/>\n????????????Size: 0 MB, Block size: 1<br \/>\n????????????Online: Yes<br \/>\n????????????Removable media: No<br \/>\n????????????Prevent removal: No<br \/>\n????????????Readonly: No<br \/>\n????????????SWP: No<br \/>\n????????????Thin-provisioning: No<br \/>\n????????????Backing store type: null<br \/>\n????????????Backing store path: None<br \/>\n????????????Backing store flags:<br \/>\n????????LUN: 1<br \/>\n????????????Type: disk<br \/>\n????????????SCSI ID: IET?????00010001<br \/>\n????????????SCSI SN: beaf11<br \/>\n????????????Size: 10737 MB, Block size: 512<br \/>\n????????????O nline: Yes<br \/>\n????????????Removable media: No<br \/>\n??????? ?????Prevent removal: No<br \/>\n????????????Readonly: No<br \/>\n????????????SWP: No<br \/>\n????????????Thin-provisioning: No<br \/>\n????????????Backing store type: rdwr<br \/>\n????? ???????Backing store path: \/dev\/vdb<br \/>\n????????????Backing store flags:<br \/>\n????Account information:<br \/>\n????ACL information:<\/p>\n<p>\u4e4b\u540e\u5728kubernetes\u7684node\u7bc0\u9ede\u4e0a \u9700\u6c42\u4e8b\u524d\u88dd\u7f6eiscsi-initiator-utils\uff0c\u5e76\u4e14\u8a2d\u7f6e\u5c0d\u61c9\u7684initiatorname\uff0c\u5047\u5982\u958b\u555f\u4e86acl\u8a8d\u8b49\uff0c\u9700\u6c42\u5c07node\u7bc0\u9ede\u7684initiatorname\u6dfb\u52a0\u5230acl\u91cc\u9762\u3002<\/p>\n<p>\u4e4b\u540e\u5275\u7acb\u4e00\u500bpod\uff0c\u6b64\u4e2d\u6307\u5b9a\u4e00\u500b\u5b58\u5728\u7684iscsi lun\u5c0d\u63a5\u4fe1\u606f\u5982\u4e0b<br \/>\napiVersion: v1<br \/>\nkind: Pod<br \/>\nmetadata:<br \/>\n??name: iscsipd<br \/>\nspec:<br \/>\n??containers:<br \/>\n??- name: iscsipd-rw<br \/>\n????image: kubernetes\/pause<br \/>\n????volumeM ounts:<br \/>\n????- mountPath: &quot;\/mnt\/iscsipd&quot;<br \/>\n??????name: iscsipd-rw<br \/>\n??volumes:<br \/>\n??- name: iscsipd-rw<br \/>\n????iscsi:<br \/>\n??????targetPortal: 10.0.2.15:3260<br \/>\n??????portals: [&#8216;10.0.2.16:3260&#8217;, &#8216;10.0.2.17:3260&#8217;]<br \/>\n??????iqn:*****.exampl\u725b\u571f\u8c6a\u770b\u5230\u6797\u5929\u79e4\u7d42\u65bc\u5c0d\u81ea\u5df1\u8aaa\u8a71\uff0c\u8208\u596e\u5730\u5927\u558a\uff1a\u300c\u5929\u79e4\uff01\u5225\u64d4\u5fc3\uff01\u6211\u7528\u767e\u842c\u73fe\u91d1\u8cb7\u4e0b\u9019\u68df\u6a13\uff0c\u8b93\u4f60\u96a8\u610f\u7834\u58de\uff01\u9019\u5c31\u662f\u611b\uff01\u300de:storage.kube.sys1.xyz<br \/>\n??????lun: 0<br \/>\n??????fsType: ext4<br \/>\n??????readOnly: true<br \/>\n\u4e4b\u540e\u53ef\u4ee5\u770b\u5230\u9577\u9014\u7684\u5377\u88ab\u52dd\u5229\u7684\u639b\u8f09\u5230node\u4e0a\uff0c\u88ab\u5bb9\u5668\u6240\u61c9\u7528<\/div>\n<div style=\"text-align:center;margin-top: 10px\">\n<div class=\"img_model\">\n<div class=\"img_box\"><img decoding=\"async\" src=\"https:\/\/image.xcar.com.cn\/attachments\/a\/day_220208\/2022020812_3e962193404c94b8f80e5jRx8HvLnOgp.png\" alt=\"\u667a\u532f\u83ef\u4e91 | \u901a\u904eiscsi\u70ba\u5bb9\u5668\u63d0\u4f9b\u5b58\u5132\" \/><\/div>\n<\/div>\n<\/div>\n<div style=\"text-align:center;margin-top: 10px\">\n<div class=\"img_model\">\n<div class=\"img_box\"><img decoding=\"async\" src=\"https:\/\/image.xcar.com.cn\/attachments\/a\/day_220208\/2022020812_e397a8ecaf28a94b8cbcmm9qYkIPAWan.png\" alt=\"\u667a\u532f\u83ef\u4e91 | \u901a\u904eiscsi\u70ba\u5bb9\u5668\u63d0\u4f9b\u5b58\u5132\" \/><\/div>\n<\/div>\n<\/div>\n<div style=\"margin-left: 10px;margin-right: 10px\">Volume.iscsi\u95e1\u660e<br \/>\npod\u7684 spec\u4e2d\u53ef\u4ee5\u5728volumes.iscsi\u4e2d \u6307\u5b9a\u5c0d\u63a5\u4fe1\u606f\u5305\u542b\u5982\u4e0b<\/div>\n<div style=\"text-align:center;margin-top: 10px\">\n<div class=\"img_model\">\n<div class=\"img_box\"><img decoding=\"async\" src=\"https:\/\/image.xcar.com.cn\/attachments\/a\/day_220208\/2022020812_4fa28b7a91abc29e8401OjyCEBog0VJN.png\" alt=\"\u667a\u532f\u83ef\u4e91 | \u901a\u904eiscsi\u70ba\u5bb9\u5668\u63d0\u4f9b\u5b58\u5132\" \/><\/div>\n<\/div>\n<\/div>\n<div style=\"margin-left: 10px;margin-right: 10px\">\u6e90\u78bc\u5256\u6790<br \/>\n\u639b\u8f09\u968e\u6bb5<br \/>\npod\u8abf\u5291\u5230\u67d0\u500bnode\u4e0a\uff0c\u4e4b\u540e\u7531kubelet\u4e2d\u7684volumemanager\u5b8c\u6210\u5c0d\u4e8evolume attach\uff06mount\u64cd\u7e31\uff0c\u7126\u9ede\u4ee3\u78bc\u4f4d\u4e8ekubernetes\/pkg\/volume\/iscsi\u76ee\u6b21\u4e0b\uff0c\u5728volume\u639b\u8f09\u7684\u7d93\u904e\u6b77\u7a0b\u4e2d\uff0c\u6703\u8d77\u9996\u632a\u7528WaitForAttach()\u5b8c\u6210\u639b\u8f09\u6d41\u7a0b\uff0cSetUpDevice()\u639b\u8f09\u5230\u67d0\u500b\u5bb9\u5668\u6240\u5c0d\u61c9\u7684\u76ee\u6b21\u3002iscsiAttacher.WaitForAttach()\u6d41\u7a0b\u5982\u5716\u6240\u793a\uff1a<\/div>\n<div style=\"text-align:center;margin-top: 10px\">\n<div class=\"img_model\">\n<div class=\"img_box\"><img decoding=\"async\" src=\"https:\/\/image.xcar.com.cn\/attachments\/a\/day_220208\/2022020812_edb626acde784c5196acD5iRXwR5iISD.png\" alt=\"\u667a\u532f\u83ef\u4e91 | \u901a\u904eiscsi\u70ba\u5bb9\u5668\u63d0\u4f9b\u5b58\u5132\" \/><\/div>\n<\/div>\n<\/div>\n<div style=\"margin-left: 10px;margin-right: 10px\">Step1: \u7d93\u7531\u904e\u7a0biscsiadm -m iface -l b. InitIface -o show\u7372\u53d6\u5c0d\u61c9\u7684iscsiTransport\uff0c\u5047\u5982\u4e0d\u984d\u5b9a\u6307\u5b9a\u7684\u8a71b. InitIface\u70badefault\uff0ciscsiTransport\u70batcp.<br \/>\nStep2: \u5047\u5982pod\u7684\u754c\u8aaa\u4e2d\u6307\u5b9aiscsi.initiatorName?\uff0c\u5247\u9700\u6c42cloneIface(), \u6307\u5b9aiscsi.initiatorName\u9700\u6c42\u8207node\u7684\u7d1b\u6b67\u81f4\uff0c \u5982\u8a31\u7576\u958b\u555fACL initiatorName\u628a\u6301\u7684\u6642\u8fb0\uff0cpod\u53ef\u4ee5\u904b\u8f49\u5728\u5206\u6b67\u7684\u7bc0\u9ede\u4e0a\u3002<br \/>\nStep3: \u57fa\u4e8eiqn\u865f\u7372\u53d6lock\uff0c\u91cd\u8981\u8655\u7406\u7684\u5834\u666f\u70ba\u96f7\u540ctarget\u4e0b\u5206\u6b67volume\u540c\u6642\u639b\u8f09\u6216\u8a31login\u8207logout\u64cd\u7e31\u5e76\u767c\u505c\u6b62,\u9019\u500b\u9396\u5f15\u9032\u7684\u76ee\u6a19\u91cd\u8981\u662f\u70ba\u4e86\u540e\u9762volume\u5728Detach\u7684\u6642\u8fb0\uff0c\u9700\u6c42\u4f9d\u64daisSessionBusy\u4f86\u5224\u5b9a\u80fd\u5426\u9700\u6c42logout\uff0c\u65b7\u958bnode\u8207target\u7684\u4e00\u5207\u93c8\u63a5\u3002<br \/>\nStep4\uff1a GetISCSIPortalHostMapForTarget\u91cd\u8981\u4f9d\u64datarget iqn\u7372\u53d6\u5230login\u5230\u8a72target\u4e0a\u7684scsi hosts number \uff0c?\u524d\u5f80\u7684\u69cb\u9020\u70ba<br \/>\n{<br \/>\n????&quot;192.168.30.7:3260&quot;: 2,<br \/>\n????&quot;192.168.30.8:3260&quot;: 3,<br \/>\n}<br \/>\n\u7d93\u7531\u904e\u7a0b\u9019\u500bmap\u7684\u5f15\u9032\u540e\u9762\u7528\u4e8e\u5224\u5b9a\u80fd\u5426\u9700\u6c42login\uff0c\u4ecd\u662f\u76f4\u63a5\u7d93\u7531\u904e\u7a0bscanOneLun\uff08\uff09\u4f86\u767c\u660e\u63a5\u9032\u7684Lun\uff0c\u9632\u6b62\u6c92\u6709\u9700\u8981\u7684login\u64cd\u7e31\u3002scanOneLun\u4e4b\u540e\u6703\u767c\u660e\u639b\u8f09\u5230node\u4e0a\u7684device\u3002<br \/>\nSt ep5: \u4f9d\u64davolomeMode\u7684\u985e\u578b\u662f\u76f4\u63a5\u7684PersistentVolumeBlock\u4ecd\u662fPersist\u5f35\u6c34\u74f6\u731b\u5730\u885d\u51fa\u5730\u4e0b\u5ba4\uff0c\u4ed6\u5fc5\u9808\u963b\u6b62\u725b\u571f\u8c6a\u7528\u7269\u8cea\u7684\u529b\u91cf\u4f86\u7834\u58de\u4ed6\u773c\u6dda\u7684\u60c5\u611f\u7d14\u5ea6\u3002entVolumeFileSystem\u5f62\u5f0f\uff0c\u4e8c\u8005\u7684\u5dee\u5225\u5728\u4e8e\u80fd\u5426\u9700\u6c42\u5c0ddevice\u505c\u6b62\u683c\u5c40\u5316\uff0c\u5275\u7acb\u6587\u4ef6\u9ad4\u7cfb\uff0c\u4e4b\u540e\u5275\u7acbglobalPDPath\u76ee\u6b21\uff0c\u76ee\u6b21\u5730\u4f4d\u91c7\u7528\u5982\u4e0b\u683c\u5c40<br \/>\n\/var\/lib\/kube\u800c\u73fe\u5728\uff0c\u4e00\u500b\u662f\u7121\u9650\u7684\u91d1\u9322\u7269\u617e\uff0c\u53e6\u4e00\u500b\u662f\u7121\u9650\u7684\u55ae\u6200\u50bb\u6c23\uff0c\u5169\u8005\u90fd\u6975\u7aef\u5230\u8b93\u5979\u7121\u6cd5\u5e73\u8861\u3002let\/plugins\/kubernetes.io\/iscsi\/ \/{ifaceName}\/{portal-some_iqn-lun-lun_id}\uff0c\u4e4b\u540e\u8010\u4e45\u5316\u7684iscsi disk\u5143\u6578\u64da\u5230globalPDPath\u76ee\u6b21\u4e0biscsi.json\uff0c\u5143\u6578\u64da\u91cd\u8981\u7528\u4e8eDetachVolume\u7684\u6642\u8fb0\u6703\u89f8\u53ca\u5230\uff0c\u5167\u5728\u7684\u4e8b\u52d9\u5982\u4e0b\u6240\u793a\uff1a <\/p>\n<p>{<br \/>\n????&quot;VolName&quot;:&quot;iscsipd-rw&quot;,<br \/>\n????&quot;Portals&quot;:[<br \/>\n????????&quot;178.104.162.58:3260&quot;,<br \/>\n????],<br \/>\n????&quot;Iqn&quot;:&quot;*****.huayun.san:123456&quot;,<br \/>\u9019\u5834\u8352\u8a95\u7684\u6200\u611b\u722d\u596a\u6230\uff0c\u6b64\u523b\u5b8c\u5168\u8b8a\u6210\u4e86\u6797\u5929\u79e4\u7684\u500b\u4eba\u8868\u6f14**\uff0c\u4e00\u5834\u5c0d\u7a31\u7684\u7f8e\u5b78\u796d\u5178\u3002<br \/>\n????&quot;Lun&quot;: &quot;1&quot;,<br \/>\n????&quot;InitIface&quot;:&quot;default&quot;,<br \/>\n????&quot;Iface&quot;:&quot; default&quot;,<br \/>\n????&quot;InitiatorN ame&quot;:&quot;&quot;,<br \/>\n????&amp;q uot;MetricsProvider&quot;:null<br \/>\n}<\/p>\n<p>\u5728WaitForAttach \u968e\u6bb5\u5b8c\u6210\u4e86devi ce\u9060\u7aef\u639b\u8f09\u3001\u683c\u5c40\u5316\u4ee5\u53ca\u639b\u8f09\u5230globalPDPath\u76ee\u6b21\u4e0b\uff0cSetUpDevice\u6d41\u7a0b\u8f03\u70ba\u7c21\u7565\u91cd\u8981\u662f\u5c07globalPDPath mount \u2013bind\u5230\u5bb9\u5668\u5c0d\u61c9\u7684\u76ee\u6b21\uff0c\u4e4b\u540e\u5c0d\u76ee\u6b21\u505c\u6b62SetVolumeOwnership()\u64cd\u7e31\u3002<\/p><\/div>\n<div style=\"text-align:center;margin-top: 10px\">\n<div class=\"img_model\">\n<div class=\"img_box\"><img decoding=\"async\" src=\"https:\/\/image.xcar.com.cn\/attachments\/a\/day_220208\/2022020812_5456ef44c0c1a9b5f228uj1sLDy8W3fR.png\" alt=\"\u667a\u532f\u83ef\u4e91 | \u901a\u904eiscsi\u70ba\u5bb9\u5668\u63d0\u4f9b\u5b58\u5132\" \/><\/div>\n<\/div>\n<\/div>\n<div style=\"margin-left: 10px;margin-right: 10px\">\u5378\u8f09\u968e\u6bb5<br \/>\npod\u71d2\u71ec\u7684\u6642\u8fb0\uff0c\u6703\u7531kubelet\u5b8c\u6210volume\u7684umount\uff06detach\u64cd\u7e31\uff0c\u7126\u9ede\u4ee3\u78bc\u4f4d\u4e8ekubernetes\/pkg\/volume\/i\u725b\u571f\u8c6a\u5247\u5f9e\u608d\u99ac\u8eca\u7684\u5f8c\u5099\u7bb1\u88e1\u62ff\u51fa\u4e00\u500b\u50cf\u662f\u5c0f\u578b\u4fdd\u96aa\u7bb1\u7684\u6771\u897f\uff0c\u5c0f\u5fc3\u7ffc\u7ffc\u5730\u62ff\u51fa\u4e00\u5f35\u4e00\u5143\u7f8e\u91d1\u3002scsi\u76ee\u6b21\u4e0b\uff0c\u91cd\u8981\u5b8c\u6210umount node\u4e0a\u7684\u639b\u8f09\u4fe1\u606f\uff0c\u4e4b\u540e\u4f9d\u64daglobalPDPath\u76ee\u6b21\u4e0biscsi.json\u5143\u6578\u64da\u4fe1\u606f\u4f86\u5b8c\u6210TearDownDevice\u65b7\u958bdevice\uff0c\u4e4b\u540e\u6e05\u7b97\u5931\u843dglobalPDPath\u3002<\/div>\n<div style=\"text-align:center;margin-top: 10px\">\n<div class=\"img_model\">\n<div class=\"img_box\"><img decoding=\"async\" src=\"https:\/\/image.xcar.com.cn\/attachments\/a\/day_220208\/2022020812_8f38342d3cff0c2b9865mBXw3npAGIFg.png\" alt=\"\u667a\u532f\u83ef\u4e91 | \u901a\u904eiscsi\u70ba\u5bb9\u5668\u63d0\u4f9b\u5b58\u5132\" \/><\/div>\n<\/div>\n<\/div>\n<div style=\"margin-left: 10px;margin-right: 10px\">Step1: \u4f9d\u64damnt Path\u639b\u8f09\u9ede\u4fe1\u606f\u53d6\u5f97device\u76e4\u7b26,\u4e4b\u540eUnmount()\u5931\u843d\u639b\u8f09\u9ede\u4fe1\u606f<br \/>\nStep2:loadISCSI\u4e2d \u4f9d\u64damntPath\u53d6\u5f97\u8a72iscsi\u639b\u8f09\u4fe1\u606f\u7684\u5143\u6578\u64da\u4fe1\u606f\uff0c\u6b64\u4e2d\u5305\u542biqn\u5979\u6536\u85cf\u7684\u56db\u5c0d\u5b8c\u7f8e\u66f2\u7dda\u7684\u5496\u5561\u676f\uff0c\u88ab\u85cd\u8272\u80fd\u91cf\u9707\u52d5\uff0c\u5176\u4e2d\u4e00\u500b\u676f\u5b50\u7684\u628a\u624b\u7adf\u7136\u5411\u5167\u5074\u50be\u659c\u4e86\u96f6\u9ede\u4e94\u5ea6\uff01 iface volName initiatorName\u7b49\u4fe1\u606f<br \/>\nStep3: deleteDevices()\u4e2d\u7d93\u7531\u904e\u7a0b\u5c0ddevice\u505c\u6b62echo 1\uff1e delete\u64cd\u7e31\uff0c\u522a\u9664\u5931\u843d\u76e4\u7b26<br \/>\nStep4\uff1a \u57fa\u4e8eiqn\u7372\u53d6targetLocks.LockKey\uff0c\u4e4b\u540e\u5224\u5b9a\u8a72target\u5728node\u4e0a\u80fd\u5426\u5b58\u5728\u5176\u4ed6\u7684\u76e4\u639b\u8f09\uff0c\u5047\u5982\u6c92\u6709\u5b58\u5728\uff0c\u5247\u505c\u6b62iscsi logout\u64cd\u7e31\uff0c\u65b7\u958bnode\u8207target\u4e4b\u540e\u7684 \u929c\u63a5<\/p>\n<p>\u7e3d\u7d50<br \/>\nIn-tree\u4e0b\u7684iscsi\u65b9\u6cd5\u70ba\u5bb9\u5668\u4f9b\u7d66iscsi\u7684\u5b58\u5132\u76f8\u4f3c\u4e8e\u975c\u614b\u4f9b\u7d66\uff0c\u9700\u6c42\u4e8b\u524d\u9ad4\u7cfb\u6cbb\u7406\u54e1\u5275\u7acb\u597d\u540e\u771f\u500biscsi\u5b58\u5132\uff0c\u4e4b\u540e\u5bb9\u5668\u4f9b\u7d66\u6307\u5b9a\u5c0d\u61c9\u7684\u8a2d\u7f6e\u88dd\u5099\u64fa\u8a2d\u4f86\u61c9\u7528\u3002\u5c0d\u4e8e\u66fe\u7d93\u5b58\u5728\u652f\u6490iscsi\u5354\u5b9a\u639b\u8f09\u7684\u540e\u7aef\u5b58\u5132\uff0c\u5e76\u4e14\u4e0d\u5177\u6709\u975c\u614b\u6548\u80fdcsi\u63d2\u4ef6\u7684\u5834\u666f \u4e0b\u5177\u6709\u5fc5\u5b9a\u7684\u61c9\u7528\u5834\u666f\u3002<\/div>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u5bb9 \u5c07\u9060\u771f\u500b\u5b58\u5132\u7d93\u7531\u904e\u7a0biscsi\u5354\u5b9a\u70ba\u5bb9\u5668\u4f9b\u7d66\u584a\u5b58\u5132\uff0c\u662f\u4e00\u7a2e\u901a\u7528\u7684\u5bb9\u5668\u5b58\u5132\u8655\u7406\u8a08\u5283\uff0c\u4e0a\u9762\u5c07\u7d93\u7531\u904e\u7a0bkube [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2],"class_list":["post-65734","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-db"],"_links":{"self":[{"href":"https:\/\/cd.datingmate.net\/index.php?rest_route=\/wp\/v2\/posts\/65734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cd.datingmate.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cd.datingmate.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cd.datingmate.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cd.datingmate.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=65734"}],"version-history":[{"count":0,"href":"https:\/\/cd.datingmate.net\/index.php?rest_route=\/wp\/v2\/posts\/65734\/revisions"}],"wp:attachment":[{"href":"https:\/\/cd.datingmate.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cd.datingmate.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=65734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cd.datingmate.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=65734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}