Step 5: Start Metricbeat

edit

Run Metricbeat by issuing the appropriate command for your platform. If you are accessing a secured Elasticsearch cluster, make sure you’ve configured credentials as described in Step 2: Configure Metricbeat.

If you use an init.d script to start Metricbeat on deb or rpm, you can’t specify command line flags (see Command reference). To specify flags, start Metricbeat in the foreground.

deb and rpm:

sudo service metricbeat start

docker:

See Run Metricbeat on Docker.

mac and linux:

sudo chown root metricbeat.yml 
sudo chown root modules.d/system.yml 
sudo ./metricbeat -e

You’ll be running Metricbeat as root, so you need to change ownership of the configuration file and any configurations enabled in the modules.d directory, or run Metricbeat with --strict.perms=false specified. See Config File Ownership and Permissions in the Beats Platform Reference.

brew:

To have launchd start elastic/tap/metricbeat and then restart it at login, run:

brew services start elastic/tap/metricbeat-full

To run Metricbeat in the foreground instead of running it as a background service, run:

sudo chown root /usr/local/etc/metricbeat/metricbeat.yml 
sudo chown root /usr/local/etc/metricbeat/modules.d/system.yml 
sudo metricbeat -e

You’ll be running Metricbeat as root, so you need to change ownership of the configuration file and any configurations enabled in the modules.d directory, or run Metricbeat with --strict.perms=false specified. See Config File Ownership and Permissions in the Beats Platform Reference.

win:

PS C:\Program Files\Metricbeat> Start-Service metricbeat

By default the log files are stored in C:\ProgramData\metricbeat\Logs.

On Windows, statistics about system load and swap usage are currently not captured.

Test the Metricbeat installation

edit

To verify that your server’s statistics are present in Elasticsearch, issue the following command:

curl -XGET 'http://localhost:9200/metricbeat-*/_search?pretty'

Make sure that you replace localhost:9200 with the address of your Elasticsearch instance.

On Windows, if you don’t have cURL installed, simply point your browser to the URL.