On 10/06/2014 01:49 PM, ChenXiao wrote:
Hi,
Greeting from Heka newbie! :D
I'm using Heka for a couple of weeks and was wondering if I could load
another hekad.toml file during Heka runtime.
As mentioned, it's possible to point your Heka daemon at a config
directory, instead of a single config file, if you have a complicated
config that you'd like to spread across multiple files. This config
won't be dynamically reloaded, though, you have to restart Heka. More on
this below.
If it was impossible, could
I choose to turn on/off a specific plugin during Heka runtime? (I looked
at: https://hekad.readthedocs.org/en/v0.7.2/config/index.html but
there's no related information) Thanks in advance!
In the general case, the answer is no. Currently, any changes made to
your Heka config require Heka to be restarted before they will take
effect. This isn't the whole story, however, there are two different
things I can point to that improve the situation somewhat.
First, it actually *is* possible to activate or deactivate one
particular type of plugin. Any SandboxFilter (i.e. a filter plugin where
the processing logic is implemented in Lua) can be dynamically added to
and/or removed from a running Heka. To achieve this, you *don't* put the
configuration for your SandboxFilter in the TOML files. Instead, you
configure Heka to have a SandboxManagerFilter and a special TcpInput
that you can use to send control messages. Then you use the heka-sbmgr
utility that we provide to dynamically load and unload filters. We have
a tutorial that explains how to set this up in our documentation:
http://hekad.readthedocs.org/en/v0.7.2/sandbox/index.html#tutorial-how-to-use-the-dynamic-sandboxes
Second, while currently you have to restart Heka to have config changes
take effect, we have been working on adding support for using SIGHUP to
send a "reload config" message to Heka without actually shutting down.
There's a work-in-progress pull request implementing this behaviour here:
https://github.com/mozilla-services/heka/pull/1078
That's not ready for use, though. Simply reloading the config is easy
enough. But in most cases Heka restarts so quickly, there's not much
benefit to reloading over restarting if the open connections are all
closed and need to be reestablished. What we really want is a so-called
"graceful" reload or restart, where existing TCP/HTTP connections will
be maintained, so that connections don't need to be reestablished and no
messages are dropped while the reload is taking place. This is further
complicated by the fact that we might *want* to drop some of the
connections, if the newly reloaded config happens to change the ports
that we're listening on, etc.
So, while the short answer of "no" is still valid, a more complete
answer is "yes, in one very specific case, and hopefully soon yes for
all cases, w/ the caveat that you'll probably need to send a SIGHUP
signal to trigger the reload."
Ultimately, I'm open to the idea of watching for file changes and
automatically picking them up, but I don't want that on by default, it
needs to be configurable. And I'd rather solve the problem for the
SIGHUP case and road test that for a while before we tackle any config
file monitoring.
Hope this helps,
-r
_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka