> For the complete documentation index, see [llms.txt](https://cf337188.gitbook.io/01/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cf337188.gitbook.io/01/20190417.md).

# 20190417

參考資料:

{% embed url="<http://blog.maxkit.com.tw/2016/05/lvs-lvs-natlvs-tunlvs-dr.html>" %}

{% embed url="<https://blog.51cto.com/lansgg/1229421>" %}

原理:

![](/files/-LdDRmuAs72GHcvLMI5G)

首先需要架設三台虛擬機

ip分別為56.101;56.102;56.103

選擇一台為監控端(56.101)

剩下兩台作為控制端

控制端的部分:

```
# yum install -y httpd
```

```
# cd /var/www/html
```

```
# echo "web1" > index.html
# echo "web2" > index.html
```

完成這邊後檢查httpd有沒有正常啟動

```
# service httpd start
```

檢查防火牆是否關閉

```
# systemctl stop firewalld
```

監控端的部分:

```
# yum install -y ipvsadm
```
