删除并重新安装/更新stackdriver-agent

时间:2020-10-06 05:32:07

标签: google-cloud-monitoring

除了将其固定到某个特定版本之外,还有其他方法可以删除并重新安装/更新stackdriver-agent吗?

  • stackdriver-agent.x86_64 5.5.2-1001.el7
  • stackdriver-agent.x86_64 5.5.2-1002.el7

即使在“删除stackdriver-agent”之后,运行“ install -y stackdriver-agent”仍然使用stackdriver-agent.x86_64 0:5.5.2-1002.el7。

在拉/安装最新版本6. *之前是否有配置文件可以进行此更改?

2 个答案:

答案 0 :(得分:1)

我能够安装新版本的唯一方法是先从所有产品系统中删除日志记录代理,然后再删除代理,然后重新安装。

stackdriver-agent.x86_64 0:6.0.5-1.el7 

答案 1 :(得分:0)

尝试查看我已阅读的“ Installing the Cloud Monitoring agent on a single VM”文档。

我能够安装,启动,停止,删除和安装该代理的另一个版本。

这是我的操作方式(使用CentOS 6框):

我创建了一个新的CentOS 6 VM,将代理的存储库添加到了程序包列表中:

[wbogacz@centos ~]$ curl -sSO https://dl.google.com/cloudagents/add-monitoring-agent-repo.sh
[wbogacz@centos ~]$ sudo bash add-monitoring-agent-repo.sh
Adding agent repository for Red Hat.

然后列出了此操作系统的所有可用版本:

[wbogacz@centos ~]$ sudo yum list --showduplicates stackdriver-agent
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.eu.oneandone.net
 * centos-sclo-rh: ftp.plusline.net
 * centos-sclo-sclo: mirror.infonline.de
 * epel: d2lzkl7pfhq30w.cloudfront.net
 * extras: ftp.plusline.net
 * updates: ftp.plusline.net
google-cloud-monitoring/signature                                                        |  454 B     00:00     
google-cloud-monitoring/signature                                                        | 1.4 kB     00:00 ... 
Installed Packages
stackdriver-agent.x86_64                         5.5.2-1002.el6                         @google-cloud-monitoring
Available Packages
stackdriver-agent.x86_64                         5.5.2-1001.el6                         google-cloud-monitoring 
stackdriver-agent.x86_64                         5.5.2-1002.el6                         google-cloud-monitoring 

该代理的版本6不适用于CentOS 6(在CentOS 8中显示)。

然后我安装了1001版本:

Loading mirror speeds from cached hostfile
 * base: mirror.eu.oneandone.net
 * centos-sclo-rh: ftp.plusline.net
 * centos-sclo-sclo: mirror.infonline.de
 * epel: d2lzkl7pfhq30w.cloudfront.net
 * extras: ftp.plusline.net
 * updates: ftp.plusline.net
Resolving Dependencies
--> Running transaction check
---> Package stackdriver-agent.x86_64 0:5.5.2-1001.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================
 Package                     Arch             Version                   Repository                         Size
================================================================================================================
Installing:
 stackdriver-agent           x86_64           5.5.2-1001.el6            google-cloud-monitoring           1.3 M

Transaction Summary
================================================================================================================
Install       1 Package(s)

Total download size: 1.3 M
Installed size: 4.9 M
Downloading Packages:
85f2f9343af9e0c4669fb9214584c8d4c2ccacfd0a5559e7d980bc4ae85babc6-stackdriver-agent-5.5.2 | 1.3 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : stackdriver-agent-5.5.2-1001.el6.x86_64                                                      1/1 
  Verifying  : stackdriver-agent-5.5.2-1001.el6.x86_64                                                      1/1 

Installed:
  stackdriver-agent.x86_64 0:5.5.2-1001.el6                                                                     

Complete!

再次列出已安装的代理,却一无所获:

[wbogacz@centos ~]$  sudo yum list installed | grep stack
stackdriver-agent.x86_64

启动代理:

[wbogacz@centos ~]$ sudo service stackdriver-agent start
Starting stackdriver-collectd: option = Interval; value = 60.000000;
option = Hostname; value = ;
option = FQDNLookup; value = false;
Created new plugin context.
option = PIDFile; value = /var/run/stackdriver-agent.pid;
option = Interval; value = 60.000000;
option = Hostname; value = ;
option = FQDNLookup; value = false;
Created new plugin context.

删除代理

[wbogacz@centos ~]$ sudo yum remove stackdriver-agent
Loaded plugins: fastestmirror, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package stackdriver-agent.x86_64 0:5.5.2-1001.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================
 Package                     Arch             Version                  Repository                          Size
================================================================================================================
Removing:
 stackdriver-agent           x86_64           5.5.2-1001.el6           @google-cloud-monitoring           4.9 M

Transaction Summary
================================================================================================================
Remove        1 Package(s)

Installed size: 4.9 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : stackdriver-agent-5.5.2-1001.el6.x86_64                                                      1/1 
  Verifying  : stackdriver-agent-5.5.2-1001.el6.x86_64                                                      1/1 

Removed:
  stackdriver-agent.x86_64 0:5.5.2-1001.el6                                                                     

Complete!

安装1002版本:

Loading mirror speeds from cached hostfile
 * base: mirror.eu.oneandone.net
 * centos-sclo-rh: ftp.plusline.net
 * centos-sclo-sclo: mirror.infonline.de
 * epel: d2lzkl7pfhq30w.cloudfront.net
 * extras: ftp.plusline.net
 * updates: ftp.plusline.net
Resolving Dependencies
--> Running transaction check
---> Package stackdriver-agent.x86_64 0:5.5.2-1002.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================
 Package                     Arch             Version                   Repository                         Size
================================================================================================================
Installing:
 stackdriver-agent           x86_64           5.5.2-1002.el6            google-cloud-monitoring           1.3 M

Transaction Summary
================================================================================================================
Install       1 Package(s)

Total download size: 1.3 M
Installed size: 4.9 M
Downloading Packages:
2a595a0373346006564e3ddc1a15101460b78d72936b11ba177ac956b125cca2-stackdriver-agent-5.5.2 | 1.3 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : stackdriver-agent-5.5.2-1002.el6.x86_64                                                      1/1 
  Verifying  : stackdriver-agent-5.5.2-1002.el6.x86_64                                                      1/1 

Installed:
  stackdriver-agent.x86_64 0:5.5.2-1002.el6                                                                     

Complete!

Check installed version

[wbogacz@centos ~]$ rpm --query --queryformat '%{NAME} %{VERSION} %{RELEASE} %{ARCH}\n' \
>      stackdriver-agent
stackdriver-agent 5.5.2 1002.el6 x86_64