-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply changes from configuration file without restarting #4513
Comments
For service oriented apps I wrote in the past that had this behavior, I expanded to include the refreshing from any URL, that way one easy way to get centralized config management was via a web server or similar. For example:
If you're in Java land, accomplishing this is pretty easy too using something similar to |
@djschny we support the same in logstash through open-uri https://github.com/elastic/logstash/pull/4520/files#diff-5e1ebf137d1eab8a085fa7c1c4a6fd2cR37 |
@jsvd great stuff, keeping this open until its backported to 2.x |
How does the dynamic reload work with systemd service? I perused /etc/sysconfig/logstash and saw no variables corresponding to 'auto_reload' or 'reload_interval' |
in |
merged in 2.x
|
Today, any config changes made to LS pipeline requires a process restart, which is not ideal. Plan is to implement a feature which would track config file for changes and restart the pipeline (same process) with updated changes. This feature can be enabled in two ways:
--auto-reload
or with short-form-r
. Another option:--reload-interval <seconds>
controls how often LS should check the config files for changes.SIGHUP
orkill -1
to signal to LS to reload the config file and restart the pipeline.Behaviour:
When Logstash detects a change in config, it stops the current pipeline by stopping all the inputs, and attempts to creates a new pipeline using the updated config. A configuration test is run on the new configuration to make sure everything is good syntax wise. Then a new pipeline is created if there are no errors -- all inputs and outputs can be initialized (e.g. ports open). Once successful, the existing pipeline is swapped with the new pipeline. If there are errors, the old pipeline continues to function as before, and the errors are propagated to the console.
When a config is reloaded, the JVM is not restarted. All of this is in-process
Note that
--auto-reload
is not available with-e
flag which lets users pass in configuration through the CLI.The text was updated successfully, but these errors were encountered: