Set up high availability
High availability is a term used to describe server setups that eliminate single points of failure. The following sections provide instructions for setting up multiple backend servers behind a NodeBalancer, then redirecting traffic from your Ion property to the NodeBalancer by adjusting DNS settings.
NodeBalancers communicate with backend nodes through their private IPv4 addresses via HTTP.
Before you start, ensure your origin server supports HTTP port 80.
If you created your Linodes using Node.js from the Marketplace Apps, you can watch this interactive guide for more information.
Create multiple origin servers
This section involves cloning your Linode origin server to provide high availability through redundancy.
Clustering files or databases is not in the scope of this use case. You can, however, refer to the Host a Website with High Availability guide if you want to learn more.
If you want to use a solution such as GlusterFS, instead of cloning the origin server you need to follow the instructions in Create a Linode to create two or more new Linode Compute Instances.
Log in to the Linode Cloud Manager.
Use the Linode cloning feature to create another Linode in the same region.
For instructions, refer to Cloning a Linode.
Under Select Linode to Clone From, click the Linode you created for the web server in Create a Linode.
Select the same Linode Plan option you previously selected and click Create Linode .
Add a Private IPv4 Address to the cloned Linode.
Select Power On for the cloned Linode after creation is complete.
Ensure that the web server is running on your cloned Linode.
If using the Node.js Marketplace App, LISH or SSH into the cloned Linode and start the Node.js server as a background process:
node /opt/nodejs/hello.js &
You can also rename the cloned Linode hostname to help identify it later:
hostnamectl set-hostname server2
Set up network load balancing
Linode NodeBalancers distribute user requests between compute instances to improve capacity, performance, and availability. For more information, refer to the Getting Started with NodeBalancers guide.
Before you start, make sure that each of your origin servers has a private IPv4 address. For more information and instructions on how to add private IPv4 addresses to your origin servers, refer to the Managing IP addresses guide.
Log in to the Linode Cloud Manager.
You can also refer to the Getting Started with NodeBalancers instructions to create a Linode NodeBalancer.
Navigate to the NodeBalancer page and click Create NodeBalancer.
Select the same region you selected for your backend Linode instances.
In the Port Configuration section, change Port form
Change the Protocol from
In the SSL Certificate section, paste the PEM-formatted contents of your web server SSL certificate.
If using the Node.js Marketplace App, certificate files are located in the
/etc/letsencrypt/live/domain/directory on your origin servers. Use the contents
privkey.pemwhen configuring your NodeBalancer.
Otherwise, to learn how to get an SSL certificate, refer to the Enabling HTTPS Using Certbot with NGINX guide.
In the Private Key section, paste the PEM-formatted contents of your webserver private key. Your private key cannot have a passphrase.
Select “Least Connection” for the Algorithm setting and “HTTP Cookie” for the Session Stickiness setting.
To enable Forward Secrecy for SSL/TLS connections, follow the instructions in the NodeBalancer SSL Configuration guide.
If using the Node.js Marketplace app, Diffie-Hellman parameters are located on the Linode origin server in the
/etc/letsencrypt/ssl-dhparams.pemfile by default.
In the Active Health Checks section, select the HTTP Status for the Type setting and enter a forward slash (
/) as the Check HTTP path.
Make sure all the origin servers listen to HTTP, not HTTPS, otherwise the HTTP Status option will not work.
In the Backend Nodes section, select the Enter IP Address checkbox and select the first web server.
Enter a label—for example,
Enter the HTTP port number of the web server under the Port section.
Click Add a Node, and add the second web server.
Review the configuration, and click the Create NodeBalancer button.
Make note of the IP Address of the NodeBalancer.
Redirect your Ion origin hostname DNS A record to point to your NodeBalancer IP address.
If using Linode DNS Manager, the following settings apply for the example www.test.com domain and NodeBalancer IP address of
203.0.113.2according to the choice of primary domain:
For more information on configuration options, see the TLS/SSL Termination on NodeBalancers guide.
Updated 5 months ago