DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

9
Trƒn Hœu Cưng, Nguy„n Văn Thưng Monitor and Load Balancing Hà Nºi, 19/07/2015 1/9

Transcript of DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

Page 1: DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

Trần Hữu Cường, Nguyễn Văn Thường Monitor and Load Balancing Hà Nội, 19/07/2015 1 / 9

Page 2: DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

Content

1 Start with Simple Webapp

2 Monitor docker with cAdvisor + InfluxDB + Grafana

3 Load balancing with Mesos + Marathon + Nginx

4 Autoscaling (coming soon, join us)

Trần Hữu Cường, Nguyễn Văn Thường Monitor and Load Balancing Hà Nội, 19/07/2015 2 / 9

Page 3: DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

Start with Simple Webap

docker-compose.yml

web1:image: test/counterports:

- "81:5000"links:

- redis:redisredis:

image: redis

Access: http://127.0.0.1:81/

Trần Hữu Cường, Nguyễn Văn Thường Monitor and Load Balancing Hà Nội, 19/07/2015 3 / 9

Page 4: DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

Hệ thống monitor

Cần các thành phần:

• App agent (sensor): thu thập thông tin hệ thống, log và gửi đến bộphận ghi nhận event.

• Ghi nhận event: nhận các event từ agent và ghi vào database.

• Database event: chuyên dụng, được thiết kế để tối ưu hóa việc lưutrữ dữ liệu event theo thời gian.

• Bộ phận tổng hợp, visualization: aggregate, trực quan hóa dữ liệuevent.

Trần Hữu Cường, Nguyễn Văn Thường Monitor and Load Balancing Hà Nội, 19/07/2015 4 / 9

Page 5: DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

Monitor docker

• cAdvisor: thu thập metrics docker.

• InfluxDB: open-source distributed time series database.

• Grafana: rich metrics dashboard and graph editor.

Access: http://monitor.coclab.lan:3000/

Trần Hữu Cường, Nguyễn Văn Thường Monitor and Load Balancing Hà Nội, 19/07/2015 5 / 9

Page 6: DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

Load balancing with Mesos + Marathon + Nginx

Experiment:1 Start Mesos and Marathon.

2 Start Nginx.

Trần Hữu Cường, Nguyễn Văn Thường Monitor and Load Balancing Hà Nội, 19/07/2015 6 / 9

Page 7: DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

Autoscaling (coming soon, join us)

Architecture:

1 Reporters: lấy thông tin trạng thái hoạt động.

2 Deciders: xử lí thông tin, ra quyết định.

3 Scalers: thực hiện lệnh scale.

Trần Hữu Cường, Nguyễn Văn Thường Monitor and Load Balancing Hà Nội, 19/07/2015 7 / 9

Page 8: DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

References

1 https://www.brianchristner.io/how-to-setup-docker-monitoring/

2 https://spof.io/blog/2015/06/23/mesos-sandbox-using-docker-compose/

Trần Hữu Cường, Nguyễn Văn Thường Monitor and Load Balancing Hà Nội, 19/07/2015 8 / 9

Page 9: DockerDay2015: Build and monitor a load balanced web application with Docker and Nginx

Thank you!• http://www.meetup.com/Docker-Hanoi/

• Trần Hữu Cường: [email protected]

• Nguyễn Văn Thường: [email protected]

Trần Hữu Cường, Nguyễn Văn Thường Monitor and Load Balancing Hà Nội, 19/07/2015 9 / 9