Раздел 10. Apache modules Пункты: 85 86 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 163 164 165 166 167 168 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 203 204 205 206 207 208 209 210 211 212 213 RU EN Пункт 177. Apache Module mod_proxy_hcheck
SummaryThis module provides for dynamic health checking of balancer members (workers). This can be enabled on a worker-by-worker basis. The health check is done independently of the actual reverse proxy requests. This module requires the service of ParametersThe health check mechanism is enabled via the use of additional
BalancerMember parameters, which are configured in the standard
way via A new BalancerMember status state (flag) is defined via this module: "
Usage examplesThe following example shows how one might configured health checking for various backend servers: ProxyHCExpr ok234 {%{REQUEST_STATUS} =~ /^[234]/} ProxyHCExpr gdown {%{REQUEST_STATUS} =~ /^[5]/} ProxyHCExpr in_maint {hc('body') !~ /Under maintenance/} <Proxy balancer://foo> BalancerMember http://www.example.com/ hcmethod=GET hcexpr=in_maint hcuri=/status.php BalancerMember http://www2.example.com/ hcmethod=HEAD hcexpr=ok234 hcinterval=10 BalancerMember http://www3.example.com/ hcmethod=TCP hcinterval=5 hcpasses=2 hcfails=3 BalancerMember http://www4.example.com/ </Proxy> ProxyPass "/" "balancer://foo" ProxyPassReverse "/" "balancer://foo" In this scenario, ProxyHCExpr Directive
The ProxyHCExpr: Allow for 2xx/3xx/4xx as passingProxyHCExpr ok234 {%{REQUEST_STATUS} =~ /^[234]/} ProxyPass "/apps" "http://backend.example.com/" hcexpr=ok234The expression can use curly-parens ("{}") as quoting deliminators in addition to normal quotes. If using a health check method (eg: In the following example, we send the backend a ProxyHCExpr: Checking response bodyProxyHCExpr in_maint {hc('body') !~ /Under maintenance/} ProxyPass "/apps" "http://backend.example.com/" hcexpr=in_maint hcmethod=get hcuri=/status.php NOTE: Since response body can quite large, it is best if used against specific status pages. ProxyHCTemplate Directive
The ProxyHCTemplateProxyHCTemplate tcp5 hcmethod=tcp hcinterval=5 ProxyPass "/apps" "http://backend.example.com/" hctemplate=tcp5 ProxyHCTPsize Directive
If Apache httpd and APR are built with thread support, the health check
module will offload the work of the actual checking to a threadpool
associated with the Watchdog process, allowing for parallel checks.
The ProxyHCTPsizeProxyHCTPsize 32 Пункты: 85 86 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 163 164 165 166 167 168 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 203 204 205 206 207 208 209 210 211 212 213 |
![]() |