vault backup: 2024-12-12 19:30:24
This commit is contained in:
25
.obsidian/workspace.json
vendored
25
.obsidian/workspace.json
vendored
@@ -13,12 +13,12 @@
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "WORK & PROJECTS/Mol/Ideas/ФСА - справочник показателей.md",
|
||||
"file": "WORK & PROJECTS/Mol/Серверы/DOCS/Load Balancer 2.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "ФСА - справочник показателей"
|
||||
"title": "Load Balancer 2"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -174,27 +174,34 @@
|
||||
"obsidian-git:Open Git source control": false
|
||||
}
|
||||
},
|
||||
"active": "221c41e61c302338",
|
||||
"active": "09819c3b868a102a",
|
||||
"lastOpenFiles": [
|
||||
"WORK & PROJECTS/Mol/Планы и диаграммы/Единые сущности для каждого элемента БП.md",
|
||||
"WORK & PROJECTS/Mol/Ideas/Пробоподготовка.md",
|
||||
"WORK & PROJECTS/Mol/Серверы/DOCS/Load Balancer.md",
|
||||
"WORK & PROJECTS/Mol/Ideas/Единые сущности для каждого элемента БП.md",
|
||||
"WORK & PROJECTS/Mol/Ideas/Пробоподготовка.md",
|
||||
"WORK & PROJECTS/Mol/Ideas/ФСА - справочник показателей.md",
|
||||
"WORK & PROJECTS/img/Pasted image 20241212175929.png",
|
||||
"WORK & PROJECTS/img",
|
||||
"WORK & PROJECTS/Mol/Серверы/DOCS/Load Balancer 2.md",
|
||||
"WORK & PROJECTS/img/Pasted image 20241212175851.png",
|
||||
"WORK & PROJECTS/img/Pasted image 20241212175847.png",
|
||||
"WORK & PROJECTS/img/Pasted image 20241212175419.png",
|
||||
"WORK & PROJECTS/Ulab/передача сформированных заявки и протокола как ссылку или файл.md",
|
||||
"WORK & PROJECTS/Mol/Серверы/00_Список серверов.md",
|
||||
"WORK & PROJECTS/Mol/Серверы/DOCS",
|
||||
"WORK & PROJECTS/Mol/Планы и диаграммы/Единые сущности для каждого элемента БП.md",
|
||||
"WORK & PROJECTS/Mol/Ideas",
|
||||
"WORK & PROJECTS/Ulab/Московский проект/ТЗ АИС ЛОКИ 2024-11-29 финал.docx",
|
||||
"WORK & PROJECTS/Ulab/Московский проект/НМЦК АИС ЛОКИ 2024-11-29 ФИНАЛ.xlsx",
|
||||
"WORK & PROJECTS/Ulab/Московский проект",
|
||||
"WORK & PROJECTS/Ulab/Новая папка",
|
||||
"WORK & PROJECTS/Mol/Планы и диаграммы/Пробоподготовка.md",
|
||||
"WORK & PROJECTS/Mol/Ideas/ФСА - справочник показателей.md",
|
||||
"WORK & PROJECTS/Mol/Планы и диаграммы/План разработки.md",
|
||||
"WORK & PROJECTS/Mol/Chunks",
|
||||
"WORK & PROJECTS/Mol/Документы для ТЗ ЛИМС/ГОСТ 53798.pdf",
|
||||
"WORK & PROJECTS/Ulab/Доступы к точкам.md",
|
||||
"WORK & PROJECTS/Mol/Серверы/Jira Confluence.md",
|
||||
"WORK & PROJECTS/Mol/Серверы/00_Список серверов.md",
|
||||
"WORK & PROJECTS/Mol/Документы для ТЗ ЛИМС/ГОСТ 17025 2019.pdf",
|
||||
"WORK & PROJECTS/Mol/Документы ООО Моль-софт/001.pdf",
|
||||
"WORK & PROJECTS/Mol/Документы для ТЗ ЛИМС/~$ЛИМС_Опросный_лист_по_ФТТ_от_21_10_2024_для_Исполнителя.xlsx",
|
||||
"Скрипт blender Set Origin to Bottom Centre.md",
|
||||
"WORK & PROJECTS/Mol/Серверы/Схема инфраструктуры.canvas",
|
||||
"WORK & PROJECTS/Mol/Серверы/crm.mol-soft.ru.md",
|
||||
|
||||
52
WORK & PROJECTS/Mol/Серверы/DOCS/Load Balancer 2.md
Normal file
52
WORK & PROJECTS/Mol/Серверы/DOCS/Load Balancer 2.md
Normal file
@@ -0,0 +1,52 @@
|
||||
Load balancing is a critical component in any high-availability web infrastructure. It helps distribute traffic across multiple servers, ensuring no single server bears too much load and potentially enhancing the performance and reliability of your applications. HAProxy, which stands for High Availability Proxy, is a popular open-source load balancer and proxy server for TCP and HTTP-based applications. This guide will walk you through setting up a load balancer using HAProxy on Debian 12.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- A Debian 12 server with root access or a user with sudo privileges
|
||||
- At least two backend servers to distribute the load to
|
||||
- Basic understanding of Linux command line and networking concepts
|
||||
|
||||
## Step 1: Installing HAProxy
|
||||
|
||||
First, update your package index and install HAProxy:
|
||||
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install haproxy -y
|
||||
```
|
||||
|
||||
## Step 2: Configuring HAProxy
|
||||
|
||||
Edit the HAProxy configuration file located at `/etc/haproxy/haproxy.cfg` using your preferred text editor. The following snippet shows how to set up a basic load balancing for HTTP traffic:
|
||||
|
||||
```sh
|
||||
frontend http_front
|
||||
bind *:80
|
||||
stats uri /haproxy?stats
|
||||
default_backend http_back
|
||||
|
||||
backend http_back
|
||||
balance roundrobin
|
||||
server server1 backend1.example.com:80 check
|
||||
server server2 backend2.example.com:80 check
|
||||
```
|
||||
|
||||
|
||||
The configuration directs traffic on port 80 to the backend servers in a round-robin fashion. The `stats uri` line enables HAProxy statistics report at the given URI.
|
||||
|
||||
## Step 3: Starting HAProxy
|
||||
|
||||
After configuring HAProxy, start the service and enable it to run on boot:
|
||||
|
||||
```sh
|
||||
sudo systemctl start haproxy
|
||||
sudo systemctl enable haproxy
|
||||
```
|
||||
|
||||
## Step 4: Verifying the Configuration
|
||||
|
||||
To verify that HAProxy is running and configured correctly, you can navigate to `http://your_server_ip/haproxy?stats` in your web browser. You should see the HAProxy statistics page, which displays the status of your backend servers.
|
||||
|
||||
## Conclusion
|
||||
|
||||
With HAProxy installed and configured on your Debian 12 server, you've set up a basic load balancer that can help improve the availability and reliability of your web applications. Remember to customize the HAProxy configuration to suit your specific needs and environment. If managing infrastructure is not your forte or you're looking to expand your team, consider the option to [hire remote DevOps engineers](https://reintech.io/hire-remote-devops-engineers) who can help you optimize and scale your environment efficiently.
|
||||
66
WORK & PROJECTS/Mol/Серверы/DOCS/Load Balancer.md
Normal file
66
WORK & PROJECTS/Mol/Серверы/DOCS/Load Balancer.md
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
https://medium.com/@ajibudiono04/basic-configuration-load-balancer-using-debian-11-bullseye-c0da7047f426
|
||||
|
||||
Load Balancer is a solution to stabilize traffic in the Network. Load Balancer works by distributing traffic to ensure servers are not overloaded.
|
||||
|
||||
We can use a load balancer using Debian 11 (bullseye). in this example topology using 2 Web Servers.
|
||||
|
||||
![[Pasted image 20241212175419.png]]
|
||||
|
||||
1. First Step, We must install OS Debian 11 as Load Balancer
|
||||
2. Don’t forget to update and upgrade OS
|
||||
3. Login as Super User (root)
|
||||
|
||||
```
|
||||
root@loadbalancer:/home/aji# apt-get update
|
||||
root@loadbalancer:/home/aji# apt-get upgrade
|
||||
```
|
||||
|
||||
4. Install HAProxy
|
||||
|
||||
```
|
||||
root@loadbalancer:/home/aji# apt-get install haproxy
|
||||
```
|
||||
|
||||
5. Configure HAProxy in the file config “etc/haproxy/haproxy.cfg”
|
||||
|
||||
```
|
||||
root@loadbalancer:/home/aji# nano /etc/haproxy/haproxy.cfg
|
||||
```
|
||||
|
||||
6. Add Command to define Web Servers
|
||||
|
||||
|
||||
```
|
||||
# Define frontend
|
||||
frontend apache_front
|
||||
# Frontend listen port - 80
|
||||
bind *:80
|
||||
# Set the default backend
|
||||
default_backend apache_backend_servers
|
||||
# Enable send X-Forwarded-For header
|
||||
option forwardfor
|
||||
|
||||
# Define backend
|
||||
backend apache_backend_servers
|
||||
# Use roundrobin to balance traffic
|
||||
balance roundrobin
|
||||
# Define the backend servers
|
||||
server backend01 192.168.77.84:80 check
|
||||
server backend02 192.168.77.85:80 check
|
||||
```
|
||||
|
||||
|
||||
7. Restart HA Proxy
|
||||
|
||||
```
|
||||
root@loadbalancer:/home/aji# systemctl restart haproxy
|
||||
```
|
||||
|
||||
8. Testing for ensure working normally to access to the Load Balancer (HAProxy)
|
||||
|
||||
|
||||
![[Pasted image 20241212175851.png|Server1]]
|
||||
|
||||
|
||||
![[Pasted image 20241212175929.png|Server2]]
|
||||
BIN
WORK & PROJECTS/img/Pasted image 20241212175419.png
Normal file
BIN
WORK & PROJECTS/img/Pasted image 20241212175419.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 113 KiB |
BIN
WORK & PROJECTS/img/Pasted image 20241212175847.png
Normal file
BIN
WORK & PROJECTS/img/Pasted image 20241212175847.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 388 KiB |
BIN
WORK & PROJECTS/img/Pasted image 20241212175851.png
Normal file
BIN
WORK & PROJECTS/img/Pasted image 20241212175851.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 388 KiB |
BIN
WORK & PROJECTS/img/Pasted image 20241212175929.png
Normal file
BIN
WORK & PROJECTS/img/Pasted image 20241212175929.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 670 KiB |
Reference in New Issue
Block a user