Search

Chapter 2. Installing and configuring the resource-optimization components

download PDF

Installing resource optimization involves installing packages, configuring settings and enabling local services. This can be done manually, or with an Ansible playbook provided by Red Hat.

Note

Pay as you go (PAYG) customers need to register the Insights client with subscription-manager (RHSM). There are two ways to register with subscription-manager:

  • Using activation keys (recommended)
  • Using your user name and password

For more information about how to register the Insights client, refer to Client Configuration Guide for Red Hat Insights.

Table 2.1. Compatibility information
RHEL VersionsCloud ProviderResource Optimization Compatibility

8.x-9.x

AWS

Yes (x86_64 and ARM 64-bit)

7.7-7.9

AWS

Yes (x86_64 and ARM 64-bit)

7.0-7.6

AWS

No

6.x

AWS

No

Prerequisites

The following applications and configurations need to be installed or confirmed before the resource optimization service can be used:

  • Cloud marketplace RHEL instance is configured.
  • The Insights client is installed on the system and is operational.
  • If you want to use Ansible to install or uninstall the resource optimization service:

    • The Ansible repository is enabled and the Ansible client is installed on each system.
    • The system administrator can run Ansible Playbooks.

2.1. Installing resource-optimization components

There are a few options for installing resource-optimization components. Choose whichever works with your Ansible workflow.

2.1.1. Installing Ansible and running the resource-optimization installation playbook

The use of Ansible is recommended to expedite the installation process. This procedure installs the Ansible client and runs the Ansible Playbook on your system.

Cloud marketplace images on Amazon Web Services (AWS) are configured to use repositories hosted by the cloud provider. Currently, these repositories do not contain the Ansible client, so you must perform the following steps to enable the Ansible repository on your cloud marketplace - managed RHEL system.

Note

On RHEL 8.6 and later, and RHEL 9.0, Red Hat recommends using Ansible Core. For more information, see Updates to using Ansible in RHEL 8.6 and 9.0.

Prerequisites

  • On RHEL 8, the Ansible repository is enabled.

Procedure on RHEL 8

  1. Install Ansible:

    # yum install ansible -y

Procedure on RHEL 7

  1. Enable the Subscription-Manager repository and register the system

    # subscription-manager config --rhsm.manage_repos=1
    # subscription-manager register
  2. Optionally, attach your system to a subscription pool

    # subscription-manager attach --pool xxxxxxxx
  3. Enable the required Ansible repository.

    # subscription-manager repos --enable=rhel-7-server-ansible-2.9-rpms
  4. Install Ansible:

    # yum install ansible -y
  5. If you are using RHEL PAYG and want to use RHUI update servers only, disable the Subscription-Manager repository:

    # subscription-manager config --rhsm.manage_repos=0

2.1.2. Installing resource optimization when Ansible is already installed

Once Ansible is installed, proceed to complete the installation of the resource optimization service.

Procedure

  1. Download the Ansible Playbook with the following command:

    $ curl -O https://raw.githubusercontent.com/RedHatInsights/ros-backend/v2.0/ansible-playbooks/ros_install_and_set_up.yml
  2. Set localhost in Ansible inventory by appending the line localhost to /etc/ansible/hosts.
  3. Run the Ansible Playbook:

    # ansible-playbook -c local ros_install_and_set_up.yml

The system will show in Insights immediately in a "Waiting for data" state, and data and suggestions will be available the day after registering.

Verification step

Data files with a timestamp will appear under /var/log/pcp/pmlogger/ros and after a few minutes, you can verify metrics are being collected:

$ ls -l /var/log/pcp/pmlogger/ros
$ pmlogsummary /var/log/pcp/pmlogger/ros/

2.1.3. Installing resource optimization without installing or using Ansible

Procedure

If you choose not to use Ansible for installation, use the following manual installation procedure: . Ensure the latest version of insights-client is installed.

