zoukankan      html  css  js  c++  java
  • ISCSI共享存储

    ISCSI网络磁盘    默认端口:3260

    服务端:

    一.

    二.安装软件:targetcli

    用命令targetcli进行配置------------------------进入iscsi磁盘配置模式

      1.建立backstore后端存储

        >>>  backstores/block create  name=nsd  dev=/dev/vdb1
        >>>  ls
      2.建立target磁盘组(iqn.yyyy-mm.倒叙域名:自定义标示)

        >>>  iscsi/ create iqn.2018-11.com.example:server0

        >>>  ls

      3.配置lun关联

        >>>  iscsi/iqn.2018-11.com.example:server0/tpg1/luns create /backstores/block/nsd

        >>>  ls

      4.配置访问控制:设置客户端声称的名字

        >>>  iscsi/iqn.2018-11.com.example:server0/tpg1/acls create iqn.2018-11.com.example:desktop0

      5.启用ip地址与端口

        >>>  iscsi/iqn.2018-11.com.example.server0/tpg1/portals create 172.25.0.11

    三.重启服务:

      systemctl restart target

      systemctl enable target

    yum -y install targetcli
    [root@server0 ~]# targetcli
    Warning: Could not load preferences file /root/.targetcli/prefs.bin.
    targetcli shell version 2.1.fb34
    Copyright 2011-2013 by Datera, Inc and others.
    For help on commands, type 'help'.
    
    /> ls
    o- / ..................................................................... [...]
      o- backstores .......................................................... [...]
      | o- block .............................................. [Storage Objects: 0]
      | o- fileio ............................................. [Storage Objects: 0]
      | o- pscsi .............................................. [Storage Objects: 0]
      | o- ramdisk ............................................ [Storage Objects: 0]
      o- iscsi ........................................................ [Targets: 0]
      o- loopback ..................................................... [Targets: 0]
    /> backstores/block create name=nsd dev=/dev/vdb1
    Created block storage object nsd using /dev/vdb1.
    /> iscsi/ create iqn.2018-11.com.example:server0
    Created target iqn.2018-11.com.example:server0.
    Created TPG 1.
    /> iscsi/iqn.2018-11.com.example:server0/tpg1/luns create /backstores/block/nsd 
    Created LUN 0.
    /> iscsi/iqn.2018-11.com.example:server0/tpg1/acls create iqn.2018-11.com.example:desktop0
    Created Node ACL for iqn.2018-11.com.example:desktop0
    Created mapped LUN 0.
    /> iscsi/iqn.2018-11.com.example:server0/tpg1/portals create 172.25.0.11
    Using default IP port 3260
    Created network portal 172.25.0.11:3260.
    /> 
    [root@server0 ~]# systemctl restart target
    [root@server0 ~]# systemctl enable target

    客户端:

    1.安装iscsi-initiator-utils,访问共享存储服务

    2.配合客户端声称的名字 /etc/iscsi/initiatorname.iscsi

      initiatorName=iqn.2018-11.com.example:desktop0 

      

    vim /etc/iscsi/initiatorname.iscsi 
    InitiatorName=iqn.2018-11.com.example:desktop0

    3.重启服务,刷新客户端声称的名字

      systemctl restart iscsid

    systemctl restart iscsid

    4.运行命令,发现共享存储

    iscsiadm --mode discoverydb --type sendtargets --portal 172.25.0.11 --discover

    5.重启服务iscsi服务,使用共享存储

      systemctl restart iscsi

      systemctl enable iscsi 

      lsblk

  • 相关阅读:
    [原创]全新IFPGA-Cable----支持Xilinx/Altera/Lattice JTAG和UART
    [原创]Modelsim后仿真
    [原创]iFPGA-USB2.0 FT2232H USB & UART开发板使用说明
    [原创]X-HDL 4.2安装与使用
    [原创][Synth 8-2543] port connections cannot be mixed ordered and named ["*_Top.v":1151]
    [原创]..OBJgpio.axf: error: L6002U: Could not open file ..objgpio.o: No such file
    [原创]Zynq SDIO WIFI SotfAP调试
    [原创]时序图新画法
    [原创]基于Zynq SDIO WIFI 2.4G/5G SotfAP STA
    [原创]Zynq AXI-CDMA的使用
  • 原文地址:https://www.cnblogs.com/ray-mmss/p/9951453.html
Copyright © 2011-2022 走看看