资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Centos7怎么安装iscsi

这篇文章主要讲解了“Centos7怎么安装iscsi”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Centos7怎么安装iscsi”吧!

成都网站建设、成都做网站中从网站色彩、结构布局、栏目设置、关键词群组等细微处着手,突出企业的产品/服务/品牌,帮助企业锁定精准用户,提高在线咨询和转化,使成都网站营销成为有效果、有回报的无锡营销推广。创新互联公司专业成都网站建设10多年了,客户满意度97.8%,欢迎成都创新互联客户联系。

搭建数据库RAC环境,使用ISCSI服务模拟存储服务器,之前使用的是Linux 6系列所以发现7不同,特此记录:

服务器安装targetcli

# yum -y install targetcli

启动target服务

# systemctl start target

设置开机启动服务

# systemctl enable target

开始创建

进入targetcli

#targetcli

步骤1:建立一个块存储

注意:server1.disk(名称server1可自定义),/dev/sdb1为上面新建的分区名称。

/backstores/fileio> /backstores/block create disk_ocr1 /dev/sdb

Created block storage object disk_ocr1 using /dev/sdb.

/backstores/fileio> /backstores/block create disk_ocr2 /dev/sdc

Created block storage object disk_ocr2 using /dev/sdc.

/backstores/fileio> /backstores/block create disk_ocr3 /dev/sdd

Created block storage object disk_ocr3 using /dev/sde.

/backstores/fileio> /backstores/block create disk_data1 /dev/sde

Created block storage object disk_data1 using /dev/sde.

/backstores/fileio> /backstores/block create disk_data2 /dev/sdf

Created block storage object disk_data2 using /dev/sdf.

/backstores/fileio> /backstores/block create disk_data3 /dev/sdg

Created block storage object disk_data3 using /dev/sdg.

/backstores/fileio> /backstores/block create disk_data4 /dev/sdh

Created block storage object disk_data4 using /dev/sdh.

步骤2:配置ISCSITarget命名

注意:命名在同一子网内确保是唯一的,命名格式为:iqn.yyyy-mm.<主机名反写>:自定义名称(自定义名称内不能有下划线)

/backstores/fileio> /iscsi create iqn.2019-04.com.rac18cc:server

Created target iqn.2019-04.com.rac18cc:server.

Created TPG 1.

Global pref auto_add_default_portal=true

Created default portal listening on all IPs (0.0.0.0), port 3260.

步骤3:创建ACL允许ISCSI客户机连接

注意:iqn.2019-04.com.rac18cc:server:client1为客户机ISCSI名称。

/backstores/fileio> /iscsi/iqn.2019-04.com.rac18cc:server/tpg1/acls create iqn.2019-04.com.rac18cc:beijing

Created Node ACL for iqn.2019-04.com.rac18cc:beijing

步骤4:创建lun(target块设备的逻辑单元)

/backstores/fileio> /iscsi/iqn.2019-04.com.rac18cc:server/tpg1/luns create/backstores/block/disk_ocr1

Created LUN 0.

Created LUN 0->0 mapping in node ACL iqn.2019-04.com.rac18cc:beijing

/backstores/fileio> /iscsi/iqn.2019-04.com.rac18cc:server/tpg1/luns create/backstores/block/disk_ocr2

Created LUN 1.

Created LUN 1->1 mapping in node ACL iqn.2019-04.com.rac18cc:beijing

/backstores/fileio> /iscsi/iqn.2019-04.com.rac18cc:server/tpg1/luns create/backstores/block/disk_ocr3

Created LUN 2.

Created LUN 2->2 mapping in node ACL iqn.2019-04.com.rac18cc:beijing

/backstores/fileio> /iscsi/iqn.2019-04.com.rac18cc:server/tpg1/luns create/backstores/block/disk_data1

Created LUN 3.

Created LUN 3->3 mapping in node ACL iqn.2019-04.com.rac18cc:beijing

/backstores/fileio> /iscsi/iqn.2019-04.com.rac18cc:server/tpg1/luns create/backstores/block/disk_data2

Created LUN 4.

Created LUN 4->4 mapping in node ACL iqn.2019-04.com.rac18cc:beijing

/backstores/fileio> /iscsi/iqn.2019-04.com.rac18cc:server/tpg1/luns create/backstores/block/disk_data3

Created LUN 5.

Created LUN 5->5 mapping in node ACL iqn.2019-04.com.rac18cc:beijing

/backstores/fileio> /iscsi/iqn.2019-04.com.rac18cc:server/tpg1/luns create/backstores/block/disk_data4

Created LUN 6.

Created LUN 6->6 mapping in node ACL iqn.2019-04.com.rac18cc:beijing

步骤5:创建ip与端口

/> /iscsi/iqn.2019-04.com.rac18cc:server/tpg1/portals create 192.168.8.88

/>cd /iscsi/iqn.2019-04.com.rac18cc:server/tpg1/portals

/>create 192.168.8.88:3260

注:192.168.8.88为服务器IP;不指定端口默认为3260

步骤6:配置验证用户名和密码(这里可以省略)

/>cd

/iscsi/iqn.2017-05.com.mwdserver:iscsimwd1/tpg1/acls/iqn.2017-05.com.mwdinit:initmwd1

/>set auth userid=test

/>set auth password=test

步骤7:配置完成后查看配置信息,并退出。

/>cd /

/>ls

/>exit

客户端:

安装:

# yum -y install iscsi-initiator-utils

注:Ubuntu下比较方便好用的initiator是open iscsi:

