1. 程式人生 > >iscsi磁碟共享擴充套件

iscsi磁碟共享擴充套件

在服務端作如下步驟
服務端先用fdisk /dev/vdb分一塊磁碟區域出來為/dev/vdb1

[root@server ~]# yum install targetcli  -y
[root@server ~]# systemctl start target
[root@server ~]# systemctl enable target

3.一般的磁碟共享
這裡寫圖片描述
這裡寫圖片描述
這裡寫圖片描述

[[email protected] ~]# targetcli
/> /backstores/block create  westos:storage1 /dev/vdb1
Created block storage object westos:storage1 using /dev/vdb1.
/> /iscsi  create  iqn.2017
-08.com.example:stroage1 Created target iqn.2017-08.com.example:stroage1. Created TPG 1. />/iscsi/iqn.2017-08.com.example:stroage1/tpg1/luns create /backstores/block/feitian1:storage1 Created LUN 0. /> /iscsi/iqn.2017-08.com.example:stroage1/tpg1/acls create iqn.2017-08.com.example:stroage1key Created Node ACL for iqn.2017
-08.com.example:stroage1 Created mapped LUN 0. /> /iscsi/iqn.2017-08.com.example:stroage1/tpg1/portals create 172.25.254.119 Using default IP port 3260 Created network portal 172.25.254.119:3260.

在客戶端作如下步驟

[root@client ~]# yum install iscsi-initiator-utils.x86_64
[root@client ~]# iscsiadm  -m discovery -t st -p 172.25.254.119
172.25.254.119:3260,1 iqn.2017-08.com.example:stroage1 [root@client ~]# vim /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.2017-08.com.example:stroage1 [root@client ~]# iscsiadm -m node -T iqn.2017-08.com.example:stroage1 -P 172.25.254.119 -l

Fdisk -l 就會發現你多了一塊磁碟/dev/sda3,格式化掛載就可以使用
注意:在直接重啟iscsi這個服務時,他會報錯,這時你需要先重新啟動iscsid在重起你的iscsi服務
這裡寫圖片描述

 當systemctl restart iscsi重起不了時執行
  systemctl restart iscsid.service在重新啟動iscsi

清除磁碟共享

Server端
這裡寫圖片描述
當執行命令clearconfig confirm=True時刪除所有建立的共享組
Client端
安裝tree.x86_64管理軟體

[root@client iscsi]# systemctl stop iscsi
[root@client iscsi]# iscsiadm  -m node -T iqn.2017-08.com.example:stroage1 -o delete

這裡寫圖片描述

lvm 磁碟擴充套件共享

在server上:
分出兩個分割槽,/dev/vdb1和/dev/vdb2,注意分割槽的同時要將分割槽的型別改為8e,也就是LVM型別

[root@server ~]# pvcreate /dev/vdb1
[root@server ~]# vgcreate vg0 /dev/vdb1
[root@server ~]# lvcreate -l 511 -n  lv0 vg0

這個511是用vgdisplay查詢出一共有522個沒有使用的PE
接下來我們繼續用targetcli命令在服務端將我們分好的可擴充套件的lvm磁碟變為我們所建立磁碟共享檔案的指向端。

/> /backstores/block create westos:storage1 /dev/vg0/lv0
Created block storage object westos:storage1 using /dev/vg0/lv0.
/> /iscsi create  iqn.2017-08.com.example:storage1
Created target iqn.2017-08.com.example:storage1.
Created TPG 1.
/> iscsi/iqn.2017-08.com.example:storage1/tpg1/luns create /backstores/block/feitian:storage1 
Created LUN 0.
/> iscsi/iqn.2017-08.com.example:storage1/tpg1/acls  create iqn.2017-08.com.example:storage1key
Created Node ACL for iqn.2017-08.com.example:storage1key
Created mapped LUN 0.
/> iscsi/iqn.2017-08.com.example:storage1/tpg1/portals  create 172.25.254.231
Using default IP port 3260
Created network portal 172.25.254.231:3260.

在客戶端

[root@client ~]# vim /etc/iscsi/initiatorname.iscsi 
InitiatorName=iqn.2017-08.com.example:stroage1key
[root@client iscsi]# systemctl restart iscsid.service 
[root@client iscsi]# systemctl restart iscsi
[root@client ~]# iscsiadm  -m discovery -t st -p 172.25.254.119
172.25.254.119:3260,1 iqn.2017-08.com.example:storage1
[root@client iscsi]# iscsiadm -m node -T iqn.2017-08.com.example:storage1 -P 172.25.254.119 -l

