with the continuous development of IT operations, especially the rapid development of Linux, more and more enterprises began to use the Linux operating system platform, such as CentOS, RedHat, Ubuntu, Fedora and so on, hundreds of millions of sites are emerging in today's Internet, the internet has become an indispensable tool, and today we share with you the most current use of the Linux mainstream site architecture:
Lvs+keepalived (Heartbeat) +squid+nginx/apache+java/php
+MYSQL/MARIADB, and so on, share a simple topological map for your classmates to reference the experiment:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/54/58/wKioL1R_8KGBix_lAAOwGnwDJWo731.jpg "title=" QQ picture 20141204120144.jpg "Width=" 720 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:720px;height:500px; " alt= "Wkiol1r_8kgbix_laaowgnwdjwo731.jpg"/>
General web site is divided into four layers, in order to front-end load balancing, intermediary agents, backend services, database layer.
Of course, in addition to this overall process, different companies expand a lot of things, various systems continue to add to this architecture, forming a very large, complex system. Then let's take a look at the details of each level OPS person:
1) LVS load balancer layer
LVS Load balancer layer is mainly used to protect against large traffic and forwarding data functions, generally based on the TCP/IP four layer protocol forwarding, according to different internal environment use of the forwarding method is not the same, usually Dr mode efficiency is higher, lvs+keepalived combination, can use keepalived to manage our entire configuration file, so that the balance becomes simple and practical, can be various planning to check the back-end nginx or squid service is normal.
LVS Simple Operation principle: the user requests LVs Vip,lvs according to the forwarding method and the algorithm, forwards the request to the back-end server, the back-end server receives the request, returns to the user, for the user, cannot see the Web backend concrete application.
OPS personnel in the maintenance LVs, need to pay close attention to the current number of LVS and the system LVS log. Monitor the status of VIP, real IP, number of connections through monitoring platform.
2) Nginx reverse proxy layer
Nginx is currently the mainstream high-performance Web server, nginx because of very good stability, rich feature set, sample configuration file and low system Resources consumption and other advantages, the current development momentum is very hot.
Nginx is mainly based on 7-tier applications, able to implement a variety of rules forwarding, reverse proxy our back-end Java, PHP dynamic server, while nginx itself processing static pages of the ability of the official theory concurrent 5w/s, while Nginx can also be used as a cache server to store our static page cache, Performance is comparable to squid.
As an IT operations personnel in the daily operations, the need for long-term attention to the overall operation of the site, analysis of site bottlenecks, and constantly optimize the parameters of nginx, and ensure that nginx and back-end service connection is abnormal and so on.
3) backend service layer
Backend store our real site and back-end services, through the front-end Nnginx call, back-end common service parsing software, if it is JSP language, containers for Tomcat, Resin, WebLogic and so on.
If it is a PHP program, we need to install the PHP environment to parse the PHP code, and then through the front-end nginx reverse proxy provided to the user access.
In the daily operations, we need to pay attention to the monitoring of the backend service layer, and the number of connections, to real-time attention and monitoring of the normal back-end services, configuration multi-instance, redundant cases.
4) Database layer
Currently the main Internet database has MySQL, MARIADB, MongoDB, Oracle and so on, for the database is the core layer of the entire architecture, and data is the survival of the enterprise, so the database architecture and maintenance is also crucial. Medium and large Internet companies have their own full-time DBAs who are responsible for running and maintaining MySQL.
For IT operations personnel in the maintenance of the database needs to pay close attention to database concurrency, connection pool and other changes, focus on the database master-slave, read and write separation status and log changes, and make a complete backup mechanism to complete the database backup, there are problems in time to deal with.
This article is from the "Wu Guangko-focus on automated Operations" blog, please be sure to keep this source http://wgkgood.blog.51cto.com/1192594/1586259
Simple analysis of operation and maintenance of mainstream Linux architecture