SlideShare a Scribd company logo
Relayd: a load-balancer for OpenBSD

            Giovanni Bechis
        giovanni@openbsd.org




      University of Applied Sciences,
             Vienna, Austria
               May 5, 2012
what is relayd useful for ?




       Reverse proxy
       Ssl accelerated reverse proxy
       Transparent proxy with filtering capabilities
       Application redirector
       Load balancer
       Wan link balancer
a short story




       First imported in OpenBSD 4.1
       Initially it was called hoststated(8)
       Renamed to relayd(8) in OpenBSD 4.3
       Written by pyr@ and reyk@
some relayd(8) features




      written with security in mind and based on imsg framework
      ipv4 and ipv6 capable
      carp(4) capable
      snmpd(8) integration
software anatomy




   Relayd is divided in a main process and 3 different engines
       Parent process
       HCE: Host check engine
       PFE: Pf engine
       Relay engine
the parent process



   The parent process is the only one that runs with elevated
   privileges, it runs as ’root’ to be able to handle:
       configuration files
       setup sockets
       external script execution (privileges will be dropped to relayd
       user before ”execlp” function call)
       carp demotion requests
host check engine



   The Host Check Engine uses some methods to verify that the
   target host service is functional, before routing traffic to the host.
   It can use:
       icmp
       tcp
       ssl
       http/https
       external scripts
pf engine




   The Packet Filter Engine allows integration with the OpenBSD
   Packet Filter.
       Creates and destroys PF rules
       Updates PF tables based on HCE notifications
relay engine




   This engine is responsible to filter and relay packets
       Creates listening sockets for services
       Filters protocols before relaying
reverse http proxy
reverse http proxy


   table <web_hosts> { 10.0.0.1 }

   interval 10
   timeout 200
   prefork 5
   log updates

   relay httpproxy {
      listen on 192.168.0.1 port 80

       forward to <web_hosts> port 80 check http "/" code 200
   }
reverse http proxy


   A script can be used to check the web server status


   table <web_hosts> { 10.0.0.1 }

   relay httpproxy {
      listen on 192.168.0.1 port 80

       forward to <web_hosts> port 80 
          check script "/scripts/chkweb.pl"
   }
