forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for deploying filebeat and metricbeat in Cloud Foun…
…dry. (elastic#17275) * Add running-on-cloudfoundry for filebeat. * Fix typo. * Add running on cloudfoundry for metricbeat. * Add changelog. * Add missing newline at end of metricbeat manifest. * Fix filebeat being referenced in metricbeat docs.
- Loading branch information
1 parent
20a4b13
commit e29d929
Showing
12 changed files
with
319 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,11 @@ | ||
# Beats Cloud Foundry manifests examples | ||
|
||
## Getting started | ||
|
||
This is the list of officially supported Beats, with example manifests to run | ||
them in Cloud Foundry: | ||
|
||
Beat | Description | ||
---- | ---- | ||
[filebeat](filebeat) | Ships logs from loggregator | ||
[metricbeat](metricbeat) | Ships metrics from loggregator |
This file contains 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,54 @@ | ||
#=========================== Filebeat inputs ============================= | ||
|
||
# Configure the input to access loggregator to forward the log events. | ||
|
||
filebeat.inputs: | ||
- &cloudfoundry | ||
type: cloudfoundry | ||
client_id: ${CLIENT_ID:filebeat} | ||
client_secret: ${CLIENT_SECRET:changeme} | ||
api_address: ${API_ADDRESS} | ||
#doppler_address: ${DOPPLER_ADDRESS} | ||
#uaa_address: ${UAA_ADDRESS} | ||
#rlp_address: ${RLP_ADDRESS} | ||
#shard_id: ${SHARD_ID} | ||
|
||
|
||
#================================ Outputs ===================================== | ||
|
||
# Configure the Elasticsearch output either to a specific host or using | ||
# Elastic Cloud. | ||
|
||
#-------------------------- Elasticsearch output ------------------------------ | ||
output.elasticsearch: | ||
# Array of hosts to connect to. | ||
hosts: ["${ELASTICSEARCH_OUTPUT}:9200"] | ||
|
||
# Protocol - either `http` (default) or `https`. | ||
#protocol: "https" | ||
|
||
# Authentication credentials - either API key or username/password. | ||
#api_key: "id:api_key" | ||
#username: "elastic" | ||
#password: "changeme" | ||
|
||
#----------------------------- Elastic Cloud ---------------------------------- | ||
|
||
# These settings simplify using Filebeat with the Elastic Cloud (https://cloud.elastic.co/). | ||
|
||
# The cloud.id setting overwrites the `output.elasticsearch.hosts` and | ||
# `setup.kibana.host` options. | ||
# You can find the `cloud.id` in the Elastic Cloud web UI. | ||
#cloud.id: | ||
|
||
# The cloud.auth setting overwrites the `output.elasticsearch.username` and | ||
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`. | ||
#cloud.auth: | ||
|
||
#================================ Processors ===================================== | ||
|
||
# Configure processors to enhance or manipulate events generated by the beat. | ||
|
||
processors: | ||
- add_cloudfoundry_metadata: | ||
<<: *cloudfoundry |
This file contains 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,10 @@ | ||
applications: | ||
- name: filebeat | ||
memory: 256M | ||
instances: 1 | ||
buildpacks: | ||
- binary_buildpack | ||
command: ./filebeat -e -c ~/filebeat.yml | ||
stack: cflinuxfs3 | ||
health-check-type: process | ||
no-route: true |
This file contains 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,10 @@ | ||
applications: | ||
- name: metricbeat | ||
memory: 256M | ||
instances: 1 | ||
buildpacks: | ||
- binary_buildpack | ||
command: ./metricbeat -e -c ~/metricbeat.yml | ||
stack: cflinuxfs3 | ||
health-check-type: process | ||
no-route: true |
This file contains 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,54 @@ | ||
#=========================== Metricbeat modules ============================= | ||
|
||
# Configure the module to forward metrics from loggregator. | ||
|
||
metricbeat.modules: | ||
- &cloudfoundry | ||
module: cloudfoundry | ||
client_id: ${CLIENT_ID} | ||
client_secret: ${CLIENT_SECRET} | ||
api_address: ${API_ADDRESS} | ||
#doppler_address: ${DOPPLER_ADDRESS} | ||
#uaa_address: ${UAA_ADDRESS} | ||
#rlp_address: ${RLP_ADDRESS} | ||
#shard_id: ${SHARD_ID} | ||
|
||
|
||
#================================ Outputs ===================================== | ||
|
||
# Configure the Elasticsearch output either to a specific host or using | ||
# Elastic Cloud. | ||
|
||
#-------------------------- Elasticsearch output ------------------------------ | ||
output.elasticsearch: | ||
# Array of hosts to connect to. | ||
hosts: ["${ELASTICSEARCH_OUTPUT}:9200"] | ||
|
||
# Protocol - either `http` (default) or `https`. | ||
#protocol: "https" | ||
|
||
# Authentication credentials - either API key or username/password. | ||
#api_key: "id:api_key" | ||
#username: "elastic" | ||
#password: "changeme" | ||
|
||
#----------------------------- Elastic Cloud ---------------------------------- | ||
|
||
# These settings simplify using Filebeat with the Elastic Cloud (https://cloud.elastic.co/). | ||
|
||
# The cloud.id setting overwrites the `output.elasticsearch.hosts` and | ||
# `setup.kibana.host` options. | ||
# You can find the `cloud.id` in the Elastic Cloud web UI. | ||
#cloud.id: | ||
|
||
# The cloud.auth setting overwrites the `output.elasticsearch.username` and | ||
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`. | ||
#cloud.auth: | ||
|
||
#================================ Processors ===================================== | ||
|
||
# Configure processors to enhance or manipulate events generated by the beat. | ||
|
||
processors: | ||
- add_cloudfoundry_metadata: | ||
<<: *cloudfoundry |
This file contains 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 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,80 @@ | ||
[[running-on-cloudfoundry]] | ||
=== Running {beatname_uc} on Cloud Foundry | ||
|
||
You can use {beatname_uc} on Cloud Foundry to retrieve and ship logs. | ||
|
||
ifeval::["{release-state}"=="unreleased"] | ||
|
||
However, version {version} of {beatname_uc} has not yet been | ||
released, no build is currently available for this version. | ||
|
||
endif::[] | ||
|
||
|
||
[float] | ||
==== Cloud Foundry credentials | ||
|
||
{beatname_uc} needs credentials created with UAA so it can connect to loggregator to receive the logs. The uaac | ||
command will create the required credentials for connecting to loggregator. | ||
|
||
["source", "sh"] | ||
------------------------------------------------ | ||
uaac client add {beatname_lc} --name {beatname_lc} --secret changeme --authorized_grant_types client_credentials,refresh_token --authorities doppler.firehose,cloud_controller.admin_read_only | ||
------------------------------------------------ | ||
|
||
[WARNING] | ||
======================================= | ||
*Use a unique secret:* The uaac command above is just an example and the secret should be changed and the | ||
`{beatname_lc}.yml` should be updated with your choosen secret. | ||
======================================= | ||
|
||
|
||
[float] | ||
==== Cloud Foundry deploy manifests | ||
|
||
You deploy {beatname_uc} as an application with no route. | ||
|
||
Cloud Foundry requires that 3 files exist inside of a directory to allow {beatname_uc} to be pushed. The commands | ||
below provide the basic steps for getting it up and running. | ||
|
||
["source", "sh", subs="attributes"] | ||
------------------------------------------------ | ||
curl -L -O https://artifacts.elastic.co/downloads/beats/{beatname_lc}/{beatname_lc}-{version}-linux-x86_64.tar.gz | ||
tar xzvf {beatname_lc}-{version}-linux-x86_64.tar.gz | ||
cd {beatname_lc}-{version}-linux-x86_64 | ||
curl -L -O https://raw.githubusercontent.com/elastic/beats/{branch}/deploy/cloudfoundry/{beatname_lc}/{beatname_lc}.yml | ||
# Update api_address, client_id, client_secret in downloaded {beatname_lc}. | ||
curl -L -O https://raw.githubusercontent.com/elastic/beats/{branch}/deploy/cloudfoundry/{beatname_lc}/manifest.yml | ||
------------------------------------------------ | ||
|
||
|
||
[float] | ||
==== Deploy | ||
|
||
To deploy {beatname_uc} to Cloud Foundry, run: | ||
|
||
["source", "sh", subs="attributes"] | ||
------------------------------------------------ | ||
cf push | ||
------------------------------------------------ | ||
|
||
To check the status, run: | ||
|
||
["source", "sh", subs="attributes"] | ||
------------------------------------------------ | ||
$ cf apps | ||
name requested state instances memory disk urls | ||
filebeat started 1/1 256M 1G | ||
------------------------------------------------ | ||
|
||
Log events should start flowing to Elasticsearch. The events are annotated with | ||
metadata added by the <<add-cloudfoundry-metadata>> processor. | ||
|
||
|
||
[WARNING] | ||
======================================= | ||
*Set shard_id to scale:* By default {beatname_uc} will generate a random `shard_id` when it starts. In the case that | ||
{beatname_uc} needs to be scaled passed 1 instance, be sure to set a static `shard_id`. Not setting a static `shard_id` | ||
will result in duplicate events being pushed to Elasticsearch. | ||
======================================= |
This file contains 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 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 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,80 @@ | ||
[[running-on-cloudfoundry]] | ||
=== Running {beatname_uc} on Cloud Foundry | ||
|
||
You can use {beatname_uc} on Cloud Foundry to retrieve and ship metrics. | ||
|
||
ifeval::["{release-state}"=="unreleased"] | ||
|
||
However, version {version} of {beatname_uc} has not yet been | ||
released, no build is currently available for this version. | ||
|
||
endif::[] | ||
|
||
|
||
[float] | ||
==== Cloud Foundry credentials | ||
|
||
{beatname_uc} needs credentials created with UAA so it can connect to loggregator to receive the logs. The uaac | ||
command will create the required credentials for connecting to loggregator. | ||
|
||
["source", "sh"] | ||
------------------------------------------------ | ||
uaac client add {beatname_lc} --name {beatname_lc} --secret changeme --authorized_grant_types client_credentials,refresh_token --authorities doppler.firehose,cloud_controller.admin_read_only | ||
------------------------------------------------ | ||
|
||
[WARNING] | ||
======================================= | ||
*Use a unique secret:* The uaac command above is just an example and the secret should be changed and the | ||
`{beatname_lc}.yml` should be updated with your choosen secret. | ||
======================================= | ||
|
||
|
||
[float] | ||
==== Cloud Foundry deploy manifests | ||
|
||
You deploy {beatname_uc} as an application with no route. | ||
|
||
Cloud Foundry requires that 3 files exist inside of a directory to allow {beatname_uc} to be pushed. The commands | ||
below provide the basic steps for getting it up and running. | ||
|
||
["source", "sh", subs="attributes"] | ||
------------------------------------------------ | ||
curl -L -O https://artifacts.elastic.co/downloads/beats/{beatname_lc}/{beatname_lc}-{version}-linux-x86_64.tar.gz | ||
tar xzvf {beatname_lc}-{version}-linux-x86_64.tar.gz | ||
cd {beatname_lc}-{version}-linux-x86_64 | ||
curl -L -O https://raw.githubusercontent.com/elastic/beats/{branch}/deploy/cloudfoundry/{beatname_lc}/{beatname_lc}.yml | ||
# Update api_address, client_id, client_secret in downloaded {beatname_lc}. | ||
curl -L -O https://raw.githubusercontent.com/elastic/beats/{branch}/deploy/cloudfoundry/{beatname_lc}/manifest.yml | ||
------------------------------------------------ | ||
|
||
|
||
[float] | ||
==== Deploy | ||
|
||
To deploy {beatname_uc} to Cloud Foundry, run: | ||
|
||
["source", "sh", subs="attributes"] | ||
------------------------------------------------ | ||
cf push | ||
------------------------------------------------ | ||
|
||
To check the status, run: | ||
|
||
["source", "sh", subs="attributes"] | ||
------------------------------------------------ | ||
$ cf apps | ||
name requested state instances memory disk urls | ||
metricbeat started 1/1 256M 1G | ||
------------------------------------------------ | ||
|
||
Metrics should start flowing to Elasticsearch. The events are annotated with | ||
metadata added by the <<add-cloudfoundry-metadata>> processor. | ||
|
||
|
||
[WARNING] | ||
======================================= | ||
*Set shard_id to scale:* By default {beatname_uc} will generate a random `shard_id` when it starts. In the case that | ||
{beatname_uc} needs to be scaled passed 1 instance, be sure to set a static `shard_id`. Not setting a static `shard_id` | ||
will result in duplicate events being pushed to Elasticsearch. | ||
======================================= |
This file contains 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