Installing collectd Add-on for PCF

This topic describes how to add collectd to your Pivotal Cloud Foundry (PCF) deployment.

About collectd Add-on for PCF

This add-on is required to enable the Altoros Heartbeat monitoring solution to consume system metrics from the VMs that make up a PCF deployment. The collectd Add-on gathers VM metrics from PCF platform components and any other BOSH-deployed services, such as databases, and makes this information available to Altoros Heartbeat over the network.

Prerequisites

Note: collectd Add-on for PCF does not work on Windows machines.

To complete the collectd Add-on installation:

  • You must be a PCF operator with admin rights. For more information, see Understanding Pivotal Cloud Foundry User Types.
  • You must have Pivotal Operations Manager (Ops Manager) v1.10 or later.
  • Ensure you have at least 128 MB of memory free on each VM before deploying collectd Add-on. The collectd Add-on uses 50 MB of memory.

Create a collectd Manifest

A collectd manifest is a YML file that contains runtime configuration information for the collectd Add-on. Follow the steps below to create a collectd manifest for your deployment:

  1. Create a file named collectd.yml, starting with the code below as a template:

    releases:
    - name: collectd
      version: xx.x.x
    addons:
    - name: collectd
      jobs:
      - name: collectd
        release: collectd
      exclude:
        deployments: ['some-deployment-name-to-exclude']
      properties:
        collectd:
          graphite_prefix: cf.collectd.
          graphite_servers:
          - 192.168.1.190
          interval: 10
    

  2. Replace the values listed in the template as follows:

  • exclude: deployments: (Optional) Specify the name of the deployment to mass exclude from the collectd Add-on coverage.

    Note: If this functionality is not required, remove this section.

  • releases: version: Use the version of the collectd Add-on downloaded from Pivotal Network.

  • collectd: graphite_prefix: Do not change the graphite_prefix name. It must be cf.collectd..

  • collectd: graphite_servers: If you are using Heartbeat in high availability (HA) mode, use your load balancer endpoint for collectd. For details, see External Load Balancer configuration. If you are not going to use HA mode, use the IP address of any of Altoros Heartbeat’s back-ends. For details, see Finding Back-End IPs.

  • collectd: interval: You can modify the default 10-second interval value. This value specifies how often the collectd Add-on gathers metrics from VMs.

Download and Deploy the collectd Add-on

  1. Download the collectd Add-on software binary from Pivotal Network to your local machine.

  2. Copy the software binary to your Ops Manager VM.

    $ scp -i PATH/TO/PRIVATE/KEY collectd-xx.x.x.tgz ubuntu@YOUR-OPS-MANAGER-VM-IP:
  3. Copy the collectd manifest, collectd.yml file, to your Ops Manager instance.

    $ scp -i PATH/TO/PRIVATE/KEY collectd.yml ubuntu@YOUR-OPS-MANAGER-VM-IP:
  4. SSH into Ops Manager.

    $ ssh -i PATH-TO-PRIVATE-KEY ubuntu@YOUR-OPS-MANAGER-VM-IP
  5. On the Ops Manager VM, navigate to the software binary location.

    $ cd PATH-TO-BINARY

If you are using PCF v1.11 or later, follow the BOSH CLI v2 procedures to deploy the collectd Add-on.

If you are using PCF v1.10, follow the BOSH CLI v1 procedures to deploy the collectd Add-on.

Deploy the collectd Add-on with the BOSH CLI v2

  1. On the Ops Manager VM, log in to the BOSH Director.

  2. Upload your release, specifying the path to the tarballed collectd binary. For example:

    $ bosh2 -e my-env upload-release collectd-xx.x.x.tgz
  3. List the releases and confirm that collectd appears. For example:

    $ bosh2 -e my-env releases
  4. Update your runtime configuration to include the collectd Add-on, specifying the path to the collectd.yml file you created above. For example:

    Note: If you installed other BOSH add-ons, you must merge the collectd manifest into your existing add-on manifest. Append the contents of collectd.yml to your existing add-on YML file.

    $ bosh2 -e my-env update-runtime-config collectd.yml
  5. Verify your runtime configuration changes match what you specified in the collectd manifest. For example:

    $ bosh2 -e my-env runtime-config
    releases:
    - name: collectd
      version: xx.x.x
    
    addons:
    - name: collectd
      jobs:
      - name: collectd
        release: collectd
    ...
    
  6. Navigate to your Installation Dashboard in Ops Manager.

  7. Click Apply Changes.

