阿帕奇错误 "AH01171: balancer://cluster: No workers in balancer"
Apache error "AH01171: balancer://cluster: No workers in balancer"
我正在尝试设置 apache 服务器(运行 和 Docker)作为负载平衡反向代理,但无论我尝试什么,我都会收到错误消息
[proxy_balancer:error] [pid 8:tid 140013616056064] [client 172.17.0.1:39376] AH01171: balancer://cluster: No workers in balancer
这里有一个演示问题的最小工作示例:
Docker文件:
FROM httpd:2.4
RUN for mod in \
slotmem_shm_module lbmethod_byrequests_module \
proxy_module proxy_http_module proxy_balancer_module; do \
sed -i "s/^#LoadModule \($mod\) /LoadModule \1 /" conf/httpd.conf; \
done
RUN echo "Include conf/extra/test.conf" >> conf/httpd.conf
test.conf:
<Proxy "balance://cluster">
BalancerMember "http://www.google.com/"
BalancerMember "http://www.xkcd.com/"
</Proxy>
ProxyPass / balancer://cluster/
运行 作为 docker run -it -p 80:80 -v $PWD/test.conf:/usr/local/apache2/conf/extra/test.conf proxy-test
然后尝试检索 http://localhost/
并且错误出现在服务器 stderr 中。
我试过将它放在虚拟主机中,设置服务器名,放入 ProxyPassReverse,将 ProxyPass 放在 <Location />
- none 中,这有帮助。
我明白了 - 这是一个错字。 balance://cluster
应该是 balancer://cluster
.
我正在尝试设置 apache 服务器(运行 和 Docker)作为负载平衡反向代理,但无论我尝试什么,我都会收到错误消息
[proxy_balancer:error] [pid 8:tid 140013616056064] [client 172.17.0.1:39376] AH01171: balancer://cluster: No workers in balancer
这里有一个演示问题的最小工作示例:
Docker文件:
FROM httpd:2.4
RUN for mod in \
slotmem_shm_module lbmethod_byrequests_module \
proxy_module proxy_http_module proxy_balancer_module; do \
sed -i "s/^#LoadModule \($mod\) /LoadModule \1 /" conf/httpd.conf; \
done
RUN echo "Include conf/extra/test.conf" >> conf/httpd.conf
test.conf:
<Proxy "balance://cluster">
BalancerMember "http://www.google.com/"
BalancerMember "http://www.xkcd.com/"
</Proxy>
ProxyPass / balancer://cluster/
运行 作为 docker run -it -p 80:80 -v $PWD/test.conf:/usr/local/apache2/conf/extra/test.conf proxy-test
然后尝试检索 http://localhost/
并且错误出现在服务器 stderr 中。
我试过将它放在虚拟主机中,设置服务器名,放入 ProxyPassReverse,将 ProxyPass 放在 <Location />
- none 中,这有帮助。
我明白了 - 这是一个错字。 balance://cluster
应该是 balancer://cluster
.