Sharing HAProxy-matched pan-resolution domain name troubleshooting Process

Source: Internet
Author: User

Sharing HAProxy-matched pan-resolution domain name troubleshooting Process

Fault description
HAProxy has been set up. Now we need to forward the domain name suffixed with game.bkjia.com to the backend Nginx VM host. The key is how to use HAProxy to match game.bkjia.com. In the HAProxy configuration file, configure to forward HTTP requests to port 80 on the backend Nginx host and check the monitoring status of Nginx and PHP-FPM through port 88.

Set HAProxy ACL rules
Acl game_url hdr_end (host)-I game.bkjia.com

After reload HAProxy, Error 404 is always reported during browser access.

For example. This indicates that this domain name HAProxy was not forwarded at all. Therefore, it is suspected that the ACL rule of HAProxy is wrong.

Troubleshooting Process
1. Check information about the HAProxy ACL matching rule. It is suspected that the ACL rule is incorrect.
Comment out the acl column. If no specific acl rule is set, set the default forwarding.

1 default_backend game_pool

In this way, all domain name requests will be forwarded to the Nginx host specified by game_pool by default, and then the Nginx access log will be viewed. There is still no range log for the specific domain name, but only the Nginx default access log. Therefore, the ACL forwarding rules are excluded.

2. Check the HAProxy monitoring and inspection mechanism on the backend Nginx host.
In HAProxy, the health status of Nginx and php-fpm_status on the backend Nginx host is determined by checking the PHP-FPM status of the backend Nginx host. Because only judging Nginx or only judging the PHP-FPM is not to judge the availability of the backend Nginx host.
Nginx_php-fpm_status.conf

Server {

Listen 88;

Location/nginx_status {
Stub_status on;
Access_log off;
# Allow 127.0.0.1;
# Allow 10.4.1.125;
# Deny all;
}

Location/php-fpm_status {
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
Include fastcgi_params;
}

}

 

# Curl 192.168.100.63: 88/php-fpm_status
Pool: www
Process manager: dynamic
Start time: 11/Feb/2015: 16: 00: 27 + 0800
Start since: 2703
Accepted conn: 1367
Listen queue: 0
Max listen queue: 0
Listen queue len: 128
Idle processes: 19
Active processes: 1
Total processes: 20
Max active processes: 1
Max children reached: 0
Slow requests: 0

In HAProxy

Option httpchk GET/php-fpm_status
Server bkjia-taiwan-game1 192.168.100.63: 80 check maxconn 2000

The problem is found here, because the HAProxy is set to determine the health status through the request/php-fpm_status, but this URL needs to be accessed using port 88, here using the check parameter will default according to 192.168.100.63: port 80 is configured for detection.

Reset the detection port to 88.
Server bkjia-taiwan-game1 192.168.100.63: 80 check port 88 maxconn 2000

Then reload HAProxy and access router-taiwan.bkjia.com/index.php through the browser.

Haproxy + Keepalived build Weblogic high-availability server Load balancer Cluster

Keepalived + HAProxy configure high-availability Load Balancing

Haproxy + Keepalived + Apache configuration notes in CentOS 6.3

Haproxy + KeepAlived WEB Cluster on CentOS 6

Haproxy + Keepalived build high-availability Load Balancing

Configure an HTTP Load balancer using HAProxy

For details about HAproxy, click here
HAproxy: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.