Diferencia entre revisiones de «Multipath»

De jagfloriano.com
Ir a la navegaciónIr a la búsqueda
Línea 119: Línea 119:
   lv_storage vg_iscsi    -wi-ao----  39.99g
   lv_storage vg_iscsi    -wi-ao----  39.99g
   lv_mp_data vg_multipath -wi-a----- <10.00g
   lv_mp_data vg_multipath -wi-a----- <10.00g
[root@icecube ~]#
</syntaxhighlight>
</syntaxhighlight>


== Configurar las Luns ==
== Configurar las Luns ==

Revisión del 13:16 3 ene 2026

Configurar Multipath

Introducción

Continuando con anteriores LABs vamos a implementar Multipath, sobre iSCSI en el Pacemaker que configuramos aqui Pacemaker .

Aunque el orden correcto para montar esta infraestructura deberia ser la siguiente, vamos a implementar el Multipath ahora para mejorar la capa HA.

  • iSCSI
  • multipath
  • LVM
  • filesystem
  • cluster (si aplica)

Requisitos Previos

Configuración de red

Para usar multipath se necesita que las LUNs venga por varios Paths, por tanto es imprescindible tener dos IP en el iSCSI target:

[root@icecube network-scripts]# nmcli
enp0s3: connected to enp0s3
        "Intel 82540EM"
        ethernet (e1000), 08:00:27:F3:3C:51, hw, mtu 1500
        ip4 default
        inet4 192.168.1.80/24
        route4 192.168.1.0/24 metric 100
        route4 default via 192.168.1.1 metric 100
        inet6 fe80::a00:27ff:fef3:3c51/64
        route6 fe80::/64 metric 1024

lo: connected (externally) to lo
        "lo"
        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536
        inet4 127.0.0.1/8
        inet6 ::1/128
        route6 ::1/128 metric 256

DNS configuration:
        servers: 8.8.8.8
        interface: enp0s3

Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.

Consult nmcli(1) and nmcli-examples(7) manual pages for complete usage details.
[root@icecube network-scripts]# nmcli -f NAME,DEVICE con show --active
NAME    DEVICE
enp0s3  enp0s3
lo      lo
[root@icecube network-scripts]# nmcli con mod enp0s3 +ipv4.addresses 192.168.1.79/24
[root@icecube network-scripts]# nmcli device reapply enp0s3
Connection successfully reapplied to device 'enp0s3'.
[root@icecube network-scripts]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:f3:3c:51 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.80/24 brd 192.168.1.255 scope global noprefixroute enp0s3
       valid_lft forever preferred_lft forever
    inet 192.168.1.79/24 brd 192.168.1.255 scope global secondary noprefixroute enp0s3
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fef3:3c51/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
[root@icecube network-scripts]#

Almacenamiento

Se ha añadido un disco de 10G virtual en el servidor para poder crear un LV que será añadido al iSCSI.

[root@icecube ~]# lsblk
NAME                  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda                     8:0    0   20G  0 disk
├─sda1                  8:1    0    1G  0 part /boot
└─sda2                  8:2    0   19G  0 part
  ├─rhel-root         253:0    0   17G  0 lvm  /
  └─rhel-swap         253:1    0    2G  0 lvm  [SWAP]
sdb                     8:16   0   20G  0 disk
└─vg_iscsi-lv_storage 253:2    0   40G  0 lvm
sdc                     8:32   0   20G  0 disk
└─vg_iscsi-lv_storage 253:2    0   40G  0 lvm
sdd                     8:48   0   10G  0 disk
sr0                    11:0    1 1024M  0 rom
[root@icecube ~]# vgcreate vg_multipath /dev/sdd
  Physical volume "/dev/sdd" successfully created.
  Volume group "vg_multipath" successfully created
[root@icecube ~]# lvcreate -n lv_mp_data -l 100%FREE vg_multipath
  Logical volume "lv_mp_data" created.
[root@icecube ~]# lvs
  LV         VG           Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root       rhel         -wi-ao---- <17.00g
  swap       rhel         -wi-ao----   2.00g
  lv_storage vg_iscsi     -wi-ao----  39.99g
  lv_mp_data vg_multipath -wi-a----- <10.00g

Configurar las Luns

Configuración actual despues del LAB iSCSI y Pacemaker.

