Previous   Next

Creating Highly Available, Redundant Linux Systems

1

Creating Highly Available,
Redundant,
Linux Systems

Fulko Hew

Toronto Perl Mongers

Lightning Talks
September 30, 2004

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

2

The %$@(&%^)# Customer

  • We want redundant control processors.


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

2

The %$@(&%^)# Customer

  • We want redundant control processors.

  • But we only want to see one of them.


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

2

The %$@(&%^)# Customer

  • We want redundant control processors.

  • But we only want to see one of them.

  • Unless we want to see the others.

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

3

Watchdog Timer

  • If 'the application' doesn't hit the Watchdog, the processor reboots.

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

4

Boot Linux from Disk

  • Check to see if the 'important' files are there.

  • A processor isn't allowed to run if its file system isn't intact.


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

4

Boot Linux from Disk


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

4

Boot Linux from Disk

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

5

Intact File Systems ?

  • If the AFICK check determines that the 'important' files are missing or corrupted, the system re-builds itself.

  • Boot Linux from FLASH


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

5

Intact File Systems ?

  • If the AFICK check determines that the 'important' files are missing or corrupted, the system re-builds itself.

  • Boot Linux from FLASH

    • Re-build disk partitions.

    • Rsync disk from the 'master'.

    • Re-boot from disk.

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

6

What if the disk wasn't there ?


continued...

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

6

What if the disk wasn't there ?

  • Boot Linux from FLASH

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

7

Boot Linux from FLASH


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

7

Boot Linux from FLASH

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

8

What if the FLASH isn't there ?

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

9

UBOOT


continued...

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

9

UBOOT

  • Uboot runs and performs a BOOTP/DHCP request.

  • The 'master' answers with an IP address and a filename.

  • Retrieves the file (Linux-in-FLASH) and burns it into the FLASH.

  • Re-boot.


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

9

UBOOT

  • Uboot runs and performs a BOOTP/DHCP request.

  • The 'master' answers with an IP address and a filename.

  • Retrieves the file (Linux-in-FLASH) and burns it into the FLASH.

  • Re-boot.

    • Hopefully from disk... but probably from FLASH.

    • Unfortunately, its not written in Perl.

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

10

Synchronizing Disks


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

10

Synchronizing Disks


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

10

Synchronizing Disks

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

11

High Availability Daemons


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

11

High Availability Daemons


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

11

High Availability Daemons

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

12

High Availability Daemons (cont.)


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

12

High Availability Daemons (cont.)

  • Bongoyo - Simple High Availability

  • Cross platform (Perl)

  • Port checker

  • Configurable

    • pre/post takeover/release

  • Slow switchover

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

13

smphad

  • Supervisory Management Processor 'High Availability' Daemon


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

13

smphad

  • Supervisory Management Processor 'High Availability' Daemon

    • "To ensure there is 'one' processor that provides all the important facilites."


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

13

smphad

  • Supervisory Management Processor 'High Availability' Daemon

    • "To ensure there is 'one' processor that provides all the important facilites."

    • Written in Perl.


continued...
Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

13

smphad

  • Supervisory Management Processor 'High Availability' Daemon

    • "To ensure there is 'one' processor that provides all the important facilites."

    • Written in Perl.

    • Does only what 'we' need.

    • Integrated with syslog and SNMP

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

14

Masters and Slaves

  • All processors have their own IP address.

  • Slaves and 'masters' announce themselves (broadcast UDP).

  • Slaves that don't hear 'masters' try to become the 'master'.

  • Lowest IP address or highest priority becomes the 'master'.

  • If a 'master' hears another 'master' it becomes a 'slave'.

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

15

Masters and Slaves (cont.)

  • The 'master' gets another address.

  • 'Master' addresses are aliases.

  • Send a Gratuitous ARP when you become the 'master'.

  • Configuration files only exist on the 'master'.

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

16

Duties of a Master

  • To stay the 'master'.

  • BootP/DHCP daemon

  • Rsync daemon

  • Send SNMP traps when 'slaves' come or go.

  • Send SNMP trap when I become the 'master'.

  • Communicate configuration information to 'slaves'.

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

17

Duties of a Slave

  • To become a 'master'.

  • Hold off when a 'master' reboots.

  • Enable Rsync client.

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

18

Aliases

  • Adding

    $if_socket = IO::Socket::INET->new (Proto => 'udp');
    
    $if_socket->if_addr     ("eth0:1", $master_ipaddr);
    $if_socket->if_netmask  ("eth0:1", $master_netmask);
    $if_socket->if_broadcast("eth0:1", $master_bcast);
    

  • Removing

    $flags = $if_socket->if_flags ("eth0:1");           # Remove the alias I/F by clearing
    $if_socket->if_flags ("eth0:1", $flags & ~IFF_UP);  # the IFF_UP bit from its status
    

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

19

Aliases (cont.)

root@SITE_1_S_5_8:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 48:00:00:00:05:12
          inet addr:20.0.2.120  Bcast:20.63.255.255  Mask:255.192.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:990672 errors:1 dropped:0 overruns:0 frame:0
          TX packets:312456 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:1410916961 (1345.5 Mb)  TX bytes:108021725 (103.0 Mb)
          Interrupt:10 Base address:0x2000

eth0:1    Link encap:Ethernet  HWaddr 48:00:00:00:05:12
          inet addr:20.0.2.201  Bcast:20.63.255.255  Mask:255.192.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Interrupt:10 Base address:0x2000

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

20

Gratuitous ARP

use Net::GARP;

Net::GARP::send_garp("eth0:1");

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

21

BootStrap Sequencing

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous   Next

Creating Highly Available, Redundant Linux Systems

22

Thank You

Index

Copyright © 2004, Fulko Hew

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table of Contents

1. Creating Highly Available,
Redundant,
Linux Systems

2. The %$@(&%^)# Customer
3. Watchdog Timer
4. Boot Linux from Disk
5. Intact File Systems ?
6. What if the disk wasn't there ?
7. Boot Linux from FLASH
8. What if the FLASH isn't there ?
9. UBOOT
10. Synchronizing Disks
11. High Availability Daemons
12. High Availability Daemons (cont.)
13. smphad
14. Masters and Slaves
15. Masters and Slaves (cont.)
16. Duties of a Master
17. Duties of a Slave
18. Aliases
19. Aliases (cont.)
20. Gratuitous ARP
21. BootStrap Sequencing
22. Thank You