码迷,mamicode.com
首页 > 其他好文 > 详细

day5 RHCE

时间:2017-10-08 12:14:49      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:util   服务端   conf   splay   ...   targetcli   tde   arch   div   

19 、配置 iSCSI 服务端

[root@server0 ~]# yum install targetcli.noarch -y
[root@server0 ~]# systemctl enable target
[root@server0 ~]# systemctl restart target
[root@server0 ~]# firewall-cmd --permanent --add-port=3260/tcp
[root@server0 ~]# firewall-cmd --reload 
[root@server0 ~]# ll /dev/sd*
[root@server0 ~]# fdisk /dev/sdb 
p
n
 p
+4G 
 p
t
 8e
p
w
[root@server0 ~]# partprobe 
[root@server0 ~]# ll /dev/sd*
[root@server0 ~]# pvcreate /dev/sdb1
[root@server0 ~]# vgcreate iscsi_vg /dev/sdb1
[root@server0 ~]# lvcreate -n iscsi_store -L 3G /dev/iscsi_vg
[root@server0 ~]# lvdisplay 
[root@server0 ~]# lvs
[root@server0 ~]# targetcli 
/> ls
/> cd backstores/block 
/backstores/block> ls
/backstores/block> create name=LUN0 dev=/dev/iscsi_vg/iscsi_store 
/backstores/block> ls

/backstores/block> cd /iscsi 
/iscsi> ls
/iscsi> create iqn.2014-11.com.example:server0
/iscsi> ls
/iscsi> cd iqn.2014-11.com.example:server0/tpg1/luns 
/iscsi/iqn.20...er0/tpg1/luns> create /backstores/block/LUN0 
/iscsi/iqn.20...er0/tpg1/luns> cd ..
/iscsi/iqn.20...:server0/tpg1> ls
/iscsi/iqn.20...:server0/tpg1> cd acls 
/iscsi/iqn.20...er0/tpg1/acls> create iqn.2014-11.com.example:desktop0
/iscsi/iqn.20...er0/tpg1/acls> ls

/iscsi/iqn.20...er0/tpg1/acls> cd ..
/iscsi/iqn.20...:server0/tpg1> ls
/iscsi/iqn.20...:server0/tpg1> cd portals 
/iscsi/iqn.20.../tpg1/portals> ls
/iscsi/iqn.20.../tpg1/portals> create 
/iscsi/iqn.20.../tpg1/portals> ls

/iscsi/iqn.20.../tpg1/portals> cd ..
/iscsi/iqn.20...:server0/tpg1> ls

/iscsi/iqn.20...:server0/tpg1> set attribute authentication=0
Parameter authentication is now ‘0‘.
/iscsi/iqn.20...:server0/tpg1> set attribute generate_node_acls=0
Parameter generate_node_acls is now ‘0‘.
/> saveconfig 
/> exit
[root@server0 ~]# systemctl restart target.service 

  

20 、配置 iSCSI 的客户端

[root@desktop0 ~]# yum install iscsi-initiator-utils.i686 -y
[root@desktop0 ~]# systemctl enable iscsi
[root@desktop0 ~]# systemctl restart iscsi
[root@desktop0 ~]# systemctl restart iscsid
[root@desktop0 ~]# systemctl enable iscsid

[root@desktop0 ~]# vim /etc/iscsi/initiatorname.iscsi 
InitiatorName=iqn.2014-11.com.example:desktop0


[root@desktop0 ~]# systemctl enable iscsid
[root@desktop0 ~]# systemctl enable iscsi
[root@desktop0 ~]# systemctl restart iscsid
[root@desktop0 ~]# systemctl restart iscsi
[root@desktop0 ~]# iscsiadm -m discovery -t st -p 172.25.0.11
[root@desktop0 ~]# iscsiadm -m discovery -t st -p 172.25.0.11 -l

[root@desktop0 ~]# yum install lsscsi.x86_64  -y
[root@desktop0 ~]# lsscsi 
[root@desktop0 ~]# fdisk /dev/sdc
p
n 
 p
+2100M
 w
[root@desktop0 ~]# partprobe 
[root@desktop0 ~]# ll /dev/sd*
[root@desktop0 ~]# mkfs.ext4 /dev/sdc1
[root@desktop0 ~]# ll /mnt/data
[root@desktop0 ~]# mkdir -pv /mnt/data
[root@desktop0 ~]# blkid
[root@desktop0 ~]# vim /etc/fstab 
UUID=f5c9e6ae-c0b0-401d-beb0-96da19cd23dc /mnt/data     ext4    defaults,_netdev        0 0


[root@desktop0 ~]# mount -a
[root@desktop0 ~]# 
[root@desktop0 ~]# df -h

  

day5 RHCE

标签:util   服务端   conf   splay   ...   targetcli   tde   arch   div   

原文地址:http://www.cnblogs.com/venicid/p/7636816.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!