我希望有人能阐明我所面临的问题。我具有如下所述的体系结构,我将编写将流量传入实例的步骤。
注意:我使用的是介于两者之间的代理实例,以具有绑定到ALB的“静态” IP地址。根据分配的后端IP地址,仅动态更改代理实例上的IP地址。
问题是巨大的初始延迟。在对curl进行测试之后,我发现请求最初是到达简单超时的IP地址,然后在几分钟后路由到ALB IP地址。如何克服这个问题?
ALB要求至少分布在两个子网中,但只有一个是公共子网。
~ ❯❯❯ curl -v app1.domain.com
* Rebuilt URL to: app1.domain.com/
* Trying "some_public_ip_adress_a"...
* TCP_NODELAY set
* Connection failed
* connect to "some_public_ip_adress_a" port 80 failed: Operation timed out
* Trying "some_public_ip_adress_b"...
* TCP_NODELAY set
* Connected to app1.domain.com ("some_public_ip_adress_b") port 80 (#0)
> GET / HTTP/1.1
> Host: app1.domain.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 26 Jul 2018 10:39:31 GMT
< Content-Type: text/html
< Content-Length: 3700
< Connection: keep-alive
< Server: nginx/1.12.1
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: authorization,Content-Type
< Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, HEAD, DELETE
< X-FRAME-OPTIONS: SAMEORIGIN
< X-XSS-Protection: 1
< Accept-Ranges: bytes
< Last-Modified: Sat, 23 Jun 2018 21:06:06 GMT
<
<!doctype html><!--