Fdisk -l就會多出來一/dev/sda3
如果你的磁碟不夠用,這時你可以擴增你server端的lv0
server上

[[email protected]server ~]# pvcreate /dev/vdb2
  Physical volume "/dev/vdb2" successfully created
[[email protected]server ~]# vgextend vg0  /dev/vdb2
  Volume group "vg0" successfully extended
[[email protected]server ~]# lvextend -L 3G  /dev/vg0/lv0 
  Extending logical volume lv0 to 3.00 GiB
  Logical volume lv0 successfully resized

客戶端上:

[[email protected] iscsi]# iscsiadm  -m node  -T iqn.2017-08.com.example:storage1 -u
Logging out of session [sid: 9, target: iqn.2017-08.com.example:storage1, portal: 172.25.254.119,3260]
Logout of [sid: 9, target: iqn.2017-08.com.example:storage1, portal: 172.25.254.119,3260] successful.
[[email protected] iscsi]# systemctl restart iscsid
[[email protected] iscsi]# systemctl restart iscsi
[[email protected] iscsi]# iscsiadm -m node -T iqn.2017-08.com.example:storage1 -P 172.25.254.119 -l
Logging in to [iface: default, target: iqn.2017-08.com.example:storage1, portal: 172.25.254.119,3260] (multiple)
Login to [iface: default, target: iqn.2017-08.com.example:storage1, portal: 172.25.254.119,3260] successful.

再次使用fdisk -L 命令檢視時就會發現磁碟變為3G大小:
這裡寫圖片描述

相關推薦

iscsi磁碟共享擴充套件

在服務端作如下步驟 服務端先用fdisk /dev/vdb分一塊磁碟區域出來為/dev/vdb1 [root@server ~]# yum install targetcli -y [root@server ~]# systemctl start ta

Linux iscsi磁碟共享掛載

Linux iscsi磁碟對映 一、什麼是iscsi iSCSI技術是一種由IBM公司研究開發的,是一個供硬體裝置使用的可以在IP協議的上層執行的SCSI指令集,這種指令集合可以實現在IP網路上執行SCSI協議,使其能夠在諸如高速千兆乙太網上進行路由選擇。iSCSI技術是一種新儲存技術,該技術是

linux 的iSCSI 網路磁碟共享

        iSCSI(Internet Small Computer System Interface,發音為/ˈаɪskʌzi/),Internet小型計算機系統介面,又稱為IP-SAN,是一種基於因特網及SCSI-3協議

Linux下iscsi提供的磁碟共享服務(企業級)

ISCSI iSCSI( Internet Small Computer System Interface 網際網路小型計算機系統介面)是由IBM 下屬的兩大研發機構一一加利福尼亞AImaden和以色列Haifa研究中心共同開發的,是一個供硬體裝置使用的、可在IP協議上層執行的SCSI指

Linux 基礎知識 之 ISCSI 檔案系統 (磁碟共享

一、iSCSI簡介 iscsi是一種塊級別的協議,用於通過TCP/IP網路共享原始儲存裝置,即硬碟的共享。可以用已經存在的IP和乙太網如網絡卡、交換機、路由器等通過iSCSI協議共享和訪問儲存。 iSCSI target是一種由遠端iSCSI伺服器(target)提供的遠端硬碟。 二、磁

iscsi共享(磁碟共享)

前言: 最近整理一些以前的學習筆記。 過去都是儲存在本地,此次傳到網路留待備用。\   iSCSI共享 internet

suselinux12基於ISCSI共享存儲設置

suselinux iscsitarget 實驗環境:vmware workstation12 操作系統:suse12sp2 虛擬機處於同一網段下 網絡環境架構如下 主機名角色IP地址Suse12sp2N1ISCSI initiator192.168.2.246Suse12sp2N2ISCSI initi

ECS linux 搭建NFS服務實現磁碟共享的具體操作

 目前在使用雲磁碟的時候,無法實現一塊雲磁碟同時掛載到多臺伺服器上的需求,只能實現一塊磁碟掛載到一臺伺服器使用。   但可通過搭建NFS服務,通過內網(默認同一個帳號下同一個region伺服器內網互通)實現一塊磁碟共享給多臺伺服器使用。   NFS的搭建環境如下所示:   系統環境

Linux下通過iscsi搭建共享儲存

很多情況下,為了簡單,我們經常簡單的通過nfs來搭建共享儲存服務。 有時候,一些軟體需要,對共享儲存有特殊要求,比如需要通過多個硬碟實現較大的儲存空間,或者軟體有特殊需要。這時,我們可以考慮通過iscsi工具來實現軟的貢獻儲存。 iscsi搭建的貢獻儲存,需要分別搭建服

配置nginx的負載均衡keepalived和nfs磁碟共享

環境說明3臺虛擬機器CentOS 6.5 x86_64,安裝好hengdalnmp.zip (lnmp1.3)主nginx負載均衡器:192.168.223.130  (通過keepalived配置了VIP:192.168.223.160供外使用) 副nginx負載均衡器:1

叢集基礎-----(iscsi遠端共享儲存)

遠端儲存iscsi iscis (在兩個叢集以外的裝置上,作用:加一個儲存)—-共享儲存 1) yum install -y scsi-* ## 2) vim /etc/tgt/targets.conf (38行)<targ

