• 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

  • 相关阅读:
    2017 五一 清北学堂 Day1模拟考试结题报告
    2973 枪毙
    2840 WIKIOI——评测
    解决magento保存产品时耗时很长的问题
    easyui-layout中的收缩层无法显示标题问题解决
    JAVA排序(一) Comparable接口
    C语言数据结构----栈与递归
    [置顶] SpecDD(混合的敏捷方法模型)主要过程概述
    Vim 实用技术,第 1 部分: 实用技巧(转)
    如何解决dns解析故障
  • 原文地址:https://www.cnblogs.com/ray-mmss/p/9951453.html
Copyright © 2020-2023  润新知