From 5e388e42886b51f14b12f73539811ba3f4c95c1c Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Thu, 23 Mar 2023 16:01:55 +0900 Subject: [PATCH] Add hot reload docs Signed-off-by: Hiroshi Hatake --- SUMMARY.md | 1 + administration/hot-reload.md | 50 ++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 administration/hot-reload.md diff --git a/SUMMARY.md b/SUMMARY.md index 482622714..2c67c485a 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -67,6 +67,7 @@ * [Memory Management](administration/memory-management.md) * [Monitoring](administration/monitoring.md) * [HTTP Proxy](administration/http-proxy.md) +* [Hot Reload](administration/hot-reload.md) * [Troubleshooting](administration/troubleshooting.md) ## Local Testing diff --git a/administration/hot-reload.md b/administration/hot-reload.md new file mode 100644 index 000000000..e01ba5f82 --- /dev/null +++ b/administration/hot-reload.md @@ -0,0 +1,50 @@ +--- +description: Enable hot reload through a command line argument or a HTTP endpoint +--- + +# Hot Reload + +FLuent Bit supports hot relaoding feature when enabling via command line with `-Y` or `--enable-hot-reload` option. + +## Getting Started + +To get started, the first step is to enable the HTTP Server from the configuration file: + +``` +[SERVICE] + HTTP_Server On + HTTP_Listen 0.0.0.0 + HTTP_PORT 2020 + +# Other stuffs of plugin configurations +``` + +The above configuration snippet will enable HTTP endpoint for hot reloading. + +## How to reload + +### via HTTP + +Hot reloading can be kicked via HTTP endpoints that are: + +* `PUT /api/v2/reload` +* `POST /api/v2/reload` + +If users don't enable hot reloading feature, hot reloading via these endpoinds does not work. + +For using curl to reload fluent-bit, users must specify empty request body as: + + +```text +$ curl -XPOST -d {} localhost:2020/api/v2/reload +``` + +### via Signal + +Hot reloading also can be kicked via `SIGHUP`. + +`SIGHUP` signal is not supported on Windows. So, users can't enable this feature on Windows. + +## Limitations + +Hot reloading feature is currently working on Linux and macOS. And Windows is not supported yet.