ISCSI
ISCSI Manager
yum repolist
yum install targetcli (check targetcli)
ll /dev/sd*
fdisk /dev/sd* (new disk)
n >> new partition
w >> wirte
mkfs.xfs /dev/sdb1 (格式化)
seenforce 0
vim /etc/selinux/config
SELINUX=disabled
vim /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2019-06.com.centos:simoniscsi # 2019-06>>(time) centos>>(default: redhat) simoniscsi >> (host :: iscsi group(不重複))
systemctl restart iscsid
targetcli
cd /backstores/blockcreate mysqldisk(disk name) /dev/sdb1(disk path)cd /iscsicreate iqn.2019-06.com.centos:simoniscsi (iscsi manager InitiatorName)cd iqn.2019-06.com.centos:simoniscsi/tpg1/lunscreate /backstores/block/mysqldisk lun=0cd ../portalsdelete <default ip> <default port>create <manager ip> <manager port>(default 3260)cd ../aclscreate iqn.2019-06.mysql.test:db1 (iscsi agent InitiatorName)exit
systemctl stop firewalld (or add port)
ISCSI Agent
vim /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2019-06.com.centos:simonm2 # 2019-06>>(time) centos>>(default: redhat) simonm2 >> (host :: iscsi group(不重複))
systemctl restart iscsid
iscsiadm -m discovery -t st -p 172.29.29.150 (iscsi manager ip)
iscsiadm -m node -p 172.29.29.150:3260 (iscsi manager ip) -l (login)
ll /dev/sd*
fdisk /dev/sd* (new disk)
n >> new partition
w >> wirte
mkfs.xfs /dev/sdb1 (格式化)
mount /dev/sdb1
df -h 硬碟mount的位置
vim /etc/fstab
/dev/sdb1 /sharedisk xfs defaults 0 0