Home Backend Development PHP Tutorial 负载均衡有关问题 高分求解

负载均衡有关问题 高分求解

Jun 13, 2016 am 10:12 AM
apache cacti mysql nginx proxy

负载均衡问题 高分求解
有四台web服务器使用了负载均衡
四台db服务器也使用率负载均衡
我想自己写个东西
检测两个负载均衡连接的八台服务器是否可以连接,
因为有的时候其中有一两台服务器挂掉了
但是我不知道,
所以想写一个东西来手动检测


------解决方案--------------------
你负载均衡的技术也自己实现的? 如果不是 你使用的那个肯定有提供这样的功能
------解决方案--------------------
检查他是否活着看他ping的通不啊,不晓得行不行获取用socket通信试试
------解决方案--------------------
搭建个监控的机器cacti
------解决方案--------------------
apache的负载均衡采用反向代理实现,apache有个扩展模块mod_proxy就是专门做这个的。配置完毕以后,apache会自己搞定负载均衡的事情,PHP端不需要管任何事情,至于后端服务器挂了,可以采用其他的监控软件进行监控。一般是采用snmp协议的,比如楼上有人提到的cacti。
mysql的负载均衡,首先要设置多台mysql的replication,一主多从(一写多读),mysql软件包里面有个mysql_proxy是用来代理这些后端的各台mysql的,它可以将读写分离开来,并有多种负载均衡的模式。同理配置完毕后PHP也不需要管任何事情,只需要把默认的3306端口改成mysql_proxy的4040端口即可。监控同理。
------解决方案--------------------
lz了解下nginx, 负载均衡nginx挺好用的

Nginx 简单的负载均衡配置示例[原创] http://blog.s135.com/post/306/
------解决方案--------------------

探讨

lz了解下nginx, 负载均衡nginx挺好用的

Nginx 简单的负载均衡配置示例[原创] http://blog.s135.com/post/306/
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to create a MySQL table using PHP? How to create a MySQL table using PHP? Jun 04, 2024 pm 01:57 PM

Creating a MySQL table using PHP requires the following steps: Connect to the database. Create the database if it does not exist. Select a database. Create table. Execute the query. Close the connection.

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

One of the major changes introduced in MySQL 8.4 (the latest LTS release as of 2024) is that the "MySQL Native Password" plugin is no longer enabled by default. Further, MySQL 9.0 removes this plugin completely. This change affects PHP and other app

How to delete data from MySQL table using PHP? How to delete data from MySQL table using PHP? Jun 05, 2024 pm 12:40 PM

PHP provides the following methods to delete data in MySQL tables: DELETE statement: used to delete rows matching conditions from the table. TRUNCATETABLE statement: used to clear all data in the table, including auto-incremented IDs. Practical case: You can delete users from the database using HTML forms and PHP code. The form submits the user ID, and the PHP code uses the DELETE statement to delete the record matching the ID from the users table.

How to set up MySQL connection pool using PHP? How to set up MySQL connection pool using PHP? Jun 04, 2024 pm 03:28 PM

Setting up a MySQL connection pool using PHP can improve performance and scalability. The steps include: 1. Install the MySQLi extension; 2. Create a connection pool class; 3. Set the connection pool configuration; 4. Create a connection pool instance; 5. Obtain and release connections. With connection pooling, applications can avoid creating a new database connection for each request, thereby improving performance.

The page is blank after PHP is connected to MySQL. What is the reason for the invalid die() function? The page is blank after PHP is connected to MySQL. What is the reason for the invalid die() function? Apr 01, 2025 pm 03:03 PM

The page is blank after PHP connects to MySQL, and the reason why die() function fails. When learning the connection between PHP and MySQL database, you often encounter some confusing things...

WordPress site file access is restricted: Why is my .txt file not accessible through domain name? WordPress site file access is restricted: Why is my .txt file not accessible through domain name? Apr 01, 2025 pm 03:00 PM

Wordpress site file access is restricted: troubleshooting the reason why .txt file cannot be accessed recently. Some users encountered a problem when configuring the mini program business domain name: �...

Monitoring Redis Droplets Using Redis Exporter Service Monitoring Redis Droplets Using Redis Exporter Service Jan 06, 2025 am 10:19 AM

Effective monitoring of Redis databases is essential for maintaining optimal performance, identifying potential bottlenecks, and ensuring overall system reliability. Redis Exporter Service is a robust utility designed to monitor Redis databases using Prometheus. This tutorial will guide you through the complete setup and configuration of Redis Exporter Service, ensuring you establish a monitoring solution seamlessly. By following this tutorial, you’ll achieve a fully operational monitoring setup to effectively monitor the performance metrics of your Redis database.

How to make PHP5.6 and PHP7 coexist through Nginx configuration on the same server? How to make PHP5.6 and PHP7 coexist through Nginx configuration on the same server? Apr 01, 2025 pm 03:15 PM

Running multiple PHP versions simultaneously in the same system is a common requirement, especially when different projects depend on different versions of PHP. How to be on the same...

See all articles