newrelic / infrastructure-agent

New Relic Infrastructure Agent
https://docs.newrelic.com/docs/infrastructure/install-configure-manage-infrastructure
Apache License 2.0
138 stars 128 forks source link

Installation on Amazon Linux 1 not possible #412

Closed Junkern closed 3 years ago

Junkern commented 3 years ago

Installation on Amazon Linux 1 not possible

Description

I am trying to install the newrelic infrastructure agent on ec2 hosts running with Amazon Linux 1 (Amazon Linux AMI 2018.03) in order to monitor services running in an ECS cluster.

There is a nice documentation here, but this does not work. Amazon Linux 1 does not support systemctl, but the installation instruction only mention systemctl. Would it make sense to update the documentation?

Then I found this: https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk/ (we are not using Elastic Beanstalk, but the process on installing the agent is the same) When executing the second installation step (yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra') I get the error posted in the troubleshooting section. While looking for solutions for the Not using downloaded repomd.xml because it is older than what we have error most solutions suggested to contact the upstream repository.

Expected Behavior

The documentation on https://docs.newrelic.com/docs/integrations/host-integrations/host-integrations-list/monitor-services-running-amazon-ecs leads to a working newrelic infrastructure agent

Logs

Failed to set locale, defaulting to C
Not using downloaded repomd.xml because it is older than what we have:
  Current   : Mon Apr 26 12:52:39 2021
  Downloaded: Mon Apr 26 12:52:27 2021
https://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64/repodata/88ab6190248f3fa84385c80ad94c927039817ae6-other.sqlite.bz2: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

https://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64/repodata/94f7f18b502135753dbc575919fb294286310168-filelists.sqlite.bz2: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
https://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64/repodata/94f7f18b502135753dbc575919fb294286310168-filelists.sqlite.bz2: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.

 One of the configured repositories failed (New Relic Infrastructure),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable newrelic-infra

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=newrelic-infra.skip_if_unavailable=true

failure: repodata/94f7f18b502135753dbc575919fb294286310168-filelists.sqlite.bz2 from newrelic-infra: [Errno 256] No more mirrors to try.
https://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64/repodata/94f7f18b502135753dbc575919fb294286310168-filelists.sqlite.bz2: [Errno 14] HTTPS Error 404 - Not Found

Steps to Reproduce

Follow the https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk/ to the second step in the Amazon Linux AMI section

Your Environment

$ cat /etc/os-release
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Junkern commented 3 years ago

I found a "workaround":

sudo curl https://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64/newrelic-infra-1.9.7-1.x86_64.rpm -o newrelic-infra-agent.rpm
sudo yum install -y newrelic-infra-agent.rpm 

However, this seems a bit hacky for me, especially since the official documentations propose different processes (which do not work...)

josemore commented 3 years ago

Note that Amazon Linux 1 has reached EOL: https://aws.amazon.com/blogs/aws/update-on-amazon-linux-ami-end-of-life/

Junkern commented 3 years ago

Yeah, I was already aware of that :) I don't think that has any impact on this issue, though. My gut feeling tells me that there are probably quite a few people stuck with Amazon Linux 1 (for whatever reasons). IMHO, the EOL of Amazon Linux 1 should have no effect on a nice (and working) installation documentation. They probably did not introduce systemctl after the EOL announcement ;)

josemore commented 3 years ago

The Amazon Linux 1 install instructions are still accessible from this documentation page: https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/install-infrastructure-monitoring-agent-linux/ (click on Amazon Linux, then select your account and AML 1). Hope that helps.

Junkern commented 3 years ago

Thanks for the link! I also saw that documentation and tried it out. As described above, it did not work, though! the sudo yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra' leads to a Not using downloaded repomd.xml because it is older than what we have: (You can read the full error description in my first post).