请确认是否可以在PowerVS的Linux(CentOS)上安装Sysdig Agent

在确认是否可以使用IBM Cloud Monitoring with Sysdig来监视PowerVS (Power Systems Virtual Server)时,我们验证了是否可以在PowerVS的Linux(CentOS)上安装Sysdig agent。

[参考] 部署监控代理

Sysdig Agent 安装的要求:
https://docs.sysdig.com/zh/host-requirements-for-agent-installation.html

关于Sysdig的要求,CentOS和RHEL都是支持的操作系统,但没有提及AIX和SUSE。
这次我们将确认CentOS。


环境

IBM云电力系统虚拟服务器
硬件:S922
操作系统:CentOS 8


确认

请确认主机名

[root@test-centos ~]# hostname
test-centos

确认操作系统

[root@test-centos ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
[root@test-centos ~]#

确认yum软件源

[root@test-centos ~]# yum repolist
repo id                                                  repo name
appstream                                                CentOS Linux 8 - AppStream
baseos                                                   CentOS Linux 8 - BaseOS
extras                                                   CentOS Linux 8 - Extras

・核心确认

[root@test-centos ~]# uname -r
4.18.0-240.10.1.el8_3.ppc64le
在導入 Sysdig 代理程式之前,先確保已經安裝了 RPM 。
[root@test-centos ~]# yum -y install kernel-devel-$(uname -r)
CentOS Linux 8 - AppStream                                                                        3.9 kB/s | 4.3 kB     00:01
CentOS Linux 8 - AppStream                                                                        2.4 MB/s | 7.2 MB     00:03
CentOS Linux 8 - BaseOS                                                                           2.0 kB/s | 3.9 kB     00:01
CentOS Linux 8 - BaseOS                                                                           868 kB/s | 3.8 MB     00:04
CentOS Linux 8 - Extras                                                                           1.2 kB/s | 1.5 kB     00:01
CentOS Linux 8 - Extras                                                                           6.4 kB/s | 9.8 kB     00:01
No match for argument: kernel-devel-4.18.0-240.10.1.el8_3.ppc64le
Error: Unable to find a match: kernel-devel-4.18.0-240.10.1.el8_3.ppc64le
[root@test-centos ~]#

-> 据说没有对应的rpm存在…

进行「kernel-devel*」的yum搜索时,可以找到kernel-devel.ppc64le。

[root@test-centos ~]# yum search kernel-devel*
Last metadata expiration check: 0:02:35 ago on Tue 27 Jul 2021 02:10:46 AM UTC.
================================================== Name Matched: kernel-devel* ===================================================
kernel-devel.ppc64le : Development package for building kernel modules to match the kernel

不指定版本,安装 kernel-devel.ppc64le。

[root@test-centos ~]# yum -y install kernel-devel.ppc64le
Last metadata expiration check: 0:02:56 ago on Tue 27 Jul 2021 02:10:46 AM UTC.
Dependencies resolved.
==================================================================================================================================
 Package                        Architecture              Version                                  Repository                Size
==================================================================================================================================
Installing:
 kernel-devel                   ppc64le                   4.18.0-305.10.2.el8_4                    baseos                    18 M


Transaction Summary
==================================================================================================================================
Install  1 Package


Total download size: 18 M
Installed size: 48 M
Downloading Packages:
kernel-devel-4.18.0-305.10.2.el8_4.ppc64le.rpm                                                    2.3 MB/s |  18 MB     00:07
----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                             2.2 MB/s |  18 MB     00:08
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                          1/1
  Installing       : kernel-devel-4.18.0-305.10.2.el8_4.ppc64le                                                               1/1
  Running scriptlet: kernel-devel-4.18.0-305.10.2.el8_4.ppc64le                                                               1/1
  Verifying        : kernel-devel-4.18.0-305.10.2.el8_4.ppc64le                                                               1/1


Installed:
  kernel-devel-4.18.0-305.10.2.el8_4.ppc64le


Complete!
[root@test-centos ~]#

我成功地引入了!

确认

[root@test-centos ~]# rpm -qa | grep kernel-devel
kernel-devel-4.18.0-305.10.2.el8_4.ppc64le
[root@test-centos ~]#

我已经成功安装了前提 rpm。

接下来,我们将检查是否可以安装Sysdig agent。

情况1. 使用 Sysdig agent 进行部署和安装(使用安装脚本)。
[root@test-centos ~]#  curl -sL https://ibm.biz/install-sysdig-agent | sudo bash -s -- --access_key MONITORING_ACCESS_KEY --collector COLLECTOR_ENDPOINT --collector_port 6443 --secure true --tags TAG_DATA --additional_conf 'sysdig_capture_enabled: false'
* Detecting operating system
Unsupported operating system. Please consider contacting support@sysdigcloud.com or trying the manual installation.

如果没有支持的操作系统,可能可以尝试手动安装。

在安装脚本(https://ibm.biz/install-sysdig-agent)中,由于架构确认中缺少ppc64le选项,因此会被归类为不支持的架构。

ARCH=$(uname -m)
if [[ ! $ARCH = *86 ]] && [ ! $ARCH = "x86_64" ] && [ ! $ARCH = "s390x" ]; then
    unsupported
fi

情况2. Sysdig agent的部署和执行(手动安装)

我会尝试手动安装。

代理程序安装:手动 Linux 安装:CentOS、RHEL、Fedora、Amazon AMI、Amazon Linux 2。

导入「draios」的yum存储库

[root@test-centos ~]# rpm --import https://download.sysdig.com/DRAIOS-GPG-KEY.public
[root@test-centos ~]# echo $?
0
[root@test-centos ~]# curl -s -o /etc/yum.repos.d/draios.repo http://download.sysdig.com/stable/rpm/draios.repo
[root@test-centos ~]# echo $?
0
[root@test-centos ~]# yum repolist
repo id                                                  repo name
appstream                                                CentOS Linux 8 - AppStream
baseos                                                   CentOS Linux 8 - BaseOS
draios                                                   Draios
extras                                                   CentOS Linux 8 - Extras

「draios」存储库已添加。

[root@test-centos ~]# rpm -i http://mirror.us.leaseweb.net/epel/6/i386/epel-release-6-8.noarch.rpm
curl: (22) The requested URL returned error: 404 Not Found
error: skipping http://mirror.us.leaseweb.net/epel/6/i386/epel-release-6-8.noarch.rpm - transfer failed

找不到

我尝试搜索epel-release*。

[root@test-centos ~]# yum search epel-release*
Draios                                                                                            158  B/s | 309  B     00:01
Errors during downloading metadata for repository 'draios':
  - Status code: 404 for https://download.sysdig.com/stable/rpm/ppc64le/repodata/repomd.xml (IP: 216.137.37.33)
Error: Failed to download metadata for repo 'draios': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

厄杂邪库正在阻碍搜索功能。

尝试禁用 draios 仓库 (enabled=0),并寻找 epel*。

[root@test-centos yum.repos.d]# yum repolist
repo id                                                  repo name
appstream                                                CentOS Linux 8 - AppStream
baseos                                                   CentOS Linux 8 - BaseOS
extras                                                   CentOS Linux 8 - Extras
[root@test-centos yum.repos.d]# yum search epel*
Last metadata expiration check: 0:12:29 ago on Wed 28 Jul 2021 01:19:48 AM UTC.
====================================================== Name Matched: epel* =======================================================
epel-next-release.noarch : Extra Packages for Enterprise Linux Next repository configuration
epel-release.noarch : Extra Packages for Enterprise Linux repository configuration


[root@test-centos yum.repos.d]#

找到了「epel-next-release.noarch」和「epel-release.noarch」。
选择安装「epel-release.noarch」。

[root@test-centos yum.repos.d]# yum install epel-release.noarch
Last metadata expiration check: 0:14:25 ago on Wed 28 Jul 2021 01:19:48 AM UTC.
Dependencies resolved.
==================================================================================================================================
 Package                           Architecture                Version                          Repository                   Size
==================================================================================================================================
Installing:
 epel-release                      noarch                      8-11.el8                         extras                       24 k


Transaction Summary
==================================================================================================================================
Install  1 Package


Total download size: 24 k
Installed size: 35 k
Is this ok [y/N]: y
Downloading Packages:
epel-release-8-11.el8.noarch.rpm                                                                   32 kB/s |  24 kB     00:00
----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                              17 kB/s |  24 kB     00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                          1/1
  Installing       : epel-release-8-11.el8.noarch                                                                             1/1
  Running scriptlet: epel-release-8-11.el8.noarch                                                                             1/1
  Verifying        : epel-release-8-11.el8.noarch                                                                             1/1


Installed:
  epel-release-8-11.el8.noarch


Complete!
[root@test-centos yum.repos.d]#


[root@test-centos yum.repos.d]# yum repolist
repo id                                     repo name
appstream                                   CentOS Linux 8 - AppStream
baseos                                      CentOS Linux 8 - BaseOS
epel                                        Extra Packages for Enterprise Linux 8 - ppc64le
epel-modular                                Extra Packages for Enterprise Linux Modular 8 - ppc64le
extras                                      CentOS Linux 8 - Extras
[root@test-centos yum.repos.d]#

-> 已添加了 epel 和 epel-modular。


[root@test-centos yum.repos.d]# vi draios.repo
[draios]
name=Draios
baseurl=https://download.sysdig.com/stable/rpm/$basearch
enabled=1
gpgcheck=1
gpgkey=https://download.sysdig.com/DRAIOS-GPG-KEY.public
#repo_gpgcheck=1
[root@test-centos yum.repos.d]# yum search draios-agent
Draios                                                                                            156  B/s | 309  B     00:01
Errors during downloading metadata for repository 'draios':
  - Status code: 404 for https://download.sysdig.com/stable/rpm/ppc64le/repodata/repomd.xml (IP: 216.137.37.19)
Error: Failed to download metadata for repo 'draios': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

推测不存在的是位于baseurl中的 $basearch,其中 $basearch 为ppc64le。

我会尝试指定$basearch进行确认。

如果是x86_64的情况下

[root@test-centos yum.repos.d]# vi draios.repo
[draios]
name=Draios
#baseurl=https://download.sysdig.com/stable/rpm/$basearch
baseurl=https://download.sysdig.com/stable/rpm/x86_64
enabled=1
gpgcheck=1
gpgkey=https://download.sysdig.com/DRAIOS-GPG-KEY.public
#repo_gpgcheck=1


[root@test-centos yum.repos.d]# yum search draios-agent
Draios                                                                                            102 kB/s | 291 kB     00:02
Last metadata expiration check: 0:00:01 ago on Wed 28 Jul 2021 01:43:30 AM UTC.
=============================================== Name Exactly Matched: draios-agent ===============================================
draios-agent.x86_64 : Sysdig Agent
=================================================== Name Matched: draios-agent ===================================================
draios-agent-kmodule.x86_64 : Sysdig Agent
draios-agent-slim.x86_64 : Sysdig Agent
draios-agentino.x86_64 : Sysdig Agent
draios-agentone.x86_64 : Sysdig Agent

x86_64 架构下的 draios-agent 存在着。

如果是ppc64le版本的情况下

[root@test-centos yum.repos.d]# vi draios.repo
[draios]
name=Draios
#baseurl=https://download.sysdig.com/stable/rpm/$basearch
baseurl=https://download.sysdig.com/stable/rpm/ppc64le
enabled=1
gpgcheck=1
gpgkey=https://download.sysdig.com/DRAIOS-GPG-KEY.public
#repo_gpgcheck=1


[root@test-centos yum.repos.d]# yum search draios-agent
Draios                                                                                            157  B/s | 309  B     00:01
Errors during downloading metadata for repository 'draios':
  - Status code: 404 for https://download.sysdig.com/stable/rpm/ppc64le/repodata/repomd.xml (IP: 216.137.37.115)
Error: Failed to download metadata for repo 'draios': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

找不到。

如果是无架构的情况

[root@test-centos yum.repos.d]# vi draios.repo
[draios]
name=Draios
#baseurl=https://download.sysdig.com/stable/rpm/$basearch
baseurl=https://download.sysdig.com/stable/rpm/noarch
enabled=1
gpgcheck=1
gpgkey=https://download.sysdig.com/DRAIOS-GPG-KEY.public
#repo_gpgcheck=1


[root@test-centos yum.repos.d]# yum search draios-agent
Draios                                                                                            160  B/s | 308  B     00:01
Errors during downloading metadata for repository 'draios':
  - Status code: 404 for https://download.sysdig.com/stable/rpm/noarch/repodata/repomd.xml (IP: 216.137.37.115)
Error: Failed to download metadata for repo 'draios': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

找不到。


结果 (jié guǒ)

我将检查一下,以确定是否可以在 PowerVS 的 ppc64le 上安装 Sysdig agent,因为目前还没有适用于该平台的模块。

以上就是。

广告
将在 10 秒后关闭
bannerAds