成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

Linux下實現基于iscsi的存儲服務

運維 系統運維
iSCSI(iSCSI = internet Small Computer System Interface )是由IEETF開發的網絡存儲標準,目的是為了用IP協議將存儲設備連接在一起。通過在IP網上傳送SCSI命令和數據,ISCSI推動了數據在網際之 間的傳遞,同時也促進了數據的遠距離管理。由于其出色的數據傳輸能力,ISCSI協議被認為是促進存儲區域網(SAN)市場快速發展的關鍵因素之一。因為 IP網絡的廣泛應用, ISCSI能夠在LAN、WAN甚至internet上進行數據傳送,使得數據的存儲不再受地域的現在。

 本文詳細介紹了Linux下搭建基于iscsi的存儲服務,先簡單介紹一下iscsi。

iSCSI(iSCSI = internet Small Computer System Interface )是由IEETF開發的網絡存儲標準,目的是為了用IP協議將存儲設備連接在一起。通過在IP網上傳送SCSI命令和數據,ISCSI推動了數據在網際之 間的傳遞,同時也促進了數據的遠距離管理。由于其出色的數據傳輸能力,ISCSI協議被認為是促進存儲區域網(SAN)市場快速發展的關鍵因素之一。因為 IP網絡的廣泛應用, ISCSI能夠在LAN、WAN甚至internet上進行數據傳送,使得數據的存儲不再受地域的現在。

接下來就詳細介紹搭建iscsi的步驟:

創建新的分區:

[root@localhost /]# fdisk /dev/sdb 
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 13054.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-13054, default 1): 
Using default value 1
Last cylinder or size or sizeM or sizeK (1-13054, default 13054): 
Using default value 13054

Command (m for help): 
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@localhost /]# fdisk -l 

Disk /dev/sda: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux

/dev/sda2 14 26108 209608087 8e Linux LVM

Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 13054 104856223 83 Linux
2.搭建iscsi服務器

[root@localhost /]# yum -y install scsi-target-utils #安裝軟件包

開啟服務

[root@localhost /]# /etc/init.d/tgtd start # 使用3260端口
Starting SCSI target daemon: Starting target framework daemon
c
[root@localhost /]# chkconfig tgtd on

詳細信息可以man 一下 man tgtadm

下面創建一個存儲(server)

# Create a target
tgtadm --lld iscsi --mode target --op new --tid 1 --targetname iqn.2007-03:virtual-dvd:'hostname'

# Create the SMC device and give it a nice name
tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 2 --backing-store /dev/sdb1

# Allow ALL initiators to connect to this target
tgtadm --lld iscsi --mode target --op bind --tid 1 --initiator-address ALL


# Show all our good work.
tgtadm --lld iscsi --mode target --op show

NOTE : 將上述需要寫到rc.local文件中,開機自啟動

掛載一個存儲(client)

[root@it ~]# yum -y install iscsi-initiator-utils

可以man 一下 man iscsiadm

Discover targets at a given IP address:

iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.10 --discover

Login, must use a node record id found by the discovery:

iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --login

Logout:

iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --logout

List node records:

iscsiadm --mode node

Display all data for a given node record:

iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260

 

下面繼續我的實例:

[root@it ~]# iscsiadm --mode discoverydb --type sendtargets --portal 192.168.7.116 --discover
192.168.7.116:3260,1 iqn.2007-03:virtual-dvd:hostname
[root@it ~]# iscsiadm --mode node --targetname iqn.2007-03:virtual-dvd:hostname --portal 192.168.7.116:3260 --login
Logging in to [iface: default, target: iqn.2007-03:virtual-dvd:hostname, portal: 192.168.7.116,3260]
Login to [iface: default, target: iqn.2007-03:virtual-dvd:hostname, portal: 192.168.7.116,3260] successful.

[root@it ~]# iscsiadm --mode node
192.168.7.116:3260,1 iqn.2007-03:virtual-dvd:hostname

[root@it ~]# fdisk -l 
Disk /dev/sdc: 107.3 GB, 107372772864 bytes
255 heads, 63 sectors/track, 13053 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table
多出來一個100G的硬盤 , 這個就是之前掛載過來的那一快

之后進行格式化,掛載就可以了

【編輯推薦】

  1. 如何在RHEL5.7下搭建和配置DHCP服務器
  2. Linux服務器的16個監控命令
  3. 服務器性能指標:撥開服務器評測體系迷霧
責任編輯:趙寧寧
相關推薦

2018-05-16 09:08:40

ISCSI網絡存儲

2017-11-13 10:04:08

IP存儲iSCSI

2011-03-16 09:05:33

2021-07-05 09:40:25

iSCSI存儲協議以太網

2021-12-15 08:29:46

Starwind ISCSI 共享存儲

2019-09-20 08:17:15

Windows軟件腳本語言

2009-08-02 17:44:18

服務器虛擬化iSCSIFC

2013-07-25 10:42:52

2009-09-11 08:49:09

linuxNIS服務linux配置

2012-05-22 15:55:41

AIXiSCSI

2009-07-20 09:18:38

存儲虛擬化服務器虛擬化iSCSI

2019-05-08 11:10:05

Linux進程語言

2010-08-02 14:29:46

LinuxPingICMP

2012-10-30 09:59:04

RackspaceOpenStack

2025-05-16 08:58:47

Mongodb分布式存儲

2011-12-23 10:45:34

虛擬化桌面虛擬化SRM

2019-04-09 11:24:20

存儲

2018-04-28 09:20:19

DASNASSAN

2018-06-04 09:43:53

分層存儲Linux

2023-04-06 10:08:58

點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 91国产视频在线 | 国产一区二区三区视频 | 日韩欧美视频在线 | 午夜天堂精品久久久久 | 在线观看中文视频 | 亚洲一区中文字幕在线观看 | 成人av免费| av中文字幕在线播放 | 在线观看的av | 女人毛片a毛片久久人人 | 亚洲成人福利视频 | 亚洲精品乱码久久久久久按摩 | 久在线| 国产精品一区二区在线 | 国产一区二区三区免费视频 | 日韩一区二区三区av | 欧美精品一区二区三区在线 | 日本三级在线视频 | 一区二区三区四区视频 | 精品国产一区一区二区三亚瑟 | www.操com| www免费视频 | 一级网站| 亚洲成人精品久久 | 爱爱小视频| 亚洲精品一区二区另类图片 | 欧美日韩国产精品激情在线播放 | 亚洲男人天堂2024 | 日本公妇乱淫xxxⅹ 国产在线不卡 | 91亚洲国产成人精品一区二三 | 亚洲精品视频久久 | 免费黄色av网站 | 中文在线一区 | 精品国产免费一区二区三区五区 | 亚洲在线 | 伊人久麻豆社区 | 极品的亚洲 | 亚洲国产精品99久久久久久久久 | 久久男人| 久久久久国产精品 | 中文字幕第二区 |