zoukankan      html  css  js  c++  java
  • Linux:iscsi存储服务器配置

    服务器添加4块硬盘 
    mdadm -Cv /dev/md0 -n 3 -l 5 -x 1 /dev/sdb /dev/sdc /dev/sdd /dev/sde
    记下UUID值
     mdadm -D /dev/md0

     UUID : 3bf9f088:85d776c9:174cce9b:5ef065b6

    vim /etc/mdadm.conf

    DEVICE  /dev/sdb /dev/sdc /dev/sdd /dev/sde
    ARRAY   /dev/md0 UUID=3bf9f088:85d776c9:174cce9b:5ef065b6

     yum install targetd targetcli -y

      systemctl start targetd

    targetcli
      o- backstores .......................................................... [...]
      | o- block .............................................. [Storage Objects: 1]
      | o- fileio ............................................. [Storage Objects: 0]
      | o- pscsi .............................................. [Storage Objects: 0]
      | o- ramdisk ............................................ [Storage Objects: 0]
      o- iscsi ........................................................ [Targets: 0]
      o- loopback ..................................................... [Targets: 
     cd /backstores/block
    create disk0 /dev/md0
    cd /
    ls
     o- backstores .......................................................... [...]
      | o- block .............................................. [Storage Objects: 1]
      | | o- disk0 ..................... [/dev/md0 (40.0GiB) write-thru deactivated]
      | o- fileio ............................................. [Storage Objects: 0]
      | o- pscsi .............................................. [Storage Objects: 0]
      | o- ramdisk ............................................ [Storage Objects: 0]
      o- iscsi ........................................................ [Targets: 0]
      o- loopback ..................................................... [Targets: 
     
     cd iscsi
     create
     cd iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.1d335848f0e7/tpg1/luns 
    create /backstores/block/disk0 
    cd ../acls
    create iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.1d335848f0e7:client
     cd ../portals
    create 192.168.10.10
    ls /
    图片
    exit
     firewall-cmd --permanent  --add-port=3260/tcp
     firewall-cmd --reload
     客户端
    ping -c 4 192.168.10.10
    yum install iscsi-initiator-utils
    vim /etc/iscsi/initiatorname.iscsi
    InitiatorName=iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.1d335848f0e7:client
    systemctl restart iscsid
    iscsiadm -m discovery -t st -p 192.168.10.10
    iscsiadm -m node -T iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.1d335848f0e7 -p 192.168.10.10 --login
    mkfs.xfs /dev/sdb

    mkdir /iscsi
    mount /dev/sdb /iscsi
    df -h
    blkid | grep /dev/sdb
    vim /etc/fstab
    UUID=fc614f17-082f-467e-bb4e-40c5ff811d24 /iscsi xfs defaults,_netdev 0 0

  • 相关阅读:
    <q>标签,短文本引用
    使用<span>标签为文字设置单独样式
    html速查表
    禁用第三方键盘
    画虚线的方法 (记录)
    渐变色以及隐藏输入框光标
    iOS9 网络适配
    iOS 截屏/将图片存储到相册或沙盒目录下
    从任意字符串中获取所有的数字
    IOS开发
  • 原文地址:https://www.cnblogs.com/revo/p/7445081.html
Copyright © 2011-2022 走看看