From 984a5846e36a3efefa42d17e56d9d36114c20d64 Mon Sep 17 00:00:00 2001 From: DeDe Morton Date: Mon, 21 Mar 2016 10:00:30 -0700 Subject: [PATCH] Sync config reload docs --- docs/index.asciidoc | 3 ++ docs/static/command-line-flags.asciidoc | 6 ++++ docs/static/reloading-config.asciidoc | 43 +++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 docs/static/reloading-config.asciidoc diff --git a/docs/index.asciidoc b/docs/index.asciidoc index a83f85da8..30f32b834 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -59,6 +59,9 @@ include::static/upgrading.asciidoc[] pass::[] include::static/configuration.asciidoc[] +pass::[] +include::static/reloading-config.asciidoc[] + pass::[] include::static/command-line-flags.asciidoc[] diff --git a/docs/static/command-line-flags.asciidoc b/docs/static/command-line-flags.asciidoc index 7d722ad93..d9945f398 100644 --- a/docs/static/command-line-flags.asciidoc +++ b/docs/static/command-line-flags.asciidoc @@ -57,6 +57,12 @@ Logstash has the following flags. You can use the `--help` flag to display this Logstash can read multiple config files from a directory. If you combine this flag with `--debug`, Logstash will log the combined config file, annotating the individual config blocks with the source file it came from. + +-r, --[no-]auto-reload + Monitor configuration changes and reload the configuration whenever it is changed. + +--reload-interval RELOAD_INTERVAL + Specifies how often Logstash checks the config files for changes. The default is every 3 seconds. -h, --help Print help diff --git a/docs/static/reloading-config.asciidoc b/docs/static/reloading-config.asciidoc new file mode 100644 index 000000000..22f3118aa --- /dev/null +++ b/docs/static/reloading-config.asciidoc @@ -0,0 +1,43 @@ +[[reloading-config]] +=== Reloading the Config File + +Starting with Logstash 2.3, you can set Logstash to detect and reload configuration +changes automatically. + +To enable automatic config reloading, start Logstash with the `--auto-reload` (or `-r`) +command-line option specified. For example: + +[source,shell] +---------------------------------- +bin/logstash –f apache.config --auto-reload +---------------------------------- + +NOTE: The `--auto-reload` option is not available when you specify the `-e` flag to pass +in configuration settings from the command-line. + +By default, Logstash checks for configuration changes every 3 seconds. To change this interval, +use the `--reload-interval ` option, where `seconds` specifies how often Logstash +checks the config files for changes. + +If Logstash is already running without auto-reload enabled, you can force Logstash to +reload the config file and restart the pipeline by sending a SIGHUP (signal hangup) to the +process running Logstash. For example: + +[source,shell] +---------------------------------- +kill -1 14175 +---------------------------------- + +Where 14175 is the ID of the process running Logstash. + +==== How Automatic Config Reloading Works + +When Logstash detects a change in a config file, it stops the current pipeline by stopping +all inputs, and it attempts to create a new pipeline that uses the updated configuration. +After validating the syntax of the new configuration, Logstash verifies that all inputs +and outputs can be initialized (for example, that all required ports are open). If the checks +are successful, Logstash swaps the existing pipeline with the new pipeline. If the checks +fail, the old pipeline continues to function, and the errors are propagated to the console. + +During automatic config reloading, the JVM is not restarted. The creating and swapping of +pipelines all happens within the same process.