Load balancing 是現代軟體架構者的必備知識。不僅是字面上「負載均衡/平衡」的作用而已,更是 high availability (HA)、zero-downtime deployment 的重要元素。
所以,在許多現代化軟體架構的場合,都可以看到 load balancer 的身影。
這段教學影片中,我介紹 load balancing 所扮演的角色,以及常見的運用場景。
► 影片全長 7 分鐘: http://school.soft-arch.net/courses/vm-for-devops/lectures/964514
lb
(load balancer): 10.0.0.10app1
: 10.0.0.30app2
: 10.0.0.31app3
: 10.0.0.32db
: 10.0.0.20
The Vagrantfile
is an ordinary Ruby source file. So, any valid Ruby construct (e.g., variables, conditions, loops) can be used here.
Separated by...
- variables and
when
conditions; - various playbook files;
- various tags.
See Ansible official documents:
See also Vagrant official document:
- File modules / lineinfile: Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression.
-
The WordPress application is stateful. You should modify the infrastructure in either way:
-
In the HAProxy part: use the sticky session mechanism.
-
In the application server part: use a shared PHP session mechanism.
-
-
SSL termination.
-
Infrastructure testing.