openfiler作為文件server,實現ISCSI共享存儲

physical 設置 iscs dsm 地址 eat 控制 sta select 還是不能發圖。這是第二篇。圖文在這個地址:http://download.csdn.net/detail/weimingyu945/8089893 1 登陸 首先登陸openf

linxu iSCSI設備共享

linux 基礎運維學習1、iscsI 概念 SCSI 支持從客客戶端通過IP向遠程服務器上的iscsI 存儲設備發送SCSI命令。默認情況下,網絡通信是至iSCSI目標上的端口3260/tcp的明文端口2、軟件安裝[[email protected]/* */ ~]# yum install

iscsi共享存儲

iscsi iscsi實現網絡存儲,提供存儲端叫 target,使用存儲端叫 initiator。 target 上可以提供存儲空間,initiator負責連接ISCSI設備,在ISCSI設備中創建文件系統,以及存取數據,在 initiator 上看上去是多了一塊硬盤。 服務器端配置targe

Linux下搭建iSCSI共享存儲詳細步驟(服務器模擬IPSAN存儲)

沖突 能夠 相互 協議 intel 指令 路由選擇 tid 啟動服務 一、簡介 iSCSI(internet SCSI)技術由IBM公司研究開發,是一個供硬件設備使用的、可以在IP協議的上層運行的SCSI指令集,這種指令集合可以實現在IP網絡上運行SCSI協議,使

磁盤共享------iscsi

iscsi前邊說過的cifs以及nfs這個文件共享系統雖然已經是比較成熟的了,但是在客戶機端連接到服務器端上傳文件時,先會將文件轉換為2進制文件,在接受端接受到2進制文件後在轉化為相應的格式顯示出來,然後在服務器端把這個文件轉化為2進制文件,然後存儲在磁盤中。既然是要將文件存儲在服務器端,那麽為什麽不能直接保

Linux常見服務器存儲類型和iSCSI共享存儲

服務器 存儲 iSCSI 共享存儲 一、常見的存儲類型和iSCSI 概念及介紹1 、 常見的三種存儲類型DAS(Direct-AttachedStorage)直接附加存儲,存儲設備一般通過scsi/ide總線直接連接到主機上,常見的如SATA硬盤,SAS硬盤等,直接通過準線連接到計算機主板上面

Linux搭建 iSCSI 共享存儲 個人理解,詳細配置 centos7

iscsi;網絡存儲 官方解釋: iSCSI( Internet Small Computer System Interface 互聯網小型計算機系統接口)是由IBM 下屬的兩大研發機構一一加利福尼亞AImaden和以色列Haifa研究中心共同開發的,是一個

共享存儲(ISCSI網絡存儲)

discovery yum png roc mkdir 沒有 ini eat cat server端:(192.168.100.11) 分區sdb 分別為10G和5G #fdisk /dev/dab …… 同步分區表 #partprobe /dev/sdb

程式碼連線內網共享磁碟WNetCancelConnection();WNetAddConnection2()

前言 如果你能看到本篇部落格說明你應該是對網路磁碟對映有所瞭解的,如果你不瞭解網路磁碟對映而是通過PathFileExists();WNetCancelConnection();WNetAddConnection2()這三個函式找到本部落格的,可以點選連結瞭解下網路磁碟對映 https: