Prerequisites
- Two Linux servers with OS centos 7.
- server.example.com - 192.168.10.17
- desktop.example.com - 192.168.10.18
- "/etc/hosts" entry should be added on both servers.
- server.example.com should have additional disk for iSCSI.
Configure iSCSI Server
Step 1: Install "targetcli.noarch" package on server host and enable the service.# yum install targetcli.noarch# systemctl enable target# systemctl start target
Step 2: Create iSCSI partition
# fdisk /dev/sdb
# targetcli
/> backstores/block create name=data_block dev=/dev/sdb1/> iscsi/ create iqn.2020-12.com.example:server/> iscsi/iqn.2020-12.com.example:server/tpg1/acls create iqn.2020-12.com.example:desktop/> iscsi/iqn.2020-12.com.example:server/tpg1/luns create /backstores/block/data_block/> saveconfig/> exit
Configure ISCSI Initiator
Step 1: Install "iscsi-initiator-utils.x86_64" package on desktop server.
# yum install iscsi-initiator-utils.x86_64
Step 2: Put below content to "/etc/iscsi/initiatorname.iscsi" this file.
InitiatorName=iqn.2020-12.com.example:desktop
# iscsiadm --mode discoverydb --type sendtargets --portal 192.168.10.17 --discover
Before attached output of "lsblk" command.
# iscsiadm --mode node --targetname iqn.2020-12.com.example:server --portal 192.168.10.17:3260 --login
Verify whether iSCSI device is attached or not using "lsblk" command.
Now you can use this iSCSI device to store your data. Before that you have to format and mount to your server.
- Create Partition














No comments:
Post a Comment