[root@icecube ~]# targetcli ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- block .................................................................................................. [Storage Objects: 1]
  | | o- lun01 ........................................................... [/dev/vg_iscsi/lv_storage (40.0GiB) write-thru activated]
  | |   o- alua ................................................................................................... [ALUA Groups: 1]
  | |     o- default_tg_pt_gp ....................................................................... [ALUA state: Active/optimized]
  | o- fileio ................................................................................................. [Storage Objects: 0]
  | o- pscsi .................................................................................................. [Storage Objects: 0]
  | o- ramdisk ................................................................................................ [Storage Objects: 0]
  o- iscsi ............................................................................................................ [Targets: 1]
  | o- iqn.2026-01.icecube:storage.target01 .............................................................................. [TPGs: 1]
  |   o- tpg1 .......................................................................................... [no-gen-acls, auth per-acl]
  |     o- acls .......................................................................................................... [ACLs: 1]
  |     | o- iqn.2026-01.icecube:node01.initiator01 ................................................... [1-way auth, Mapped LUNs: 1]
  |     |   o- mapped_lun0 ................................................................................. [lun0 block/lun01 (rw)]
  |     o- luns .......................................................................................................... [LUNs: 1]
  |     | o- lun0 ...................................................... [block/lun01 (/dev/vg_iscsi/lv_storage) (default_tg_pt_gp)]
  |     o- portals .................................................................................................... [Portals: 1]
  |       o- 0.0.0.0:3260 ..................................................................................................... [OK]
  o- loopback ......................................................................................................... [Targets: 0]
[root@icecube ~]# targetcli
targetcli shell version 2.1.57
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/iscsi/iqn.20...target01/tpg1> /backstores/block create lun_mp /dev/vg_multipath/lv_mp_data
Created block storage object lun_mp using /dev/vg_multipath/lv_mp_data.
/iscsi/iqn.20...target01/tpg1> ls /backstores/block
o- block ...................................................................................................... [Storage Objects: 2]
  o- lun01 ............................................................... [/dev/vg_iscsi/lv_storage (40.0GiB) write-thru activated]
  | o- alua ....................................................................................................... [ALUA Groups: 1]
  |   o- default_tg_pt_gp ........................................................................... [ALUA state: Active/optimized]
  o- lun_mp ........................................................ [/dev/vg_multipath/lv_mp_data (10.0GiB) write-thru deactivated]
    o- alua ....................................................................................................... [ALUA Groups: 1]
      o- default_tg_pt_gp ........................................................................... [ALUA state: Active/optimized]
/iscsi/iqn.20...target01/tpg1> /iscsi/iqn.2026-01.icecube:storage.target01/tpg1/luns create /backstores/block/lun_mp
Created LUN 1.
Created LUN 1->1 mapping in node ACL iqn.2026-01.icecube:node01.initiator01
/iscsi/iqn.20...target01/tpg1> ls /iscsi/iqn.2026-01.icecube:storage.target01/tpg1/luns
o- luns .................................................................................................................. [LUNs: 2]
  o- lun0 .............................................................. [block/lun01 (/dev/vg_iscsi/lv_storage) (default_tg_pt_gp)]
  o- lun1 ......................................................... [block/lun_mp (/dev/vg_multipath/lv_mp_data) (default_tg_pt_gp)]
/iscsi/iqn.20...target01/tpg1> ls /iscsi/iqn.2026-01.icecube:storage.target01/tpg1/portals
o- portals ............................................................................................................ [Portals: 1]
  o- 0.0.0.0:3260 ............................................................................................................. [OK]
/iscsi/iqn.20...target01/tpg1> /iscsi/iqn.2026-01.icecube:storage.target01/tpg1/portals delete 0.0.0.0 3260
Deleted network portal 0.0.0.0:3260
/iscsi/iqn.20...target01/tpg1> /iscsi/iqn.2026-01.icecube:storage.target01/tpg1/portals create 192.168.1.80 3260
Using default IP port 3260
Created network portal 192.168.1.80:3260.
/iscsi/iqn.20...target01/tpg1> /iscsi/iqn.2026-01.icecube:storage.target01/tpg1/portals create 192.168.1.79 3260
Using default IP port 3260
Created network portal 192.168.1.79:3260.
/iscsi/iqn.20...target01/tpg1> ls /iscsi/iqn.2026-01.icecube:storage.target01/tpg1/portals
o- portals ............................................................................................................ [Portals: 2]
  o- 192.168.1.79:3260 ........................................................................................................ [OK]
  o- 192.168.1.80:3260 ........................................................................................................ [OK]
/iscsi/iqn.20...target01/tpg1>
/iscsi/iqn.20...target01/tpg1> exit
Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup/.
Configuration saved to /etc/target/saveconfig.json
[root@icecube network-scripts]#

Configurar Clientes

Fixes