The DEB and RPM packages include a service unit for Linux systems with systemd. On these systems, you can manage APM Server by using the usual systemd commands.
We recommend that the apm-server process is run as a non-root user. Therefore, that is the default setup for APM Server’s DEB package and RPM installation.
systemctl to start or stop APM Server:
sudo systemctl start apm-server
sudo systemctl stop apm-server
By default, the APM Server service starts automatically when the system boots. To enable or disable auto start use:
sudo systemctl enable apm-server
sudo systemctl disable apm-server
To get the service status, use
systemctl status apm-server
Logs are stored by default in journald. To view the Logs, use
journalctl -u apm-server.service
Customize systemd unit for APM Serveredit
The systemd service unit file includes environment variables that you can override to change the default options.
Flags for configuration file path
You can use
BEAT_LOG_OPTS to set debug selectors for logging. However,
to configure logging behavior, set the logging options described in
To override these variables, create a drop-in unit file in the
For example a file with the following content placed in
BEAT_LOG_OPTS to enable debug for Elasticsearch output.
[Service] Environment="BEAT_LOG_OPTS=-d elasticsearch"
To apply your changes, reload the systemd configuration and restart the service:
systemctl daemon-reload systemctl restart apm-server
It is recommended that you use a configuration management tool to
include drop-in unit files. If you need to add a drop-in manually, use
systemctl edit apm-server.service.
On systems with POSIX file permissions, the APM Server configuration file is subject to ownership and file permission checks. These checks prevent unauthorized users from providing or modifying configurations that are run by APM Server.
When installed via an RPM or DEB package,
the configuration file at
/etc/apm-server/apm-server.yml will be owned by
and have file permissions of
APM Server will only start if the configuration file is owned by the user running the process,
or by running as root with configuration ownership set to
You may encounter the following errors if your configuration file fails these checks:
Exiting: error loading config file: config file ("/etc/apm-server/apm-server.yml") must be owned by the user identifier (uid=1000) or root
To correct this problem you can change the ownership of the configuration file with:
chown apm-server:apm-server /etc/apm-server/apm-server.yml.
You can also make root the config owner, although this is not recommended:
sudo chown root:root /etc/apm-server/apm-server.yml.
Exiting: error loading config file: config file ("/etc/apm-server/apm-server.yml") can only be writable by the owner but the permissions are "-rw-rw-r--" (to fix the permissions use: 'chmod go-w /etc/apm-server/apm-server.yml')
To correct this problem, use
chmod go-w /etc/apm-server/apm-server.yml to
remove write privileges from anyone other than the owner.
You can disable strict permission checks from the command line by using
--strict.perms=false, but we strongly encourage you to leave the checks enabled.
Intro to Kibana
ELK for Logs & Metrics