Book Image

Raspberry Pi Networking Cookbook - Second Edition

By : Rick Golden
Book Image

Raspberry Pi Networking Cookbook - Second Edition

By: Rick Golden

Overview of this book

<p>With increasing interest in Maker Projects and the Internet of Things (IoT), students, scientists, and hobbyists are using the Raspberry Pi as a reliable, inexpensive platform to connect local devices to Internet services.</p> <p>This book begins with recipes that are essential to installing the Raspberry Pi and configuring it for network access. Then it continues with recipes on installing common networking services such as firewalls and file sharing.</p> <p>The final chapters include recipes for network monitoring, streaming data from the Raspberry Pi to IoT services, and using clusters of Raspberry Pis to store and analyze large volumes of data.</p>
Table of Contents (14 chapters)
Raspberry Pi Networking Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing a high-availability load balancer


This recipe turns four Raspberry Pis into a highly available website cluster.

Two Raspberry Pis are used as web servers sharing the load of hosting the website. The other two Raspberry Pis are load balancers and they distribute the load of the incoming web requests across the two web servers.

Only one load balancer is required to balance the load. The second is configured to replace the first, if the first load balancer should fail.

The web servers in this recipe use the Apache HTTP server to serve simple stateless websites that demonstrate load balancing in action.

The load balancers in this recipe use HA Proxy to balance web requests between the two web servers and Keepalived to create a virtual IP address for the website that will be automatically redirected to the backup load balancer, if the current load balancer fails.

After completing this recipe, you will have created a highly available website.

Getting ready

These are the ingredients for this...