-
Notifications
You must be signed in to change notification settings - Fork 135
source-only mode: add initial document #527
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Source Only Mode | ||
|
||
Since v1.18.0, Fluentd can launch with source-only mode. | ||
(Not supported on Windows) | ||
|
||
* In this mode, only input plugins run. | ||
* During this mode, the events are stored in a temporary file buffer. | ||
* Sending `SIGWINCH` to the supervisor cancels this mode. | ||
* Then, all plugins start to run, and the temporary file buffer starts to load. | ||
|
||
## How to launch Fluentd with source-only mode | ||
|
||
You can launch Fluentd with source-only mode in the following ways. | ||
|
||
* [Command Line Option - --with-source-only](command-line-option.md) | ||
* [System Configuration - with_source_only](system-config.md#with_source_only) | ||
|
||
## Temporary file buffer | ||
|
||
During source-only mode, the ingested events are stored in a temporary file buffer. | ||
After `SIGWINCH` is sent to the supervisor and this mode is canceled, this buffer begins to load. | ||
|
||
By default, the file buffer path is as follows. | ||
|
||
* `/tmp/fluent/source-only-buffer/{Unique ID for the Fluentd instance}` | ||
|
||
You can confirm it in the following log output at startup. | ||
|
||
``` | ||
[info]: #0 with-source-only: the emitted data will be stored in the buffer files under | ||
/tmp/fluent/source-only-buffer/bbd9006d-bc41-418b-b346-f80888641dda. You can send SIGWINCH to | ||
the supervisor process to cancel with-source-only mode and process data. | ||
``` | ||
|
||
This file buffer is the buffer of [out_buffer](../output/buffer.md). | ||
It works with the default settings of `out_buffer` except for the following points: | ||
|
||
* `path` is automatically determined by default. | ||
* `overflow_action` is `drop_oldest_chunk` by default. | ||
|
||
If needed, you can configure some options for the buffer in System Configuration. | ||
Please see the following for details. | ||
|
||
* [System Configuration - source_only_buffer section](system-config.md#less-than-source_only_buffer-greater-than-section). | ||
|
||
### Recovery | ||
|
||
If Fluentd stops with the temporary buffer remained, you need to recover the buffer to launch Fluentd with source-only mode again. | ||
|
||
Note that a different path will be used each time unless you configure the temporary buffer path explicitly. | ||
In this case, you can recover the buffer as follows. | ||
|
||
1. Configure the remaining buffer path explicitly. | ||
1. Start Fluentd with source-only mode again. | ||
1. Send `SIGWINCH` to the supervisor to load the buffer. | ||
|
||
If this recovery is necessary, i.e., Fluentd stops with the temporary buffer remained, the following warning log will be displayed. | ||
You can confirm the path to configure by this log. | ||
|
||
``` | ||
[warn]: #0 some buffer files remain in /tmp/fluent/source-only-buffer/bbd9006d-bc41-418b-b346-f80888641dda. | ||
Please consider recovering or saving the buffer files in the directory. To recover them, you can set | ||
the buffer path manually to system config and retry, i.e., restart Fluentd with with-source-only mode | ||
and send SIGWINCH again. Config Example: | ||
<system> | ||
<source_only_buffer> | ||
path /tmp/fluent/source-only-buffer/bbd9006d-bc41-418b-b346-f80888641dda | ||
</source_only_buffer> | ||
</system> | ||
``` | ||
|
||
## Mechanism | ||
|
||
 | ||
|
||
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# buffer | ||
|
||
The `buffer` output plugin buffers and re-labels events. | ||
This plugin is similar to [out_relabel](relabel.md), but uses [buffer](../buffer/). | ||
|
||
It is included in Fluentd's core (since v1.18.0). | ||
|
||
## Example Configuration | ||
|
||
``` | ||
<source> | ||
@type udp | ||
@label @buffer | ||
tag foo.udp | ||
<parse> | ||
@type none | ||
</parse> | ||
</source> | ||
|
||
<label @buffer> | ||
<match **> | ||
@type buffer | ||
@label @ROOT | ||
<buffer> | ||
path /path/to/buffer | ||
</buffer> | ||
</match> | ||
</label> | ||
|
||
<match foo.**> | ||
@type stdout | ||
</match> | ||
``` | ||
|
||
In the above example, events ingested by `in_udp` are once stored in the buffer of this plugin, then re-routed and output by `out_stdout`. | ||
|
||
## Supported Modes | ||
|
||
* Synchronous Buffered | ||
|
||
See also: [Output Plugin Overview](./) | ||
|
||
## Plugin Helpers | ||
|
||
* [`event_emitter`](../plugin-helper-overview/api-plugin-helper-event_emitter.md) | ||
|
||
## Parameters | ||
|
||
[Common Parameters](../configuration/plugin-common-parameters.md) | ||
|
||
### `@type` \(required\) | ||
|
||
The value must be `buffer`. | ||
|
||
### `@label` \(required\) | ||
|
||
| type | default | version | | ||
| :--- | :--- | :--- | | ||
| string | `nil` | 1.18.0 | | ||
|
||
Specifies the label to re-route. | ||
|
||
Note: You can specify `@ROOT` to re-route to the root. | ||
|
||
### `<buffer>` Section | ||
|
||
#### `path` \(required\) | ||
|
||
| type | default | version | | ||
| :--- | :--- | :--- | | ||
| string | required parameter | 1.18.0 | | ||
|
||
#### `@type` | ||
|
||
| type | default | version | | ||
| :--- | :--- | :--- | | ||
| string | file | 1.18.0 | | ||
|
||
Overwrites the default value in this plugin. | ||
|
||
#### `chunk_keys` | ||
|
||
| type | default | version | | ||
| :--- | :--- | :--- | | ||
| array | tag | 1.18.0 | | ||
|
||
Overwrites the default value in this plugin. | ||
|
||
#### `flush_mode` | ||
|
||
| type | default | version | | ||
| :--- | :--- | :--- | | ||
| enum | interval | 1.18.0 | | ||
|
||
Overwrites the default value in this plugin. | ||
|
||
#### `flush_interval` | ||
|
||
| type | default | version | | ||
| :--- | :--- | :--- | | ||
| integer | 10 | 1.18.0 | | ||
|
||
Overwrites the default value in this plugin. | ||
|
||
#### Common Buffer / Output parameters | ||
|
||
In addition, you can configure other common settings. | ||
Please see the followings for details. | ||
|
||
* [Buffer Section Configurations](../configuration/buffer-section.md) | ||
* [Buffer Plugin Overview](../buffer/) | ||
* [Output Plugin Overview](./) | ||
|
||
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. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.