-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Directory layout and data path #1371
Comments
I like the proposal. You state Could it make sense to add these also as configuration option to the config file? This would allow to run For the data directory, should we add it to the git repository but ignore all files inside? |
Yep, fixed :-).
Yeah, they are configuration options, see #1373. The plan is that after elastic/go-ucfg#15 is implemented, they will only be configuration file options, which can be overwritten from the command line.
I'll add |
* Follows the layout as defined in elastic#1371, setting path.home, path.config and path.data * This removes the need to adjust the configuration file
This adds the `-path.logs` CLI flag and corresponding config file setting. By default it's set to `{path.home}/logs`. The rotating file writer now writes to this path by default. For DEB/RPM, the logs path is set to `/var/log/{beatname}` which matches the previous default location. However, this is a breaking change because the previous default was to send the logs to syslog. Part of elastic#1371.
For Deb and Rpm installations. This makes it easy to run the Beat in foreground, while still being executed with the write paths. Part of elastic#1371.
This adds the `-path.logs` CLI flag and corresponding config file setting. By default it's set to `{path.home}/logs`. The rotating file writer now writes to this path by default. For DEB/RPM, the logs path is set to `/var/log/{beatname}` which matches the previous default location. However, this is a breaking change because the previous default was to send the logs to syslog. * Added path.logs and made logging to files the default * Updated CHANGELOG * Removed unreachable code Part of #1371.
For Deb and Rpm installations. This makes it easy to run the Beat in foreground, while still being executed with the write paths. * Fix postinst script * Added beatname.sh in /usr/bin Part of #1371.
All PRs merged, yohoo! |
This a meta issue for the tasks required to support a "data path" in Beats.
The end goal is to have:
The following configurable "paths" are introduced:
{binary directory}
{path.home}/data
{path.home}
{path.home}/logs
This is modeled after Elasticsearch directory layout with some differences:
path.config
has the same default aspath.home
. This is because in beats we don't have aconfig/
folder, and introducing one would be difficult because we have aconfig
package.Directory layouts
Illustrating these with Filebeat.
ZIP / TAR.GZ / TGZ
When running directly under the tarball archives, everything is relative to the binary location. This also matches the organization of the source code repository, so things should work the same when running from a source checkout.
To run, you typically just start with:
./filebeat
DEB/RPM
Debian/Centos packages have their home path set to
/usr/share/filebeat
and their data path set to/var/lib/filebeat
, to match current installations.The init scripts, start filebeat with:
The downside of moving the binary out of /usr/bin is that it gets a bit more complex to run in foreground from an installed system. This is because the binary is not in the system
PATH
anymore and because the data path and config paths need to be set correctly. We could mitigate this by providing a shell script in/usr/bin
.Windows
On Windows there are two options. Either run directly from the unzipped directory, in which case everything works as for the tar/zip case, or you install as a service. If you install as a service, the data path is set to
c:\ProgramData\filebeat
, so the we have the following structure:The service will start filebeat with:
This is not ideal yet, but matches pretty much what we have so far, fixes the automatic template loading and can be improved when we get a real Windows installer.
Required changes
-path.home
. Added home, data, config paths #1373-path.data
. Added home, data, config paths #1373-path.config
Added home, data, config paths #1373-path.logs
(lower prio). Added path.logs and made logging to files the default #1437.filebeat
to{data_path}/registry
Added home, data, config paths #1373/usr/share/{beatname}
. Update packaging #1385kibana
folder for all platforms. Install the etc/kibana dir in the home directory #1399namebeat.sh
scripts to/usr/bin
to make it easy to run beats in foreground. Added beatname.sh in /usr/bin #1446The text was updated successfully, but these errors were encountered: