简体   繁体   中英

Load Balancing with Solr on Google Cloud

I am trying to create an autoscaling group of solr instances using Google Cloud with a load balancer at the frontend. The error I am experiencing is that the health check that I created is never passing no matter what I try. The health check is set to go to port 80 (the instances using nginx to forward port 80 to 8983) and the path is /solr/ < core_name > /admin/ping.

I can cURL this path from outside the instance and inside the instance (using localhost) and I get:

curl --head localhost/solr/product/admin/ping
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Fri, 22 Jul 2016 19:41:26 GMT
Content-Type: application/xml; charset=UTF-8
Content-Length: 0
Connection: keep-alive

Could anyone explain why the health check does not pass? The details of the health check are:

checkIntervalSec: 20
creationTimestamp: '2016-07-21T11:54:44.196-07:00'
description: ''
healthyThreshold: 1
host: ''
id: < id >
kind: compute#httpHealthCheck
name: < name >
port: 80
requestPath: /solr/product/admin/ping
selfLink: < path to healthcheck >
timeoutSec: 20
unhealthyThreshold: 3

The only thing I can think of is in the Health Check page, it says "For a health check to be deemed successful, the instance must return a valid HTTP response with code 200 and close the connection normally within the timeoutSec period." I know Solr is giving the code 200, but from the curl command, it is also keeping the connection alive instead of closing it. Could that be the error? If so, how could I get around this?

If I point the health check to port 8983 where solr is running instead of routing it through nginx, the connection no longer uses keep-alive but it also reports the instance as unhealthy.

Any help would be much appreciated,

Figured out a way to make this work. I just did the exact same thing using a TCP load balancer instead of an HTTP load balancer and it worked perfectly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM