|
| 1 | +# Source Only Mode |
| 2 | + |
| 3 | +Since v1.18.0, Fluentd can launch with source-only mode. |
| 4 | +(Not supported on Windows) |
| 5 | + |
| 6 | +* In this mode, only input plugins run. |
| 7 | +* During this mode, the events are stored in a temporary file buffer. |
| 8 | +* Sending `SIGWINCH` to the supervisor cancels this mode. |
| 9 | + * Then, all plugins start to run, and the temporary file buffer starts to load. |
| 10 | + |
| 11 | +## How to launch Fluentd with source-only mode |
| 12 | + |
| 13 | +You can launch Fluentd with source-only mode in the following ways. |
| 14 | + |
| 15 | +* [Command Line Option - --with-source-only](command-line-option.md) |
| 16 | +* [System Configuration - with_source_only](system-config.md#with_source_only) |
| 17 | + |
| 18 | +## Temporary file buffer |
| 19 | + |
| 20 | +During source-only mode, the ingested events are stored in a temporary file buffer. |
| 21 | +After `SIGWINCH` is sent to the supervisor and this mode is canceled, this buffer begins to load. |
| 22 | + |
| 23 | +By default, the file buffer path is as follows. |
| 24 | + |
| 25 | +* `/tmp/fluent/source-only-buffer/{Unique ID for the Fluentd instance}` |
| 26 | + |
| 27 | +You can confirm it in the following log output at startup. |
| 28 | + |
| 29 | +``` |
| 30 | +[info]: #0 with-source-only: the emitted data will be stored in the buffer files under |
| 31 | +/tmp/fluent/source-only-buffer/bbd9006d-bc41-418b-b346-f80888641dda. You can send SIGWINCH to |
| 32 | +the supervisor process to cancel with-source-only mode and process data. |
| 33 | +``` |
| 34 | + |
| 35 | +This file buffer is the buffer of [out_buffer](../output/buffer.md). |
| 36 | +It works with the default settings of `out_buffer` except for the following points: |
| 37 | + |
| 38 | +* `path` is automatically determined by default. |
| 39 | +* `overflow_action` is `drop_oldest_chunk` by default. |
| 40 | + |
| 41 | +If needed, you can configure some options for the buffer in System Configuration. |
| 42 | +Please see the following for details. |
| 43 | + |
| 44 | +* [System Configuration - source_only_buffer section](system-config.md#less-than-source_only_buffer-greater-than-section). |
| 45 | + |
| 46 | +### Recovery |
| 47 | + |
| 48 | +If Fluentd stops with the temporary buffer remained, you need to recover the buffer to launch Fluentd with source-only mode again. |
| 49 | + |
| 50 | +Note that a different path will be used each time unless you configure the temporary buffer path explicitly. |
| 51 | +In this case, you can recover the buffer as follows. |
| 52 | + |
| 53 | +1. Configure the remaining buffer path explicitly. |
| 54 | +1. Start Fluentd with source-only mode again. |
| 55 | +1. Send `SIGWINCH` to the supervisor to load the buffer. |
| 56 | + |
| 57 | +If this recovery is necessary, i.e., Fluentd stops with the temporary buffer remained, the following warning log will be displayed. |
| 58 | +You can confirm the path to configure by this log. |
| 59 | + |
| 60 | +``` |
| 61 | +[warn]: #0 some buffer files remain in /tmp/fluent/source-only-buffer/bbd9006d-bc41-418b-b346-f80888641dda. |
| 62 | +Please consider recovering or saving the buffer files in the directory. To recover them, you can set |
| 63 | +the buffer path manually to system config and retry, i.e., restart Fluentd with with-source-only mode |
| 64 | +and send SIGWINCH again. Config Example: |
| 65 | +<system> |
| 66 | + <source_only_buffer> |
| 67 | + path /tmp/fluent/source-only-buffer/bbd9006d-bc41-418b-b346-f80888641dda |
| 68 | + </source_only_buffer> |
| 69 | +</system> |
| 70 | +``` |
| 71 | + |
| 72 | +## Mechanism |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +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. |
0 commit comments