Els que encara estem acostumats a fer servir ifconfig per administrar els nostres dispositius de xarxa ens trobem amb una dificultat quan posem una IP virtual al pacemaker, i és que no apareix. Si fem un “ip addr” si que la veiem entre totes les IP de la màquina. Perquè si que aparegui al ifconfig nomes hem de fer servir la opcio iflabel=”etiqueta”, i podrem veure la IP, i a més amb el “ip addr” sabrem a simple vista quina es la IP de la màquina i quina es la IP assignada a cadascun dels serveis de pacemaker:
#crm configure show
(...)
primitive IP_VIRTUAL ocf:heartbeat:IPaddr2
params ip="10.0.0.11" cidr_netmask="32" iflabel="IP_VIRTUAL"
op monitor interval="3s"
meta target-role="Started"
(...)
IMPORTANT: Les etiquetes dels dispositius nomes accepten 10 caràcters. Si en posem més, el pacemaker no podrà engegar la IP virtual i fallarà (això m’ha portat maldecaps :D). Assegureu-vos de posar 10 caràcters com a molt.
Sense iflabel no apareix al ifconfig ni està etiquetada al ip addr:
# ip addr
1: lo: 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: 
    link/ether 00:50:56:9e:3c:94 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 brd 10.0.0.255 scope global eth0
    inet 10.0.0.11/32 brd 10.0.0.11 scope global eth0
    inet 10.0.0.12/32 brd 10.04.0.12 scope global eth0
    inet 10.0.0.13/32 brd 10.0.0.13 scope global eth0
    inet 10.0.0.14/32 brd 10.0.0.14 scope global eth0
    inet6 fe80::250:56ff:fe9e:3c94/64 scope link
       valid_lft forever preferred_lft forever
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:56:9E:3C:94
          inet addr:10.0.0.1  Bcast:10.10.0.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fe9e:3c94/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1825681745 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2044189443 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:576307237739 (536.7 GiB)  TX bytes:605505888813 (563.9 GiB)
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:924190306 errors:0 dropped:0 overruns:0 frame:0
          TX packets:924190306 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:415970933288 (387.4 GiB)  TX bytes:415970933288 (387.4 GiB)
En canvi, amb el iflabel, si que apareixen:
[[email protected] ~]# ip addr
1: lo: 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth1: 
    link/ether 00:50:56:9e:3c:9c brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1./24 brd 10.254.1.255 scope global eth1
    inet 10.0.0.11/32 brd 10.0.0.11 scope global eth1:nginx-ncnp
    inet 10.0.0.12/32 brd 10.0.0.12 scope global eth1:nginx-clnp
    inet 10.0.0.13/32 brd 10.0.0.13 scope global eth1:hap-ncnp
    inet 10.0.0.14/32 brd 10.254.1.14 scope global eth1:hap-clnp
    inet6 fe80::250:56ff:fe9e:3c9c/64 scope link
       valid_lft forever preferred_lft forever
[[email protected] ~]# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:50:56:9E:3C:9C
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fe9e:3c9c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:322545491 errors:0 dropped:0 overruns:0 frame:0
          TX packets:333825895 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:92667389749 (86.3 GiB)  TX bytes:93365772607 (86.9 GiB)
eth1:hap-clnp Link encap:Ethernet  HWaddr 00:50:56:9E:3C:9C
          inet addr:10.0.0.12  Bcast:10.254.1.52  Mask:255.255.255.255
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth1:hap-ncnp Link encap:Ethernet  HWaddr 00:50:56:9E:3C:9C
          inet addr:10.0.0.11  Bcast:10.254.1.51  Mask:255.255.255.255
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth1:nginx-clnp Link encap:Ethernet  HWaddr 00:50:56:9E:3C:9C
          inet addr:10.0.0.13  Bcast:10.254.1.32  Mask:255.255.255.255
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth1:nginx-ncnp Link encap:Ethernet  HWaddr 00:50:56:9E:3C:9C
          inet addr:10.0.0.14  Bcast:10.254.1.30  Mask:255.255.255.255
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4073 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4073 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1136055 (1.0 MiB)  TX bytes:1136055 (1.0 MiB)
Molt millor així 
Més informacio aqui: http://linux.die.net/man/7/ocf_heartbeat_ipaddr2
