You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deployment/rpc.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,10 +29,16 @@ As evident from the output above, each endpoint returns a JSON object as its res
29
29
| :--- | :---: | :---: |
30
30
|`/api/processes.interruptWorkers`|[SIGINT](signals.md#sigint-or-sigterm)| Stops the daemon. |
31
31
|`/api/processes.killWorkers`|[SIGTERM](signals.md#sigint-or-sigterm)| Stops the daemon. |
32
+
|`/api/processes.zeroDowntimeRestart`|[SIGUSR2](signals.md#sigusr2)| Restarts Fluentd with zero-downtime. |
32
33
|`/api/processes.flushBuffersAndKillWorkers`|[SIGUSR1](signals.md#sigusr1) and [SIGTERM](signals.md#sigint-or-sigterm)| Flushes buffer and stops the daemon. |
33
34
|`/api/plugins.flushBuffers`|[SIGUSR1](signals.md#sigusr1)| Flushes the buffered messages. |
*`/api/processes.zeroDowntimeRestart`: This is supported since v1.18.0 on non-Windows.
41
+
*`/api/config.gracefulReload`: This is the replacement of `SIGUSR2` before v1.18.0. Please use `/api/processes.zeroDowntimeRestart` or `/api/config.reload` unless there is a special reason. See [SIGUSR2](signals.md#sigusr2) for details.
36
42
37
43
If this article is incorrect or outdated, or omits critical information, please [let us know](https://github.com/fluent/fluentd-docs-gitbook/issues?state=open). [Fluentd](http://www.fluentd.org/) is an open-source project under [Cloud Native Computing Foundation \(CNCF\)](https://cncf.io/). All components are available under the Apache 2 License.
| Supervisor | Graceful reload (forwarded to all workers) | v1.9 ~ v1.17 |
29
+
| Worker | Graceful reload | v1.9 ~ |
30
+
31
+
Windows:
32
+
33
+
| process | feature | version |
34
+
| :--- | :--- | :--- |
35
+
| Supervisor | Graceful reload (forwarded to all workers) | v1.9 ~ |
36
+
| Worker | Graceful reload | v1.9 ~ |
37
+
38
+
#### Zero-downtime restart
39
+
40
+
This feature allows a complete restart of Fluentd without bringing down some input plugins, such as `in_udp` or `in_tcp`.
41
+
42
+
See [Zero-downtime restart](zero-downtime-restart.md) for details.
43
+
44
+
**Comparison with SIGHUP**
45
+
46
+
`SIGHUP` gracefully restarting the worker process to reload.
47
+
48
+
This method does not cause socket downtime, so if there is no need to restart the supervisor, `SIGHUP` is a lighter zero-downtime restart method.
49
+
50
+
**Comparison with Graceful reload**
51
+
52
+
You can still use Graceful reload feature by sending `SIGUSR2` directly to the worker processor or using [RPC](rpc.md) even after v1.18.0.
53
+
54
+
This allows you to reload without restarting the process, but there are some limitations.
55
+
Please use zero-downtime restart or `SIGHUP` unless there is a special reason.
56
+
57
+
#### Graceful reload
58
+
21
59
Reloads the configuration file by gracefully re-constructing the data pipeline. Fluentd will try to flush the entire memory buffer at once, but will not retry if the flush fails. Fluentd will not flush the file buffer; the logs are persisted on the disk by default.
22
60
23
-
This signal has been supported since v1.9.0.
61
+
Limitations:
62
+
63
+
* A change to System Configuration (`<system>`) is ignored.
64
+
* All plugins must not use class variable when restarting.
24
65
25
66
### SIGHUP
26
67
27
68
Reloads the configuration file by gracefully restarting the worker process. Fluentd will try to flush the entire memory buffer at once, but will not retry if the flush fails. Fluentd will not flush the file buffer; the logs are persisted on the disk by default.
28
69
29
-
If you use fluentd v1.9.0 or later, use `SIGUSR2` instead.
70
+
This does not cause socket downtime because the supervisor process keeps the normal sockets, as long as the socket is provided as a shared socket by [server_helper](../plugin-helper-overview/api-plugin-helper-server.md).
4. Launch new workers, and stop old processes in parallel.
33
+
* Launch new workers with [Source Only Mode](source-only-mode.md).
34
+
* In addition to source-only mode, further limit the starting pluings to only those that support this feature.
35
+
* Data received by the new workers are stored in the temporary buffer of source-only mode.
36
+
* Send `SIGTERM` to the old supervisor after `10s` delay.
37
+
5. The old supervisor stops and sends `SIGWINCH` to the new one.
38
+
6. The new workers starts to run fully.
39
+
* The temporary buffer of source-only mode starts to load.
40
+
41
+
You can configure the temporary buffer.
42
+
See [Source Only Mode](source-only-mode.md) for details.
43
+
44
+
## Plugins: how to support this feature
45
+
46
+
See [How to Write Input Plugin - zero_downtime_restart_ready?](../plugin-development/api-plugin-input.md#zero_downtime_restart_ready).
47
+
48
+
If this article is incorrect or outdated, or omits critical information, please [let us know](https://github.com/fluent/fluentd-docs-gitbook/issues?state=open). [Fluentd](http://www.fluentd.org/) is an open-source project under [Cloud Native Computing Foundation \(CNCF\)](https://cncf.io/). All components are available under the Apache 2 License.
Copy file name to clipboardExpand all lines: plugin-development/api-plugin-input.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,31 @@ router.emit(tag, time, {:foo => 'bar'})
102
102
103
103
## Methods
104
104
105
-
There are no specific methods for the Input plugins.
105
+
### zero_downtime_restart_ready?
106
+
107
+
To support [Zero-downtime restart](../deployment/zero-downtime-restart.md), you can override this method to return `true`.
108
+
109
+
```ruby
110
+
defzero_downtime_restart_ready?
111
+
true
112
+
end
113
+
```
114
+
115
+
To do this, the following condition must be met:
116
+
117
+
* This plugin can run in parallel with another Fluentd.
118
+
119
+
This is because there is a period when the old process and the new process run in parallel during a zero-downtime restart.
120
+
121
+
After addressing the following considerations and ensuring there are no issues, override this method.
122
+
Then, the plugin will not experience downtime with zero-downtime restart.
123
+
124
+
* Handling Files
125
+
* When handling files, there is a possibility of conflict.
126
+
* Basically, input plugins that handle files should not support Zero-downtime restart.
127
+
* Handling Sockets
128
+
* A socket provided as a shared socket by [server plugin helper](../plugin-helper-overview/api-plugin-helper-server.md) is shared between the old and new processes. So, such a plugin can support Zero-downtime restart.
129
+
* When handling sockets on your own, be careful to avoid conflicts.
0 commit comments