Multipath
De jagfloriano.com
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
[root@icecube ~]#