Skip to content

Commit

Permalink
[FIX] "nginx & haproxy load balancing" page has been updated and opti…
Browse files Browse the repository at this point in the history
…mized
  • Loading branch information
ismoilovdevml committed Jan 4, 2025
1 parent 0bc562a commit 45066f0
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 123 deletions.
71 changes: 21 additions & 50 deletions pages/guides/konteyner/harbor-setup.en-UZ.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: "Harbor Container Registry o'rnatish va sozlash"
---

import { Callout } from "nextra-theme-docs";
import { Tabs, TabList, Tab, TabPanel } from 'react-tabs';
import 'react-tabs/style/react-tabs.css';

# Harbor Container Registry o'rnatish va sozlash

Expand Down Expand Up @@ -58,53 +60,6 @@ Bu bosqichda biz Harbor Container Registryni manual(qo'lda) holda setup qilishni

Harborni ishga tushirish uchun serverimizga Docker va Docker Compose o'rnatib olishimiz kerak bo'ladi. Dokcer va Docker Compose o'rnatish bo'yicha [**Linux serverlarga Docker o'rnatish**](https://devops-journey.uz/guides/konteyner/docker-ornatish) qo'llanmasi orqali o'rnatib olishingiz mumkin.

Ubuntu serverlarga Docker va Docker Compose o'rnatish.

**1->** Repozitoriyani sozlash. `apt` paketi indeksini yangilang va aptga HTTPS orqali repositoriyadan foydalanishga ruxsat berish uchun paketlarni o'rnating:

```bash
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg -y
```

**2->** Dockerning rasmiy **GPG** kalitini qo'shing:

```bash
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
```
**3->** Repositoriyani sozlash uchun quyidagi buyruqdan foydalaning:

```bash
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```

**4->** `apt` paketi indeksini yangilang

```bash
sudo apt-get update
```

**5->** Docker Engine, containerd va Docker Compose-ni o'rnatamiz.

Eng so'nggi versiyani(latest) o'rnatish uchun quyidagilarni bajaring.

```bash
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-compose -y
```

**6->** Dockerni ishga tushiramiz, statusini ko'ramiz va server o'chib yonganida avtomatik ishga tushishini yoqamiz.

```bash
sudo ssystemctl enable docker
sudo systemctl enable docker
sudo systemctl status docker
```

### SSL Sertifikat olish

**SSL**dan foydalanish port serveriga va undan keladigan trafikni himoya qilish imkonini beradi. Harborda o'zida Nginx mavjud bo'lib Nginx o'rnatib sozlamaymiz.
Expand All @@ -113,14 +68,30 @@ Web server HTTPS requestlarini qabul qilishidan oldin ishonchli sertifikat marka

**Certbot** HTTPS-ni yoqish orqali veb-xavfsizlikni yaxshilash maqsadida **Electronic Frontier Foundation (EFF)** tomonidan ishlab chiqilgan. U ko'pgina operatsion tizimlar, shuningdek, Apache va NGINX kabi eng mashhur veb-server dasturlari bilan mos keladi. Certbot sertifikatni so'rash, ACME bo'yicha barcha talablarni bajarish, sertifikatni o'rnatish va veb-serverni sozlash uchun **Let's Encrypt** bilan bog'lanish uchun javobgardir. Shuningdek, u sertifikatni yangilash jarayonini avtomatik ravishda boshqarishi mumkin. Qo'shimcha ma'lumot uchun Certbot veb-saytidagi [**About Certbot**](https://certbot.eff.org/pages/about) sahifasini ko'rib chiqishingiz mumkin.

**1->** Serverimizga **certbot** o'rnatib olamiz.
<Tabs>
<TabList>
<Tab>**Debian Based**</Tab>
<Tab>**Red Hat Based**</Tab>
</TabList>
<TabPanel>
**1->** Serverimizga **certbot** va kerakli tollarni o'rnatib olamiz.

```bash
sudo apt update
sudo apt install certbot
sudo apt install certbot vim nano zip unzip wget git -y
```
</TabPanel>
<TabPanel>
**1->** Serverimizga **certbot** o'rnatib olamiz.

```bash
sudo dnf update
sudo dnf install certbot vim nano zip unzip wget git -y
```
</TabPanel>
</Tabs>

**2->** domenimiz uchun SSL sertifikat olamiz, bunihc uchun domenimiz DNS hostga serverimiz static IP manzili bog'langan bo'lishi kerak.
**2->** domenimiz uchun SSL sertifikat olamiz, buning uchun domenimiz DNS hostga serverimiz static IP manzili bog'langan bo'lishi kerak.

```bash
sudo certbot certonly --standalone -d harbor.helm.uz
Expand Down
49 changes: 37 additions & 12 deletions pages/guides/web-server/haproxy-load-balancing.en-UZ.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: "HAProxy bilan HTTP/TCP load balancing va monitoring"
---

import { Callout } from "nextra-theme-docs";
import { Tabs, TabList, Tab, TabPanel } from 'react-tabs';
import 'react-tabs/style/react-tabs.css';

# HAProxy bilan HTTP/TCP load balancing va monitoring

Expand Down Expand Up @@ -33,11 +35,11 @@ HAProxy bilan load balancing qilishimiz uchun minimum 3ta server kerak bo'ladi b
<Callout type="info" emoji="">
**Minimum Server talabi**

| OS | RAM | CPU | Xotira | Static IP | Server vazifasi |
| ------------- | -------------- | ------------- |------------- | ---------- | ---------------------- |
| Ubuntu 20.04 | 4GB | 2vCPU 2 core | 50GB | Ha kerak | HAProxy(Load Balancer) |
| Ubuntu 20.04 | 4GB | 2vCPU 2 core | 50GB | Shart emas | Application Server 1 |
| Ubuntu 20.04 | 4GB | 2vCPU 2 core | 50GB | Shart emas | Application Server 2 |
| OS | RAM | CPU | Xotira | Static IP | Server vazifasi |
| ------------------------------- | -------------- | ------------- |------------- | ---------- | ---------------------- |
| Ubuntu 20.04 yoki RockyLinux 8 | 4GB | 2vCPU 2 core | 50GB | Ha kerak | HAProxy(Load Balancer) |
| Ubuntu 20.04 yoki RockyLinux 8 | 4GB | 2vCPU 2 core | 50GB | Shart emas | Application Server 1 |
| Ubuntu 20.04 yoki RockyLinux 8 | 4GB | 2vCPU 2 core | 50GB | Shart emas | Application Server 2 |

**Qo'llanmada ishlatilgan Serverlar IP mazilllari**

Expand All @@ -51,33 +53,56 @@ HAProxy bilan load balancing qilishimiz uchun minimum 3ta server kerak bo'ladi b

**HAProxy** serverimizni sozlashni boshlaymiz.

**1->** Tizimingizni yangilang.
**1->** Serverni yangilab olamiz.

<Tabs>
<TabList>
<Tab>Debian Based</Tab>
<Tab>Red Had Based</Tab>
</TabList>
<TabPanel>
```bash
sudo apt-get update && sudo apt-get upgrade -y
```
</TabPanel>
<TabPanel>
```bash
sudo dnf update && sudo dnf upgrade -y
```
</TabPanel>
</Tabs>

**2->** HAProxy o'rnating. HAProxy ko'pgina Linux distributivlarining package management systemlariga kiritilgan:

**2->** HAProxy o'rnatamiz, HAProxy ko'pgina Linux distributivlarining package management systemlariga kiritilgan:

Debian based uchun. Debian va Ubuntu uchun maxsus HAProxy versiylarini o'rnatish uchun quyidagi websaytdan foydalanishingiz mumkin. [haproxy.debian.net](https://haproxy.debian.net/)

<Tabs>
<TabList>
<Tab>Debian Based</Tab>
<Tab>Red Had Based</Tab>
</TabList>
<TabPanel>
```bash
sudo apt install haproxy -y
```
Maxsus versiya kerak bo'lsa - [haproxy.debian.net](https://haproxy.debian.net/)
Ubuntu 20.04 uchun HAProxy 2.8 LTS

```bash
sudo apt-get install --no-install-recommends software-properties-common
sudo add-apt-repository ppa:vbernat/haproxy-2.8
sudo apt-get install haproxy=2.8.\*
```
Fedora uchun

</TabPanel>
<TabPanel>
```bash
sudo yum install haproxy
sudo dnf install haproxy -y
```
</TabPanel>
</Tabs>

**3->** HAProxy o'rnatilganidan keyin statusini tekshiring.
**3->** HAProxy o'rnatilganidan keyin statusini tekshiramiz.

```bash
sudo systemctl status haproxy
Expand Down Expand Up @@ -632,7 +657,7 @@ Qo'shimcha Resurslar
**Sana:** 2024.01.08(2024-yil 8-yanvar)
**Oxirgi yangilanish:** 2024.01.09(2024-yil 9-yanvar)
**Oxirgi yangilanish:** 2025.01.04(2025-yil 4-yanvar)
**Muallif: Otabek Ismoilov**
Expand Down
Loading

0 comments on commit 45066f0

Please sign in to comment.