keepalivedのヘルスチェック

delay_loopを6にしてみる。

virtual_server 192.168.11.100 80 {
    delay_loop 6
    lb_algo rr
    lb_kind DR
    protocol TCP

    real_server 192.168.11.15 80 {
        weight 1
        HTTP_GET {
            url {
              path /keepalived_HTTP_GET
              status_code 200
            }
            connect_timeout 3
        }
    }
}


192.168.11.13 - - [13/Dec/2009:12:57:42 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 200 2
192.168.11.13 - - [13/Dec/2009:12:57:48 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 200 2
192.168.11.13 - - [13/Dec/2009:12:57:54 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 200 2

delay_before_retryを設定する。

        weight 1
        HTTP_GET {
            url {
              path /keepalived_HTTP_GET
              status_code 200
            }
            connect_timeout 3
            delay_before_retry 3
        }


192.168.11.13 - - [13/Dec/2009:13:00:50 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 200 2
192.168.11.13 - - [13/Dec/2009:13:01:00 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 200 2
192.168.11.13 - - [13/Dec/2009:13:01:09 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 200 2

上記の設定で定期的にヘルスチェックに失敗させてみる。


192.168.11.13 - - [13/Dec/2009:13:07:39 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 200 2
192.168.11.13 - - [13/Dec/2009:13:07:49 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 200 2
192.168.11.13 - - [13/Dec/2009:13:07:58 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 500 2
192.168.11.13 - - [13/Dec/2009:13:08:05 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 500 2
192.168.11.13 - - [13/Dec/2009:13:08:11 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 200 2
192.168.11.13 - - [13/Dec/2009:13:08:21 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 500 2
192.168.11.13 - - [13/Dec/2009:13:08:27 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 200 2
192.168.11.13 - - [13/Dec/2009:13:08:37 JST] "GET /keepalived_HTTP_GET HTTP/1.0" 500 2