Logging Verbosity in Keepalived.conf?

My keepalived VIP on one of my routers stopped responding. I still saw it on the primary router and not the secondary router as I would expect, and I could ping the regular IPs. As soon as I restarted keepalived the problem was resolved.

I am not really sure what is causing this issue, are there any log level directives I could add to my keepalived that might give me some information if this happens again?


I do see:

keepalived -f /usr/local/etc/keepalived.conf --dont-fork --log-console --log-detail These options will stop keepalived from fork'ing, and will provide additional logging data. Using these options is especially useful when you are testing out new configuration directives, or debugging an issue with an existing configuration file.

So maybe I just need to edit my init file? Seems like it should be a config file option though.


Solution 1:

Looks like you'll have to edit the init script. From keepalived.conf(5) via git: http://master.formilux.org/git/people/alex/keepalived.git/

       # Debug level, not implemented yet.
       debug

You can also verify this by looking at the configuration parsing code in keepalived/check/check_parser.c:

265 vector
266 check_init_keywords(void)
267 {
268         /* global definitions mapping */
269         global_init_keywords();
270 
271         /* SSL mapping */
272         install_keyword_root("SSL", &ssl_handler);
273         install_keyword("password", &sslpass_handler);

Lists all the configuration file keywords that it parses, and debug isn't in here. The debug levels appear to be set only via the keepalived/core/main.c options processing:

154                 "  %s --log-console        -l    Log message to local console.\n"
155                 "  %s --log-detail         -D    Detailed log messages.\n"
...
177                 {"log-console", 'l', POPT_ARG_NONE, NULL, 'l'},
178                 {"log-detail", 'D', POPT_ARG_NONE, NULL, 'D'},
...
209         case 'l':
210                 debug |= 1;
211                 break;
...
224         case 'D':
225                 debug |= 32;
226                 break;