网络存储
IDE是一种成熟稳定、价格便宜的并行传输接口。
SATA是一种传输速度更快、数据校验更完整的串行传输接口。
SCSI是一种用于计算机和硬盘、光驱等设备之间系统级接口的通用标准,具有系统资源占用率低、转速高、传输速度快等优点
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236mdadm -Cv /dev/md0 -n 3 -l 5 -x 1 /dev/sdb /dev/sdc /dev/ sdd /dev/sde mdadm: layout defaults to left-symmetric mdadm: layout defaults to left-symmetric mdadm: chunk size defaults to 512K mdadm: size set to 20954624K mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md0 started. mdadm -D /dev/md0 /dev/md0: Version : 1.2 Creation Time : Thu Sep 24 21:59:57 2017 Raid Level : raid5 Array Size : 41909248 (39.97 GiB 42.92 GB) Used Dev Size : 20954624 (19.98 GiB 21.46 GB) Raid Devices : 3 Total Devices : 4 Persistence : Superblock is persistent Update Time : Thu Sep 24 22:02:23 2017 State : clean Active Devices : 3 Working Devices : 4 Failed Devices : 0 Spare Devices : 1 Layout : left-symmetric Chunk Size : 512K Name : linuxprobe.com:0 (local to host linuxprobe.com) UUID : 3370f643:c10efd6a:44e91f2a:20c71f3e Events : 26 Number Major Minor RaidDevice State 0 8 16 0 active sync /dev/sdb 1 8 32 1 active sync /dev/sdc 4 8 48 2 active sync /dev/sdd 3 8 64 - spare /dev/sde #iSCSI服务端 yum -y install targetd targetcli Loaded plugins: langpacks, product-id, subscription-manager ………………省略部分输出信息……………… Installing: targetcli noarch 2.1.fb34-1.el7 rhel 55 k targetd noarch 0.7.1-1.el7 rhel 48 k Installing for dependencies: PyYAML x86_64 3.10-11.el7 rhel 153 k libyaml x86_64 0.1.4-10.el7 rhel 55 k lvm2-python-libs x86_64 7:2.02.105-14.el7 rhel 153 k pyparsing noarch 1.5.6-9.el7 rhel 94 k python-configshell noarch 1:1.1.fb11-3.el7 rhel 64 k python-kmod x86_64 0.9-4.el7 rhel 57 k python-rtslib noarch 2.1.fb46-1.el7 rhel 75 k python-setproctitle x86_64 1.1.6-5.el7 rhel 15 k python-urwid x86_64 1.1.1-3.el7 rhel 654 k ………………省略部分输出信息……………… Installed: targetcli.noarch 0:2.1.fb34-1.el7 targetd.noarch 0:0.7.1-1.el7 Dependency Installed: PyYAML.x86_64 0:3.10-11.el7 libyaml.x86_64 0:0.1.4-10.el7 lvm2-python-libs.x86_64 7:2.02.105-14.el7 pyparsing.noarch 0:1.5.6-9.el7 python-configshell.noarch 1:1.1.fb11-3.el7 python-kmod.x86_64 0:0.9-4.el7 python-rtslib.noarch 0:2.1.fb46-1.el7 python-setproctitle.x86_64 0:1.1.6-5.el7 python-urwid.x86_64 0:1.1.1-3.el7 Complete! systemctl start targetd systemctl enable targetd ln -s '/usr/lib/systemd/system/targetd.service' '/etc/systemd/system/multi-user.target.wants/targetd.service' 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 /> cd /backstores/block /backstores/block> create disk0 /dev/md0 Created block storage object disk0 using /dev/md0. /backstores/block> cd / /> ls o- / ................... ............................................... [...] 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: 0] /> cd iscsi /iscsi> /iscsi> create Created target iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80. Created TPG 1. /iscsi> cd iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80/ /iscsi/iqn.20....d497c356ad80> ls o- iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80 .... [TPGs: 1] o- tpg1 ............................................. [no-gen-acls, no-auth] o- acls ........................................................ [ACLs: 0] o- luns ........................................................ [LUNs: 0] o- portals .................................................. [Portals: 0] /iscsi/iqn.20....d497c356ad80> cd tpg1/luns /iscsi/iqn.20...d80/tpg1/luns> create /backstores/block/disk0 Created LUN 0. /iscsi/iqn.20...d80/tpg1/luns> cd .. /iscsi/iqn.20...c356ad80/tpg1> cd acls /iscsi/iqn.20...d80/tpg1/acls> create iqn.2003-01.org.linux-iscsi.linuxprobe. x8664:sn.d497c356ad80:client Created Node ACL for iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80: client Created mapped LUN 0. /iscsi/iqn.20...d80/tpg1/acls> cd .. /iscsi/iqn.20...c356ad80/tpg1> cd portals /iscsi/iqn.20.../tpg1/portals> create 192.168.10.10 Using default IP port 3260 Created network portal 192.168.10.10:3260. /iscsi/iqn.20.../tpg1/portals> ls / o- / ........................... [...] o- backstores................. [...] | o- block ................... [Storage Objects: 1] | | o- disk0 ................. [/dev/md0 (40.0GiB) write-thru activated] | o- fileio .................. [Storage Objects: 0] | o- pscsi ................... [Storage Objects: 0] | o- ramdisk ................. [Storage Objects: 0] o- iscsi ..................... [Targets: 1] | o- iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80 ... [TPGs: 1] | o- tpg1 .................. [no-gen-acls, no-auth] | o- acls ............................................... [ACLs: 1] | | o- iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80:client [Mapped LUNs: 1] | | o- mapped_lun0 .......................... [lun0 block/disk0 (rw)] o- luns .................... [LUNs: 1] | | o- lun0 .............. [block/disk0 (/dev/md0)] | o- portals ............. [Portals: 1] | o- 192.168.10.10:3260 [OK] o- loopback .................. [Targets: 0] /> exit Global pref auto_save_on_exit=true Last 10 configs saved in /etc/target/backup. Configuration saved to /etc/target/saveconfig.json systemctl restart targetd firewall-cmd --permanent --add-port=3260/tcp success firewall-cmd --reload success #Linux客户端 yum install iscsi-initiator-utils Loaded plugins: langpacks, product-id, subscription-manager Package iscsi-initiator-utils-6.2.0.873-21.el7.x86_64 already installed and latest version Nothing to do vim /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80:client systemctl restart iscsid systemctl enable iscsid ln -s '/usr/lib/systemd/system/iscsid.service' '/etc/systemd/system/multi-user. target.wants/iscsid.service' iscsiadm -m discovery -t st -p 192.168.10.10 192.168.10.10:3260,1 iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80 iscsiadm -m node -T iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80 -p 192.168.10.10 --login Logging in to [iface: default, target: iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80, portal: 192.168.10.10,3260] (multiple) Login to [iface: default, target: iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80, portal: 192.168.10.10,3260] successful. file /dev/sdb /dev/sdb: block special mkfs.xfs /dev/sdb log stripe unit (524288 bytes) is too large (maximum is 256KiB) log stripe unit adjusted to 32KiB meta-data=/dev/sdb isize=256 agcount=16, agsize=654720 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 data = bsize=4096 blocks=10475520, imaxpct=25 = sunit=128 swidth=256 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0 log =internal log bsize=4096 blocks=5120, version=2 = sectsz=512 sunit=8 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 mkdir /iscsi mount /dev/sdb /iscsi df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 18G 3.4G 15G 20% / devtmpfs 734M 0 734M 0% /dev tmpfs 742M 176K 742M 1% /dev/shm tmpfs 742M 8.8M 734M 2% /run tmpfs 742M 0 742M 0% /sys/fs/cgroup /dev/sr0 3.5G 3.5G 0 100% /media/cdrom /dev/sda1 497M 119M 379M 24% /boot /dev/sdb 40G 33M 40G 1% /iscsi blkid | grep /dev/sdb /dev/sdb: UUID="eb9cbf2f-fce8-413a-b770-8b0f243e8ad6" TYPE="xfs" vim /etc/fstab # # /etc/fstab # Created by anaconda on Wed May 4 19:26:23 2017 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/rhel-root / xfs defaults 1 1 UUID=812b1f7c-8b5b-43da-8c06-b9999e0fe48b /boot xfs defaults 1 2 /dev/mapper /rhel-swap swap swap defaults 0 0 /dev/cdrom /media/cdrom iso9660 defaults 0 0 UUID=eb9cbf2f-fce8-413a-b770-8b0f243e8ad6 /iscsi xfs defaults,_netdev 0 0 iscsiadm -m node -T iqn.2003-01.org.linux-iscsi.linuxprobe. x8664:sn.d497c356ad80 -u Logging out of session [sid: 7, target : iqn.2003-01.org.linux-iscsi.linuxprobe. x8664:sn.d497c356ad80, portal: 192.168.10.10,3260] Logout of [sid: 7, target: iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn. d497c356ad80,portal:192.168.10.10,3260] successful.
Copyright ©2010-2022 比特日记 All Rights Reserved.