symBalancers Quick Start ======================== This document will cover the most basic setup of a symBalancer load balancer. The intended audience is those who have never setup a symBalancer before. We will create a new symBalancer, and configure it to distribute traffic to two basic webservers over plain HTTP. We will then test the configuration to confirm it is working as it should. What is a load balancer? ------------------------ Load balancers are frontend server "appliances" that distribute requests to "backend servers" (slices) behind them. This allows websites to scale beyond a single server, as requests are distributed evenly by the balancer across any number of backend servers. Load balancers also perform *health checks* on the backend servers, and will automatically stop sending them traffic when they are not responding properly. This in turn, provides *high availability*: if a backend server has issues, the other servers can pick up the load, thus avoiding downtime. High availability also means that backend servers can be seamlessly added and removed to scale according to demand, or to do maintenance and upgrades without any downtime. Although balancers are most often used with websites (HTTP and HTTPS), they can also forward raw TCP connections to support other protocols. The most basic setup of a symBalancer is very simple: Create symBalancer ------------------ 1. Login to the Syminet Cloud Panel at https://cloud.syminet.com 2. Click "symBalancers" in the left main menu. 3. Click :guilabel:`Create symBalancer` 4. Enter "balancer1.example.com" as Hostname, and click :guilabel:`Create` .. Note:: You are free to name your symBalancer anything you like, but typically the symBalancer name is the hostname of the website /service that is serving (via the backend webservers behind it). Your symBalancer will take a few minutes to build, typically around 5 minutes or so. You can reload the page to check status. If it does not turn green after 10 minutes, please let us know by issuing a support ticket (click "Support" in the left Main Menu or email support@syminet.com) Create Backend Servers ---------------------- We will create two webservers which will be added to the the load balancer: 1. Create a debian slice: - Name it **web1** - Be sure to include a **Private IP** 2. SSH into your slice and install nginx: .. code-block:: shell apt install nginx 4. Create a tiny default webpage returning it's servername: .. code-block:: shell echo "web ONE" > /var/www/index.html Now create **web2**, nearly identical setup: 1. Create a debian slice: - Name it **web2** - Be sure to include a **Private IP** 2. SSH into your slice and install nginx: .. code-block:: shell apt install nginx 4. Create a tiny default webpage returning it's servername: .. code-block:: shell echo "web TWO" > /var/www/index.html Connect Backend Servers ----------------------- Now that the webservers are ready, you can connect them to your symBalancer: 1. Click "symBalancers" in the left main menu. 2. Click your symBalancer to open the symBalancer Details. 3. Click :guilabel:`Add server`: - Select **web1** - Click :guilabel:`Add` Slice **web1** should appear in the Backend Servers list with a green background. Repeat above, adding slice **web2**. You should now have a balancer with two active webservers behind it. Testing the Setup ----------------- You should be able to open a web browser and do a plain unencrypted HTTP request to the public IP address of your balancer. If you reload, you should see responses iterate between the two backend webservers: "web ONE", "web TWO"... In some browsers ``CTRL+R`` isn't enough; you might have to do ``SHIFT+CTRL+R`` to make it bypass the cache. You can also test with ``curl`` or ``wget``, etc. The next step would be to check out the symBalancer documentation, which can be found here: https://docs.syminet.com/slice/symbalancers Happy Balancing!