relayd(8) check scripts
   A script can be used to check the web server status ... or
   everything else
   #!/usr/bin/perl -w

   use Socket;

   my $remote = $ARGV[0];
   my $proto = getprotobyname(’tcp’);
   socket(Socket_Handle, PF_INET, SOCK_STREAM, $proto);
   my $hport = 80; # Http port
   my $sin = sockaddr_in($hport,inet_aton("$remote"));
   if (connect(Socket_Handle,$sin)) {
    socket(Socket_Handle, PF_INET, SOCK_STREAM, $proto);
    my $mport = 11211; # Memcached port
    $sin = sockaddr_in($mport,inet_aton("$remote"));
    if (connect(Socket_Handle,$sin)) {
     exit 1;
    } else {
     exit 0;
    }
http filters




   Relayd in ”reverse proxy” configuration can filter http requests
       Change or append http headers
       Filter http requests by checking http headers
       Filter http requests by checking url
http filters

   http protocol "httpfilter" {

       # Return HTML error pages
       return error

       # allow logging of remote client ips to internal web servers
       header append "$REMOTE_ADDR" to "X-Forwarded-For"

       # URL filtering
       request path filter "articleid=*select*" 
          from "/module/article/article/article.asp"

       # close connections upon receipt
       header change "Connection" to "close"
   }
http filters
ssl accelerated reverse http proxy
ssl accelerated reverse http proxy

   table <web_hosts> { 10.0.0.1 }

   http protocol "httpfilter" {

       # close connections upon receipt
       header change "Connection" to "close"
       # SSL accelerator ciphers
       ssl { sslv3, tlsv1, ciphers "HIGH:!ADH", no sslv2 }
   }

   relay httpproxy {
      listen on 192.168.0.1 port 443 ssl
      protocol "httpfilter"
      forward to <web_hosts> port 80 check http "/" code 200
   }
ssl accelerated reverse http proxy

   Rsa certificate generation


   openssl genrsa -out /etc/ssl/private/192.168.0.1:443.key 1024
   openssl req -new -key /etc/ssl/private/192.168.0.1:443.key 
      -out /etc/ssl/private/192.168.0.1:443.csr

   openssl x509 -req -days 365 
      -in /etc/ssl/private/192.168.0.1:443.csr 
      -signkey /etc/ssl/private/192.168.0.1:443.key 
      -out /etc/ssl/192.168.0.1:443.crt


   With the files 192.168.0.1:443.crt and 192.168.0.1:443.key in the
   right place relayd will do his job
transparent http proxy
transparent http proxy, relayd setup

   http protocol "httpfilter" {
      # Return HTML error pages
      return error

       header change "Connection" to "close"

       # Block requests to unwanted hosts
       request header filter "*youtube.com*" from "Host"
       request header filter "*facebook.com*" from "Host"
   }

   relay httpproxy {
      listen on 127.0.0.1 port 8080
      protocol "httpfilter"
      forward to destination
   }
application redirector
application redirector, relayd setup




   table <srv> { 192.168.0.1, 192.168.0.2 }

   redirect mysql {
           listen on 192.168.3.1 port 3306
           tag RELAYD
           sticky-address
           forward to <srv> port 3306 mode roundrobin check tcp
   }
load balancer
load balancer


   dns protocol "dnsfilter" {
      tcp { nodelay, sack, socket buffer 1024, backlog 1000 }
   }

   relay dnsproxy {
         listen on 127.0.0.1 port 8053

        protocol "dnsfilter"

        forward to <dns_servers> port 53 
                  mode loadbalance check tcp
   }
relayctl(8)




       relayctl is the software used to control relayd
       It can change many configurations at runtime
       It can be used to show many informations about our current
       relayd(8) setup
relayctl(8)
   Some info for our ”relay” setup


   $ sudo relayctl show sessions
   session 0:1 192.168.107.205:44159 -> :80        RUNNING
           age 00:00:01, idle 00:00:01, relay 1, pid 5613
   $ sudo relayctl show hosts
   Id      Type     Name                   Avlblty Status
   1       table    web_hosts:80                   active (3 hosts)
   1       host     10.0.0.1                       100.00% up
                    total: 12/12 checks
   2       host     10.10.10.22                    100.00% up
                    total: 12/12 checks
   3       host     10.10.10.33                    100.00% up
                    total: 12/12 checks
relayctl(8)


   Some info for our ”redirect” setup


   $ sudo relayctl show summary
   Id      Type            Name          Avlblty Status
   1       redirect        mysql                 active
   1       table           srv:3306              active (1 hosts)
   1       host            192.168.1.3           100.00% up
   2       host            192.168.1.4           0.00%   down
relayctl(8)


   Pf interaction


   $ sudo pfctl -a relayd/mysql -s rules
   pass in quick on rdomain 0 inet proto tcp from any 
      to 192.168.1.5 port = 3306 flags S/SA 
      keep state (tcp.established 600) 
      tag RELAYD rdr-to <mysql> port 3306 
      round-robin sticky-address
advanced monitoring
   Both Munin and Nagios have plugins to check relayd health status
questions ?

More Related Content

What's hot (20)

DOCX
Lab view the switch mac address table lab - view the switch
ADDY50
 
PPTX
Unicast multicast & broadcast
NetProtocol Xpert
 
PPT
Ccna day3
AHMED NADIM JILANI
 
PPT
Repeaters.51
myrajendra
 
PPTX
Router
Then Murugeshwari
 
PPT
Dynamic Routing RIP
Kishore Kumar
 
PDF
CCNA CheatSheet
Eng. Emad Al-Atoum
 
DOC
HP-UX RBAC Audsys Setup by Dusan Baljevic
Circling Cycle
 
PPTX
Juniper Srx quickstart-12.1r3
Mohamed Al-Natour
 
PDF
6.5.1.3 packet tracer layer 2 vlan security instructor
Salem Trabelsi
 
PDF
Ericsson BTS commisioning
Shahid Rasool
 
PPTX
Ospf multiárea para o CCNA
Vitor Albuquerque
 
PPT
Aikuisten mehiläisten taudit
Suomen Mehiläishoitajain Liitto
 
PDF
امنیت شبکه
arichoana
 
PPT
L2 tp
Ramya Chowdary
 
PDF
Open IoT Made Easy - Introduction to OGC SensorThings API
SensorUp
 
PPTX
VXLAN
SAliyev1
 
PPTX
JUNOS: OSPF and BGP
Zenith Networks
 
PPT
Dqdb & Fddi
Ram Dutt Shukla
 
DOCX
Stacking cisco 3750 switches benefits & stacking rules
IT Tech
 
Lab view the switch mac address table lab - view the switch
ADDY50
 
Unicast multicast & broadcast
NetProtocol Xpert
 
Repeaters.51
myrajendra
 
Dynamic Routing RIP
Kishore Kumar
 
CCNA CheatSheet
Eng. Emad Al-Atoum
 
HP-UX RBAC Audsys Setup by Dusan Baljevic
Circling Cycle
 
Juniper Srx quickstart-12.1r3
Mohamed Al-Natour
 
6.5.1.3 packet tracer layer 2 vlan security instructor
Salem Trabelsi
 
Ericsson BTS commisioning
Shahid Rasool
 
Ospf multiárea para o CCNA
Vitor Albuquerque
 
Aikuisten mehiläisten taudit
Suomen Mehiläishoitajain Liitto
 
امنیت شبکه
arichoana
 
Open IoT Made Easy - Introduction to OGC SensorThings API
SensorUp
 
VXLAN
SAliyev1
 
JUNOS: OSPF and BGP
Zenith Networks
 
Dqdb & Fddi
Ram Dutt Shukla
 
Stacking cisco 3750 switches benefits & stacking rules
IT Tech
 

Similar to Relayd: a load balancer for OpenBSD (20)

PDF
Server Load Balancing on pfSense 2.4 - pfSense Hangout July 2017
Netgate
 
KEY
Apache httpd 2.4 Reverse Proxy
Jim Jagielski
 
PDF
Apache HTTPD 2.4 Reverse Proxy: The Hidden Gem
Jim Jagielski
 
PDF
Apache httpd 2.4 Reverse Proxy: The Hidden Gem
Jim Jagielski
 
PDF
ApacheConNA 2015: Apache httpd 2.4 Reverse Proxy
Jim Jagielski
 
PDF
Alternative Infrastucture
Marc Seeger
 
PDF
haproxy_Load_Balancer.pdf
crezzcrezz
 
PPTX
haproxy_Load_Balancer.pptx
crezzcrezz
 
PDF
Scalable Architecture 101
ConFoo
 
PDF
Using aphace-as-proxy-server
HARRY CHAN PUTRA
 
PDF
Apache httpd Reverse Proxy and Tomcat
Jim Jagielski
 
PDF
DDoS: Practical Survival Guide
HLL
 
ODT
Load Balancing with HAproxy
Brendan Jennings
 
PDF
Acus08 Advanced Load Balancing Apache2.2
Jim Jagielski
 
PPT
Proxy servers
Kumar
 
PDF
MySQL Load Balancers - MaxScale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
Severalnines
 
PPTX
DDoS: practical survival
Positive Hack Days
 
PDF
Pushing a camel through the eye of a needle
SensePost
 
PPT
Apache web server installation/configuration, Virtual Hosting
webhostingguy
 
PPT
Networking Concepts and Tools for the Cloud
Alex Amies
 
Server Load Balancing on pfSense 2.4 - pfSense Hangout July 2017
Netgate
 
Apache httpd 2.4 Reverse Proxy
Jim Jagielski
 
Apache HTTPD 2.4 Reverse Proxy: The Hidden Gem
Jim Jagielski
 
Apache httpd 2.4 Reverse Proxy: The Hidden Gem
Jim Jagielski
 
ApacheConNA 2015: Apache httpd 2.4 Reverse Proxy
Jim Jagielski
 
Alternative Infrastucture
Marc Seeger
 
haproxy_Load_Balancer.pdf
crezzcrezz
 
haproxy_Load_Balancer.pptx
crezzcrezz
 
Scalable Architecture 101
ConFoo
 
Using aphace-as-proxy-server
HARRY CHAN PUTRA
 
Apache httpd Reverse Proxy and Tomcat
Jim Jagielski
 
DDoS: Practical Survival Guide
HLL
 
Load Balancing with HAproxy
Brendan Jennings
 
Acus08 Advanced Load Balancing Apache2.2
Jim Jagielski
 
Proxy servers
Kumar
 
MySQL Load Balancers - MaxScale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
Severalnines
 
DDoS: practical survival
Positive Hack Days
 
Pushing a camel through the eye of a needle
SensePost
 
Apache web server installation/configuration, Virtual Hosting
webhostingguy
 
Networking Concepts and Tools for the Cloud
Alex Amies
 
Ad

More from Giovanni Bechis (20)

PDF
the Apache way
Giovanni Bechis
 
PDF
SpamAssassin 4.0 new features
Giovanni Bechis
 
PDF
ACME and mod_md: tls certificates made easy
Giovanni Bechis
 
PDF
Scaling antispam solutions with Puppet
Giovanni Bechis
 
PDF
What's new in SpamAssassin 3.4.3
Giovanni Bechis
 
PDF
Fighting Spam for fun and profit
Giovanni Bechis
 
PDF
Linux seccomp(2) vs OpenBSD pledge(2)
Giovanni Bechis
 
PDF
Pledge in OpenBSD
Giovanni Bechis
 
PDF
Pf: the OpenBSD packet filter
Giovanni Bechis
 
PDF
ELK: a log management framework
Giovanni Bechis
 
PDF
OpenSSH: keep your secrets safe
Giovanni Bechis
 
PDF
OpenSMTPD: we deliver !!
Giovanni Bechis
 
PDF
LibreSSL, one year later
Giovanni Bechis
 
PDF
LibreSSL
Giovanni Bechis
 
PDF
SOGo: sostituire Microsoft Exchange con software Open Source
Giovanni Bechis
 
PDF
Cloud storage, i tuoi files, ovunque con te
Giovanni Bechis
 
PDF
Npppd: easy vpn with OpenBSD
Giovanni Bechis
 
PDF
Openssh: comunicare in sicurezza
Giovanni Bechis
 
PDF
Ipv6: il futuro di internet
Giovanni Bechis
 
PDF
L'ABC della crittografia
Giovanni Bechis
 
the Apache way
Giovanni Bechis
 
SpamAssassin 4.0 new features
Giovanni Bechis
 
ACME and mod_md: tls certificates made easy
Giovanni Bechis
 
Scaling antispam solutions with Puppet
Giovanni Bechis
 
What's new in SpamAssassin 3.4.3
Giovanni Bechis
 
Fighting Spam for fun and profit
Giovanni Bechis
 
Linux seccomp(2) vs OpenBSD pledge(2)
Giovanni Bechis
 
Pledge in OpenBSD
Giovanni Bechis
 
Pf: the OpenBSD packet filter
Giovanni Bechis
 
ELK: a log management framework
Giovanni Bechis
 
OpenSSH: keep your secrets safe
Giovanni Bechis
 
OpenSMTPD: we deliver !!
Giovanni Bechis
 
LibreSSL, one year later
Giovanni Bechis
 
LibreSSL
Giovanni Bechis
 
SOGo: sostituire Microsoft Exchange con software Open Source
Giovanni Bechis
 
Cloud storage, i tuoi files, ovunque con te
Giovanni Bechis
 
Npppd: easy vpn with OpenBSD
Giovanni Bechis
 
Openssh: comunicare in sicurezza
Giovanni Bechis
 
Ipv6: il futuro di internet
Giovanni Bechis
 
L'ABC della crittografia
Giovanni Bechis
 
Ad

Recently uploaded (20)

PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 

Relayd: a load balancer for OpenBSD

  • 1. Relayd: a load-balancer for OpenBSD Giovanni Bechis [email protected] University of Applied Sciences, Vienna, Austria May 5, 2012
  • 2. what is relayd useful for ? Reverse proxy Ssl accelerated reverse proxy Transparent proxy with filtering capabilities Application redirector Load balancer Wan link balancer
  • 3. a short story First imported in OpenBSD 4.1 Initially it was called hoststated(8) Renamed to relayd(8) in OpenBSD 4.3 Written by pyr@ and reyk@
  • 4. some relayd(8) features written with security in mind and based on imsg framework ipv4 and ipv6 capable carp(4) capable snmpd(8) integration
  • 5. software anatomy Relayd is divided in a main process and 3 different engines Parent process HCE: Host check engine PFE: Pf engine Relay engine
  • 6. the parent process The parent process is the only one that runs with elevated privileges, it runs as ’root’ to be able to handle: configuration files setup sockets external script execution (privileges will be dropped to relayd user before ”execlp” function call) carp demotion requests
  • 7. host check engine The Host Check Engine uses some methods to verify that the target host service is functional, before routing traffic to the host. It can use: icmp tcp ssl http/https external scripts
  • 8. pf engine The Packet Filter Engine allows integration with the OpenBSD Packet Filter. Creates and destroys PF rules Updates PF tables based on HCE notifications
  • 9. relay engine This engine is responsible to filter and relay packets Creates listening sockets for services Filters protocols before relaying
  • 11. reverse http proxy table <web_hosts> { 10.0.0.1 } interval 10 timeout 200 prefork 5 log updates relay httpproxy { listen on 192.168.0.1 port 80 forward to <web_hosts> port 80 check http "/" code 200 }
  • 12. reverse http proxy A script can be used to check the web server status table <web_hosts> { 10.0.0.1 } relay httpproxy { listen on 192.168.0.1 port 80 forward to <web_hosts> port 80 check script "/scripts/chkweb.pl" }
  • 13. relayd(8) check scripts A script can be used to check the web server status ... or everything else #!/usr/bin/perl -w use Socket; my $remote = $ARGV[0]; my $proto = getprotobyname(’tcp’); socket(Socket_Handle, PF_INET, SOCK_STREAM, $proto); my $hport = 80; # Http port my $sin = sockaddr_in($hport,inet_aton("$remote")); if (connect(Socket_Handle,$sin)) { socket(Socket_Handle, PF_INET, SOCK_STREAM, $proto); my $mport = 11211; # Memcached port $sin = sockaddr_in($mport,inet_aton("$remote")); if (connect(Socket_Handle,$sin)) { exit 1; } else { exit 0; }
  • 14. http filters Relayd in ”reverse proxy” configuration can filter http requests Change or append http headers Filter http requests by checking http headers Filter http requests by checking url
  • 15. http filters http protocol "httpfilter" { # Return HTML error pages return error # allow logging of remote client ips to internal web servers header append "$REMOTE_ADDR" to "X-Forwarded-For" # URL filtering request path filter "articleid=*select*" from "/module/article/article/article.asp" # close connections upon receipt header change "Connection" to "close" }
  • 18. ssl accelerated reverse http proxy table <web_hosts> { 10.0.0.1 } http protocol "httpfilter" { # close connections upon receipt header change "Connection" to "close" # SSL accelerator ciphers ssl { sslv3, tlsv1, ciphers "HIGH:!ADH", no sslv2 } } relay httpproxy { listen on 192.168.0.1 port 443 ssl protocol "httpfilter" forward to <web_hosts> port 80 check http "/" code 200 }
  • 19. ssl accelerated reverse http proxy Rsa certificate generation openssl genrsa -out /etc/ssl/private/192.168.0.1:443.key 1024 openssl req -new -key /etc/ssl/private/192.168.0.1:443.key -out /etc/ssl/private/192.168.0.1:443.csr openssl x509 -req -days 365 -in /etc/ssl/private/192.168.0.1:443.csr -signkey /etc/ssl/private/192.168.0.1:443.key -out /etc/ssl/192.168.0.1:443.crt With the files 192.168.0.1:443.crt and 192.168.0.1:443.key in the right place relayd will do his job
  • 21. transparent http proxy, relayd setup http protocol "httpfilter" { # Return HTML error pages return error header change "Connection" to "close" # Block requests to unwanted hosts request header filter "*youtube.com*" from "Host" request header filter "*facebook.com*" from "Host" } relay httpproxy { listen on 127.0.0.1 port 8080 protocol "httpfilter" forward to destination }
  • 23. application redirector, relayd setup table <srv> { 192.168.0.1, 192.168.0.2 } redirect mysql { listen on 192.168.3.1 port 3306 tag RELAYD sticky-address forward to <srv> port 3306 mode roundrobin check tcp }
  • 25. load balancer dns protocol "dnsfilter" { tcp { nodelay, sack, socket buffer 1024, backlog 1000 } } relay dnsproxy { listen on 127.0.0.1 port 8053 protocol "dnsfilter" forward to <dns_servers> port 53 mode loadbalance check tcp }
  • 26. relayctl(8) relayctl is the software used to control relayd It can change many configurations at runtime It can be used to show many informations about our current relayd(8) setup
  • 27. relayctl(8) Some info for our ”relay” setup $ sudo relayctl show sessions session 0:1 192.168.107.205:44159 -> :80 RUNNING age 00:00:01, idle 00:00:01, relay 1, pid 5613 $ sudo relayctl show hosts Id Type Name Avlblty Status 1 table web_hosts:80 active (3 hosts) 1 host 10.0.0.1 100.00% up total: 12/12 checks 2 host 10.10.10.22 100.00% up total: 12/12 checks 3 host 10.10.10.33 100.00% up total: 12/12 checks
  • 28. relayctl(8) Some info for our ”redirect” setup $ sudo relayctl show summary Id Type Name Avlblty Status 1 redirect mysql active 1 table srv:3306 active (1 hosts) 1 host 192.168.1.3 100.00% up 2 host 192.168.1.4 0.00% down
  • 29. relayctl(8) Pf interaction $ sudo pfctl -a relayd/mysql -s rules pass in quick on rdomain 0 inet proto tcp from any to 192.168.1.5 port = 3306 flags S/SA keep state (tcp.established 600) tag RELAYD rdr-to <mysql> port 3306 round-robin sticky-address
  • 30. advanced monitoring Both Munin and Nagios have plugins to check relayd health status