Deploy the collectd Add-on with the BOSH CLI v1

  1. On the Ops Manager VM, log in to the BOSH Director.

  2. Upload the release.

    $ bosh upload release collectd-xx.x.x.tgz
  3. From the command line, confirm that the upload of the collectd software binary completed. You should see the collectd release.

    $ bosh releases
  4. Update your runtime configuration to include the collectd Add-on.

    Note: If you installed other BOSH add-ons, you must merge the collectd manifest into your existing add-on manifest. Append the contents of collectd.yml to your existing add-on YML file.

    $ bosh update runtime-config collectd.yml
  5. Verify your runtime configuration changes match what you specified in the collectd manifest.

    $ bosh runtime-config
    Acting as user 'director' on 'p-bosh'
    releases:
    - name: collectd
      version: xx.x.x
    
    addons:
    - name: collectd
      jobs:
      - name: collectd
        release: collectd
    ...
    
  6. Navigate to your Installation Dashboard in Ops Manager.

  7. Click Apply Changes.

Verify the Installation

  1. BOSH SSH into one of the VMs in your deployment.

  2. Run monit summary. Look for the following processes in the output:

    The Monit daemon 5.2.4 uptime: 3d 0h 01m
    Process 'collectd' running
  3. If monit summary does not list collectd, perform the following steps:

    1. Try to start the collectd processes by running the following command:
      $ monit start collectd
    2. Run the monit summary again. If you do not see the processes mentioned above, check /var/vcap/sys/log/collectd logs for errors.

Uninstall the collectd Add-on

Follow the steps below to remove the collectd Add-on from your existing runtime config and roll back to a previous configuration:

  1. SSH into Ops Manager.

    $ ssh -i PATH-TO-PRIVATE-KEY ubuntu@YOUR-OPS-MANAGER-VM-IP
  2. On the Ops Manager VM, retrieve the latest runtime configuration saved on the BOSH Director.

    1. If you are using PCF v1.10, use the BOSH CLI v1 command:
      $ bosh runtime-config > PATH-TO-SAVE-THE-RUNTIME-CONFIG
    2. If you are using PCF v1.11 or later, use the BOSH CLI v2 command:
      $ bosh2 -e my-env runtime-config > PATH-TO-SAVE-THE-RUNTIME-CONFIG
  3. From the file you retrieved above, delete the lines that were added at the Create a collectd Manifest step.

  4. Update the runtime configuration.

    1. If you are using PCF v1.10, use the BOSH CLI v1 command:
      $ bosh update runtime-config PATH-TO-SAVE-THE-RUNTIME-CONFIG
    2. If you are using PCF v1.11 or later, use the BOSH CLI v2 command:
      $ bosh2 -e my-env update-runtime-config PATH-TO-SAVE-THE-RUNTIME-CONFIG
  5. Navigate to your Installation Dashboard in Ops Manager.

  6. Click Apply Changes.

If you have no existing runtime configuration, follow the steps below:

  1. On the Ops Manager VM, create an empty-runtime.yml manifest file.

    $ cat empty-runtime.yml
    releases: []
  2. Update the runtime configuration with the empty-runtime.yml file.

    1. If you are using PCF v1.10, use the BOSH CLI v1 command:
      $ bosh update runtime-config empty-runtime.yml
    2. If you are using PCF v1.11 or later, use the BOSH CLI v2 command:
      $ bosh2 -e my-env update-runtime-config empty-runtime.yml
  3. Navigate to your Installation Dashboard in Ops Manager.

  4. Click Apply Changes.

The collectd Add-on will be removed from your deployment.

Create a pull request or raise an issue on the source for this page in GitHub