apt-get install -y open-iscsi

启动iscsi服务:

# systemctl start iscsi

设置为开机自启动服务:

# systemctl enable iscsi

配置ISCSIInitiator名称(此处InitiatorName须与服务端配置的ACL允许ISCSI客户机连接的名称一致):

# vi /etc/iscsi/initiatorname.iscsi

InitiatorName=iqn.1994-05.com.redhat:d36e6c6eb661

修改为:

InitiatorName=iqn.2019-04.com.rac18cc:beijing

此处定义的Initiator名字要和在存储节点中定义ACL时使用的主机名字一致。

#vi /etc/iscsi/iscsid.conf

# line 57: 取消注释

node.session.auth.authmethod = CHAP

# line 61,62: 取消注释 and specify the username and password you set on the iSCSI target server

node.session.auth.username = username

node.session.auth.password = password

# 发现target

[root@rac18c1 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.8.88

192.168.8.88:3260,1 iqn.2019-04.com.rac18cc:server

[root@rac18c1 ~]# iscsiadm -m node -o show

# BEGIN RECORD 6.2.0.874-10

node.name = iqn.2019-04.com.rac18cc:server

node.tpgt = 1

node.startup = automatic

node.leading_login = No

iface.hwaddress =

iface.ipaddress =

iface.iscsi_ifacename = default

iface.net_ifacename =

iface.gateway =

iface.subnet_mask =

iface.transport_name = tcp

iface.initiatorname =

iface.state =

iface.vlan_id = 0

iface.vlan_priority = 0

iface.vlan_state =

iface.iface_num = 0

iface.mtu = 0

iface.port = 0

iface.bootproto =

iface.dhcp_alt_client_id_state =

iface.dhcp_alt_client_id =

iface.dhcp_DNS =

iface.dhcp_learn_iqn =

iface.dhcp_req_vendor_id_state =

iface.dhcp_vendor_id_state =

iface.dhcp_vendor_id =

iface.dhcp_slp_da =

iface.fragmentation =

iface.gratuitous_arp =

iface.incoming_forwarding =

iface.tos_state =

iface.tos = 0

iface.ttl = 0

iface.delayed_ack =

iface.tcp_nagle =

iface.tcp_wsf_state =

iface.tcp_wsf = 0

iface.tcp_timer_scale = 0

iface.tcp_timestamp =

iface.redirect =

iface.def_task_mgmt_timeout = 0

iface.header_digest =

iface.data_digest =

iface.immediate_data =

iface.initial_r2t =

iface.data_seq_inorder =

iface.data_pdu_inorder =

iface.erl = 0

iface.max_receive_data_len = 0

iface.first_burst_len = 0

iface.max_outstanding_r2t = 0

iface.max_burst_len = 0

iface.chap_auth =

iface.bidi_chap =

iface.strict_login_compliance =

iface.discovery_auth =

iface.discovery_logout =

node.discovery_address = 192.168.8.88

node.discovery_port = 3260

node.discovery_type = send_targets

node.session.initial_cmdsn = 0

node.session.initial_login_retry_max = 8

node.session.xmit_thread_priority = -20

node.session.cmds_max = 128

node.session.queue_depth = 32

node.session.nr_sessions = 1

node.session.auth.authmethod = CHAP

node.session.auth.username =

node.session.auth.password =

node.session.auth.username_in =

node.session.auth.password_in =

node.session.timeo.replacement_timeout = 120

node.session.err_timeo.abort_timeout = 15

node.session.err_timeo.lu_reset_timeout = 30

node.session.err_timeo.tgt_reset_timeout = 30

node.session.err_timeo.host_reset_timeout = 60

node.session.iscsi.FastAbort = Yes

node.session.iscsi.InitialR2T = No

node.session.iscsi.ImmediateData = Yes

node.session.iscsi.FirstBurstLength = 262144

node.session.iscsi.MaxBurstLength = 16776192

node.session.iscsi.DefaultTime2Retain = 0

node.session.iscsi.DefaultTime2Wait = 2

node.session.iscsi.MaxConnections = 1

node.session.iscsi.MaxOutstandingR2T = 1

node.session.iscsi.ERL = 0

node.session.scan = auto

node.conn[0].address = 192.168.8.88

node.conn[0].port = 3260

node.conn[0].startup = manual

node.conn[0].tcp.window_size = 524288

node.conn[0].tcp.type_of_service = 0

node.conn[0].timeo.logout_timeout = 15

node.conn[0].timeo.login_timeout = 15

node.conn[0].timeo.auth_timeout = 45

node.conn[0].timeo.noop_out_interval = 5

node.conn[0].timeo.noop_out_timeout = 5

node.conn[0].iscsi.MaxXmitDataSegmentLength = 0

node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144

node.conn[0].iscsi.HeaderDigest = None

node.conn[0].iscsi.IFMarker = No

node.conn[0].iscsi.OFMarker = No

# END RECORD

连接ISCSI设备:

 iscsiadm -m node --login

 # cat /proc/partitions 

# iscsiadm --mode node --targetname iqn.2019-04.com.rac18cc:server --portal 192.168.8.88 --login

感谢各位的阅读,以上就是“Centos7怎么安装iscsi”的内容了,经过本文的学习后,相信大家对Centos7怎么安装iscsi这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是创新互联,小编将为大家推送更多相关知识点的文章,欢迎关注!


文章名称:Centos7怎么安装iscsi
浏览路径:http://cdkjz.cn/article/jcoioo.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220