$ yum update insights-client
  1. Set core_collect=True in /etc/insights-client/insights-client.conf
  2. Install the Performance Co-Pilot (PCP) toolkit.

    $ sudo yum install pcp
  3. Create the PCP configuration file /var/lib/pcp/config/pmlogger/config.ros with this content:

    log mandatory on default {
      hinv.ncpu
      mem.physmem
      mem.util.available
      disk.dev.total
      kernel.all.cpu.idle
      kernel.all.pressure.cpu.some.avg
      kernel.all.pressure.io.full.avg
      kernel.all.pressure.io.some.avg
      kernel.all.pressure.memory.full.avg
      kernel.all.pressure.memory.some.avg
    }
    [access]
    disallow .* : all;
    disallow :* : all;
    allow local:* : enquire;
  4. To configure pmlogger to gather the metrics required by resource optimization, add this line to /etc/pcp/pmlogger/control.d/local:

    LOCALHOSTNAME	n   n	PCP_LOG_DIR/pmlogger/ros	-r -T24h10m -c config.ros -v 100Mb
    Note

    In previous versions of this procedure, this line began with LOCALHOSTNAME n y. The procedure now advises that you use LOCALHOSTNAME n n, which disables the usage of pmsocks. For more information about pmsocks, refer to the man page for pmsocks.

  5. Start and enable the required PCP services.

    $ sudo systemctl enable pmcd pmlogger
    $ sudo systemctl start pmcd pmlogger
  6. Re-register insights-client and upload the archive. The system will show in Insights immediately in a "Waiting for data" state, and data and suggestions will be available the day after registering.

    $ sudo insights-client --register

Verification step

Data files with a timestamp will appear under /var/log/pcp/pmlogger/ros and after a few minutes, you can verify metrics are being collected:

$ ls -l /var/log/pcp/pmlogger/ros
$ pmlogsummary /var/log/pcp/pmlogger/ros/

2.2. Enabling Kernel Pressure Stall Information (PSI)

PSI provides a canonical way to see resource pressure increases as they develop. There are pressure metrics for three major resources: memory, CPU, and input/output (I/O). PSI is available on RHEL 8 and newer versions, and is disabled by default.

When PSI is enabled, the resource optimization service can augment its findings and provide more details and better suggestions. Enabling PSI is strongly recommended to identify peaks.

Procedure

  1. Edit the /etc/default/grub file and append psi=1 at the end of the GRUB_CMDLINE_LINUX line (mind the quotes).
  2. Regenerate the grub configuration file.

    $ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
  3. Reboot the system.
Note

Enabling PSI incurs in a slight (<1%) performance hit.

Verification step

When PSI is enabled, files for CPU, memory and IO appear under /proc/pressure.

2.3. Enabling notifications and integrations in the resource optimization service

You can enable the notifications service on Red Hat Hybrid Cloud Console to send notifications whenever the resource optimization service detects an issue and generates a suggestion. Using the notifications service frees you from having to continually check the Red Hat Insights for Red Hat Enterprise Linux dashboard for recommendations.

For example, you can configure the notifications service to automatically send an email message whenever the resource optimization service generates a suggestion.

Enabling the notifications service requires three main steps:

  • First, an Organization Administrator creates a User access group with the Notifications administrator role, and then adds account members to the group.
  • Next, a Notifications administrator sets up behavior groups for events in the notifications service. Behavior groups specify the delivery method for each notification. For example, a behavior group can specify whether email notifications are sent to all users, or just to Organization administrators.
  • Finally, users who receive email notifications from events must set their user preferences so that they receive individual emails for each event.

In addition to sending email messages, you can configure the notifications service to pull event data in other ways:

  • Using an authenticated client to query Red Hat Insights APIs for event data.
  • Using webhooks to send events to third-party applications that accept inbound requests.
  • Integrating notifications with applications such as Splunk to route resource optimization recommendations to the application dashboard.

Additional resources

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.