@@ -36,15 +36,10 @@ the rest of the cluster stays up.
3636## Connecting between cluster Hypernodes
3737
3838All Hypernodes within the same cluster are connected to each other. You can see how the Hypernodes relate to each other in the
39- map :
39+ cluster information table by running ` hypernode-cluster-info ` :
4040
41- ![ ] ( cluster/_res/hypernode-cluster-map.png )
42-
43- You can generate this map on the fly using the CLI command ` hypernode-cluster-map ` . You can also get a detailed overview of the
44- state of the cluster using the CLI command ` hypernode-cluster-info ` :
45-
46- ``` bash
47- app@1fosk3-hnclusterweb1-magweb-hetz:~ $ hypernode-cluster-info
41+ ``` console
42+ app@abcdef-hnclusterweb1-magweb-tbbm:~ $ hypernode-cluster-info
4843+---------------+--------------------------+-------------+----------------+------------+
4944| Hypernode | Roles | Private_IP | Private_subnet | Cluster_IP |
5045+---------------+--------------------------+-------------+----------------+------------+
@@ -61,13 +56,13 @@ All nodes within the cluster can communicate with each other over their cluster
6156that are only accessible within the cluster, as they are [ Wireguard] ( https://www.wireguard.com/ ) tunnels between each Hypernode
6257in the cluster.
6358
64- ``` bash
65- app@1fosk3 -hnclusterweb1-magweb-hetz :~ $ ssh hnclusterdb1.hypernode.io hostname
66- cj8jv7 -hnclusterdb1-magweb-hetz .nodes.hypernode.io
59+ ``` console
60+ app@abcdef -hnclusterweb1-magweb-tbbm :~ $ ssh hnclusterdb1.hypernode.io hostname
61+ abcdef -hnclusterdb1-magweb-tbbm .nodes.hypernode.io
6762
68- # For convenience, you can also use the short hostname
69- app@1fosk3 -hnclusterweb1-magweb-hetz :~ $ ssh hnclusterdb1.h hostname
70- cj8jv7 -hnclusterdb1-magweb-hetz .nodes.hypernode.io
63+ For convenience, you can also use the short hostname
64+ app@abcdef -hnclusterweb1-magweb-tbbm :~ $ ssh hnclusterdb1.h hostname
65+ abcdef -hnclusterdb1-magweb-tbbm .nodes.hypernode.io
7166```
7267
7368### Private network switch
@@ -80,3 +75,41 @@ For this we provide a subnet where every Hypernode has its own private network I
8075in the same cluster and in the same datacenter/regions. Just like with Wireguard connections you can connect between Hypernodes
8176over the same private network. When available, we automatically configure the use of the private network over Wireguard
8277connections because of the larger bandwidth.
78+
79+ ## Loadbalancer setup
80+
81+ In essence, loadbalancer servers accept HTTP(S) traffic (also known as web traffic) and forward the requests to application servers.
82+ It balances the load by taking the amount of open connections for an application servers into account, selecting the server with the
83+ least connections.
84+
85+ Web traffic is terminated by NGINX, which (optionally) forwards the request to varnish, which can return a cached page or send the
86+ request to [ HAProxy] ( https://www.haproxy.org/ ) , which sends the request to the application servers.
87+
88+ ### Managing NGINX
89+
90+ To add custom NGINX rules for handling specific things on the loadbalancer (like serving assets), the ` loadbalancer. ` prefix can be
91+ used in ` /data/web/nginx ` and ` /data/web/nginx/<vhost> ` . This can be very crucial for your performance, accelerating asset delivery
92+ and lowering pressure on varnish.
93+
94+ When running ` hypernode-manage-vhosts ` ([ docs] ( nginx/hypernode-managed-vhosts.md ) ) on a loadbalancer server for a specific vhost, a
95+ preconfigured loadbalancer configuration file will be created for you (for example ` /data/web/nginx/example.com/loadbalancer.magento2.conf ` ).
96+ These preconfigured files act as a good starting point for your loadbalancer setup, but can be customized to your needs.
97+
98+ On application servers, ` /data/web/nginx ` is an NFS mount to the ` /data/web/nginx ` directory of the loadbalancer server. Because of
99+ this, changes to this directory from the application server will not trigger the nginx-config-reloader across the cluster. We advise
100+ to do most nginx changes (either configuration files or hypernode-manage-vhosts) on the loadbalancer server.
101+
102+ For consistency, nginx reload events are propagated throughout the cluster, so that an nginx reload on one server also means a reload
103+ on the other servers.
104+
105+ ### Filesystem persistence
106+
107+ Application servers behind a loadbalancer will be configured with an NFS mount to the loadbalancer. The NFS share is mounted at
108+ ` /data/shared ` on the application servers, which points to ` /data ` on the loadbalancer. For consistency, the loadbalancer itself
109+ has a symlink ` /data/shared ` , which points to ` /data ` .
110+
111+ ### Background jobs
112+
113+ While the loadbalancer server does not run PHP-FPM, it does have the PHP CLI installed, meaning that you could utilize the loadbalancer
114+ server to run background jobs like crons and queue workers. Typically, background jobs are only ran on a single server, often done on
115+ either the loadbalancer server or one of the application servers.
0 commit comments