linux下搭建ISCSI服务器Word文件下载.docx

上传人:b****5 文档编号:18066597 上传时间:2022-12-13 格式:DOCX 页数:9 大小:354.42KB
下载 相关 举报
linux下搭建ISCSI服务器Word文件下载.docx_第1页
第1页 / 共9页
linux下搭建ISCSI服务器Word文件下载.docx_第2页
第2页 / 共9页
linux下搭建ISCSI服务器Word文件下载.docx_第3页
第3页 / 共9页
linux下搭建ISCSI服务器Word文件下载.docx_第4页
第4页 / 共9页
linux下搭建ISCSI服务器Word文件下载.docx_第5页
第5页 / 共9页
点击查看更多>>
下载资源
资源描述

linux下搭建ISCSI服务器Word文件下载.docx

《linux下搭建ISCSI服务器Word文件下载.docx》由会员分享,可在线阅读,更多相关《linux下搭建ISCSI服务器Word文件下载.docx(9页珍藏版)》请在冰豆网上搜索。

linux下搭建ISCSI服务器Word文件下载.docx

[root@wmm~]#rpm-aq|grepscsi-initial-utils

[root@wmm~]#yum-yinstallscsi-initial-utils

采用文件镜像作为iscsi-target

[root@wmm~]#ddif=/dev/zeroof=/srv/iscsi/disk1.imgbs=1Mcount=500

记录了500+0的读入

记录了500+0的写出

524288000字节(524MB)已复制,13.4097秒,39.1MB/秒

[root@wmm~]#fdisk/dev/sdb

WARNING:

DOS-compatiblemodeisdeprecated.It'

sstronglyrecommendedto

switchoffthemode(command'

c'

)andchangedisplayunitsto

sectors(command'

u'

).

Command(mforhelp):

n

Commandaction

eextended

pprimarypartition(1-4)

p

Partitionnumber(1-4):

1

Firstcylinder(1-2610,default1):

Usingdefaultvalue1

Lastcylinder,+cylindersor+size{K,M,G}(1-2610,default2610):

+1000M

wq

Thepartitiontablehasbeenaltered!

Callingioctl()tore-readpartitiontable.

Syncingdisks.

[root@wmm~]#partprobe【更新到内核中】

Warning:

WARNING:

thekernelfailedtore-readthepartitiontableon/dev/sda(设备或资源忙).Asaresult,itmaynotreflectallofyourchangesuntilafterreboot.

创建LV

[root@wmm~]#partprobe

[root@wmm~]#pvcreate/dev/sdb1

Writingphysicalvolumedatatodisk"

/dev/sdb1"

Physicalvolume"

successfullycreated

创建VG

[root@wmm~]#vgcreateserver/dev/sdb1

Volumegroup"

server"

[root@wmm~]#lvcreate-L1G-niscsi01server【可以采用500PE】

[root@wmm~]#serviceiptablesstop

iptables:

清除防火墙规则:

[确定]

将链设置为政策ACCEPT:

natmanglefilter[确定]

正在卸载模块:

编辑配置文件:

[root@wmm~]#vim/etc/tgt/targets.conf

<

targetiqn.2012-:

wmmdisk>

【目标|标准查询|日期|主机名|共享名】

backing-store/dev/sdb2【设备一】

backing-store/srv/iscsi/disk1.img【镜像名】

backing-store/dev/server/iscsi01【设备绿】

/target>

【backing-store:

虚拟设备|direct-store:

实际设备,如果整个磁盘做位存储就选直接存储】

采用虚机存储有三种方式:

分区,dd的大磁盘文件,LV。

Initiator-address:

允许发现的地址

Incominguser:

允许进入的用户名密码。

Write-cache:

用于加速的缓存,容易丢失数据。

启动服务:

[root@wmm~]#/etc/init.d/tgtdstart

正在启动SCSItargetdaemon:

tgtadm:

invalidrequest

Command:

tgtadm-C0--lldiscsi--opnew--modelogicalunit--tid1--lun2-b/srv/iscsi/disk1.img

exitedwithcode:

22.

[root@wmm~]#chkconfigtgtdon【开机启动】

查看端口是否开启:

[root@wmm~]#netstat-tulnp|grep3260

tcp000.0.0.0:

32600.0.0.0:

*LISTEN25605/tgtd

tcp00:

:

3260:

[root@wmm~]#tgt-admin--show【查看一下设备】

Target1:

iqn.2012-:

wmmdisk

Systeminformation:

Driver:

iscsi

State:

ready

I_Tnexusinformation:

LUNinformation:

LUN:

0

Type:

controller

SCSIID:

IET00010000

SCSISN:

beaf10

Size:

0MB,Blocksize:

Online:

Yes

Removablemedia:

No

Preventremoval:

Readonly:

Backingstoretype:

null

Backingstorepath:

None

Backingstoreflags:

disk

IET00010001

beaf11

1053MB,Blocksize:

512

rdwr

/dev/sdb2

2

IET00010002

beaf12

1074MB,Blocksize:

/dev/server/iscsi02

Accountinformation:

ACLinformation:

Linux客户端设置:

[root@wmm~]#serviceiscsidrestart

停止iscsid:

正在启动iscsid:

[root@wmm~]#chkconfigiscsidon【开机启动】

如果是linux客户端,完整的步骤如下:

[root@wmm~]#/etc/init.d/iscsirestart

停止iscsi:

正在启动iscsi:

[root@wmm~]#chkconfigiscsion【设置开机自动启动】

[root@wmm~]#iscsiadm-mdiscovery-tsendtargets-p127.0.0.1【发现和侦测】

127.0.0.1:

3260,1iqn.2012-:

[root@wmm~]#iscsiadm-mnode【发现节点】

[root@wmm~]#fdisk-l【如果你发现有另外的盘,就表示挂载上了啊!

格式化,挂载即可,我们可以再一次整合成为VG】

[root@wmm~]#pvcreate/dev/sd{d,e}

/dev/sdd"

/dev/sde"

[root@wmm~]#vgextendserver/dev/sd{d,e}

FoundduplicatePV0Q9P5AuDQxwM6SeM817n1xUVjUun1jkv:

using/dev/sddnot/dev/sdb2

using/dev/sdb2not/dev/sdd

Nophysicalvolumelabelreadfrom/dev/sde

successfullyextended

[root@wmm~]#vgdisplay

[root@wmm~]#lvcreate-L700-nwmmdiskserver

Logicalvolume"

wmmdisk"

created

[root@wmm~]#lvdisplay

格式化:

[root@wmm~]#mkfs.ext4/dev/server/wmmdisk

mke2fs1.41.12(17-May-2010)

文件系统标签=

操作系统:

Linux

块大小=4096(log=2)

分块大小=4096(log=2)

Stride=0blocks,Stripewidth=0blocks

44832inodes,179200blocks

8960blocks(5.00%)reservedforthesuperuser

第一个数据块=0

Maximumfilesystemblocks=184549376

6blockgroups

32768blockspergroup,32768fragmentspergroup

7472inodespergroup

Superblockbackupsstoredonblocks:

32768,98304,163840

正在写入inode表:

完成

Creatingjournal(4096blocks):

完成

Writingsuperblocksandfilesystemaccountinginformation:

Thisfilesystemwillbeautomaticallycheckedevery32mountsor

180days,whichevercomesfirst.Usetune2fs-cor-itooverride.

挂载:

[root@wmm~]#mount/dev/server/wmmdisk/mnt/wmmdisk/

 

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 军事

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1