AHF (Autonomous Health Framework) é um cojunto de ferramentas da Oracle para simplificar e automatizar o processo de coleta de logs e dados de diagnóstico em servidores que rodam produtos Oracle. Similar ao que ocorre com o OPatch, é recomendado usa-lo sempre em sua versão mais atualizada, que é disponibilizada no My Oracle Support através do Doc ID 2550798.1.
Recentemente atualizei o AHF em um Exadata X8M, saindo da versão 22.3.1 para 23.3.3, mas após o upgrade com sucesso, tive problemas para usar o exachk quando a operação envolvia checagens nos Storages Cell, apresentando uma falha como:
Traceback (most recent call last):
File "/opt/oracle.ahf/python/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/opt/oracle.ahf/python/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/ade/b/3181994098/oracle/tfa/src/orachk_py/src/lib/utils.py", line 14764, in _remove_setup_on_remote
File "/ade/b/3181994098/oracle/tfa/src/orachk_py/src/lib/utils.py", line 3113, in native_rcopy_pybuild
File "/opt/oracle.ahf/python/lib/python3.10/posixpath.py", line 142, in basename
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
O erro parecia ter relação com a versão do Python usado nos Storage Cell, mas eu precisava gerar um exachk o mais breve possível, sem o tempo necessário para fazer troubleshooting ou abrir um chamado no suporte. Como eu estava executando o exachk normalmente antes do upgrade, optei por simplesmente fazer um downgrade para versão anterior.
AHF Tem Opção de Downgrade?
Quando executamos o instalador do AHF em um servidor que já tem o software instalado, ele reconhece isso automaticamente e pede confirmação para seguir com o upgrade. Se a versão que está tentando instalar for igual a atual, ele informa que o AHF já está atualizado e não há nada a fazer.
O problema é que quando tentamos instalar uma versão inferior a atual, ele não oferece a opção de downgrade para confirmação, apenas retornando a informação de que o AHF já está atualizado. A opção que podemos usar neste caso é desinstalar o AHF atual e iniciar a instalação da versão anterior manualmente.
Como Voltar Para Versão Anterior
Para voltar a versão anterior, basta desinstalarmos a versão atual normalmente como se não quisesse mais tê-lo no servidor, e depois instalar a outra versão normalmente, como se fosse a primeira instalação.
Um ponto importante é que o processo de desinstalação não remove o repositório atual a menos que você especifique explicitamente a opção “-deleterepo” durante a desinstalação. Como o objetivo é continuar utilizando o AHF, recomendo não utilizar essa opção, mantendo todo o histórico de coletas e relatórios que ainda podem ser necessários para análises futuras pelo suporte da Oracle.
1) Desinstalando a versão atual
Antes desinstalar o AHF, colete algumas informações básicas sobre a instalação atual, caso você precise customizar os diretórios na instalação da versão anterior.
1.1) O comando abaixo retorna a localização do repositório geral do AHF e o específico do exachk:
# ahfctl showrepo
.-------------------------------------------------------------------.
| exadbdm01 |
+----------------------+--------------------------------------------+
| Repository Parameter | Value |
+----------------------+--------------------------------------------+
| Location | /u01/app/oracle/oracle.ahf/data/repository |
| Maximum Size (MB) | 10240 |
| Current Size (MB) | 7953 |
| Free Size (MB) | 2287 |
| Status | OPEN |
'----------------------+--------------------------------------------'
exachk repository: /u01/app/oracle/oracle.ahf/data/exadbdm01/exachk/user_root/output
1.2) O comando abaixo retorna o caminho do utilitário ahfctl, dando uma dica de onde o mesmo está instalado atualmente:
# ls -l $(which ahfctl)
lrwxrwxrwx 1 root root 30 Dec 15 10:02 /usr/bin/ahfctl -> /opt/oracle.ahf/ahf/bin/ahfctl
Neste caso o AHF está instalado no /opt/oracle.ahf (default).
1.3) Desinstale o AHF:
# ahfctl uninstall
ATENÇÃO: Não use a opção “-deleterepo” a menos que queira realmente limpar o histórico de todas as coletas e relatórios gerados pelo TFA/ORACHK/EXACHK até o momento.
2) Instalando a versão antiga
2.1) Descompate o AHF da versão que deseja instalar:
mkdir ahf
unzip AHF-LINUX_v22.3.1.zip -d ahf
O diretório “ahf” utilizado neste exemplo não refere-se ao local onde o AHF será instalado, apenas um diretório temporário para manter os arquivos de instalação organizados de forma que possam ser excluídos com maior segurança após a instalação.
2.2) Execute o instalador normalmente como se fosse instalar pela primeira ou realizar upgrade:
# cd ahf
# ./ahf_setup
2.3) Confirme a versão instalada e o status do processo em todos os Nodes do Cluster:
# tfactl status
.------------------------------------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID | Inventory Status |
+---------------+---------------+--------+------+------------+----------------------+------------------+
| exadbdm01 | RUNNING | 316663 | 5000 | 22.3.1.0.0 | 22310020221130144218 | COMPLETE |
| exadbdm02 | RUNNING | 74987 | 5000 | 22.3.1.0.0 | 22310020221130144218 | COMPLETE |
| exadbdm03 | RUNNING | 138140 | 5000 | 22.3.1.0.0 | 22310020221130144218 | COMPLETE |
| exadbdm04 | RUNNING | 290599 | 5000 | 22.3.1.0.0 | 22310020221130144218 | COMPLETE |
'---------------+---------------+--------+------+------------+----------------------+------------------'
OBS: É normal a coluna “Inventory Status” levar alguns minutos até apresentar todos os nodes como “COMPLETE”.
Exemplo
Desinstalação:
[root@exadbdm01 ahf]# ahfctl uninstall
Starting AHF Uninstall
NOTE : Uninstalling does not return all the space used by the AHF repository
AHF will be uninstalled on:
exadbdm01
exadbdm02 exadbdm03 exadbdm04
Do you want to continue with AHF uninstall ? [Y]|N : Y
Stopping AHF service on local node exadbdm01...
Stopping TFA Support Tools...
Removed symlink /etc/systemd/system/multi-user.target.wants/oracle-tfa.service.
Removed symlink /etc/systemd/system/graphical.target.wants/oracle-tfa.service.
Stopping exachk scheduler ...
Removing exachk cache discovery....
Process Process-1:
Traceback (most recent call last):
File "/opt/oracle.ahf/python/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/opt/oracle.ahf/python/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/ade/b/3181994098/oracle/tfa/src/orachk_py/src/lib/utils.py", line 14764, in _remove_setup_on_remote
File "/ade/b/3181994098/oracle/tfa/src/orachk_py/src/lib/utils.py", line 3113, in native_rcopy_pybuild
File "/opt/oracle.ahf/python/lib/python3.10/posixpath.py", line 142, in basename
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Process Process-2:
Traceback (most recent call last):
File "/opt/oracle.ahf/python/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/opt/oracle.ahf/python/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/ade/b/3181994098/oracle/tfa/src/orachk_py/src/lib/utils.py", line 14764, in _remove_setup_on_remote
File "/ade/b/3181994098/oracle/tfa/src/orachk_py/src/lib/utils.py", line 3113, in native_rcopy_pybuild
File "/opt/oracle.ahf/python/lib/python3.10/posixpath.py", line 142, in basename
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Process Process-3:
Traceback (most recent call last):
File "/opt/oracle.ahf/python/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/opt/oracle.ahf/python/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/ade/b/3181994098/oracle/tfa/src/orachk_py/src/lib/utils.py", line 14764, in _remove_setup_on_remote
File "/ade/b/3181994098/oracle/tfa/src/orachk_py/src/lib/utils.py", line 3113, in native_rcopy_pybuild
File "/opt/oracle.ahf/python/lib/python3.10/posixpath.py", line 142, in basename
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Successfully completed exachk cache discovery removal.
Unable to send message to TFA
Removed exachk from inittab
Stopping and removing AHF in exadbdm02...
Successfully uninstalled AHF on node exadbdm02
Stopping and removing AHF in exadbdm03...
Removed symlink /etc/systemd/system/multi-user.target.wants/oracle-tfa.service.
Removed symlink /etc/systemd/system/graphical.target.wants/oracle-tfa.service.
Removing exachk cache discovery....
exachk discovery caching was with exadbdm04 node but currently ssh equivalency is not present to the exadbdm04 node. Rediscover exachk once again without exadbdm04 or create ssh equivalency from current node to exadbdm04.
Unable to send message to TFA
Removed exachk from inittab
Successfully uninstalled AHF on node exadbdm03
Stopping and removing AHF in exadbdm04...
Removed symlink /etc/systemd/system/multi-user.target.wants/oracle-tfa.service.
Removed symlink /etc/systemd/system/graphical.target.wants/oracle-tfa.service.
Removing exachk cache discovery....
exachk discovery caching was with exadbdm02 node but currently ssh equivalency is not present to the exadbdm02 node. Rediscover exachk once again without exadbdm02 or create ssh equivalency from current node to exadbdm02.
Unable to send message to TFA
Removed exachk from inittab
Successfully uninstalled AHF on node exadbdm04
Removing AHF setup on exadbdm01:
Removing /etc/rc.d/rc0.d/K17init.tfa
Removing /etc/rc.d/rc1.d/K17init.tfa
Removing /etc/rc.d/rc2.d/K17init.tfa
Removing /etc/rc.d/rc4.d/K17init.tfa
Removing /etc/rc.d/rc6.d/K17init.tfa
Removing /etc/init.d/init.tfa...
Removing /etc/systemd/system/oracle-tfa.service...
Removing /opt/oracle.ahf/rpms
Removing /opt/oracle.ahf/jre
Removing /opt/oracle.ahf/common
Removing /opt/oracle.ahf/bin
Removing /opt/oracle.ahf/python
Removing /opt/oracle.ahf/analyzer
Removing /opt/oracle.ahf/tfa
Removing /opt/oracle.ahf/chm
Removing /opt/oracle.ahf/ahf
Removing /opt/oracle.ahf/exachk
Removing /opt/oracle.ahf/ahfscope
Removing /opt/oracle.ahf/chadiag
Removing /opt/oracle.ahf/iwa
Removing /u01/app/oracle/oracle.ahf/data/exadbdm01
Removing /opt/oracle.ahf/install.properties
Removing update backup directories from /u01/app/oracle/oracle.ahf/data/work
Removing /sys/fs/cgroup/cpu/oratfagroup/
Instalação da versão antiga:
[root@exadbdm01 ahf]# ls -l
total 493996
-r-xr-xr-x 1 root root 505832109 Nov 30 22:18 ahf_setup
-rw-r--r-- 1 root root 384 Nov 30 22:18 ahf_setup.dat
-rw-r--r-- 1 root root 625 Nov 30 22:18 oracle-tfa.pub
-rw-r--r-- 1 root root 1525 Nov 30 22:18 README.txt
[root@exadbdm01 ahf]# ./ahf_setup
AHF Installer for Platform Linux Architecture x86_64
AHF Installation Log : /tmp/ahf_install_223100_348611_2023_01_19-19_24_41.log
Starting Autonomous Health Framework (AHF) Installation
AHF Version: 22.3.1 Build Date: 202211301442
Default AHF Location : /opt/oracle.ahf
Do you want to install AHF at [/opt/oracle.ahf] ? [Y]|N : Y
AHF Location : /opt/oracle.ahf
AHF Data Directory stores diagnostic collections and metadata.
AHF Data Directory requires at least 5GB (Recommended 10GB) of free space.
Choose Data Directory from below options :
1. /u01/app/oracle [Free Space : 153676 MB]
2. Enter a different Location
Choose Option [1 - 2] : 1
AHF Data Directory : /u01/app/oracle/oracle.ahf/data
Do you want to add AHF Notification Email IDs ? [Y]|N : N
AHF will also be installed/upgraded on these Cluster Nodes :
1. exadbdm02
2. exadbdm03
3. exadbdm04
The AHF Location and AHF Data Directory must exist on the above nodes
AHF Location : /opt/oracle.ahf
AHF Data Directory : /u01/app/oracle/oracle.ahf/data
Do you want to install/upgrade AHF on Cluster Nodes ? [Y]|N : Y
Extracting AHF to /opt/oracle.ahf
Configuring TFA Services
Discovering Nodes and Oracle Resources
TFA will configure Storage Cells using Existing SSH Setup:
Cells were configured via SSH. Do you want to also store the Password for Cells in Oracle Wallet (Recommended): [Y]|N Y
Is password same for all Cells: [Y]|N Y
Please Enter Password for Cells:
Please Confirm Password for Cells:
Verifying Password...
TFA-00002 Oracle Trace File Analyzer (TFA) is not running
AHF Wallet is not able to sync until TFA is running on ALL nodes.
Once TFA is running on ALL nodes sync can manually be performed
by running 'tfactl cell sync'.
TFA-00002 Oracle Trace File Analyzer (TFA) is not running
.-------------------------------------.
| | EXADATA CELL | CURRENT STATUS |
+---+----------------+----------------+
| 1 | x8mceladm01 | ONLINE |
| 2 | x8mceladm02 | ONLINE |
| 3 | x8mceladm03 | ONLINE |
| 4 | x8mceladm04 | ONLINE |
| 5 | x8mceladm05 | ONLINE |
| 6 | x8mceladm06 | ONLINE |
'---+----------------+----------------'
Not generating certificates as GI discovered
Starting TFA Services
Created symlink from /etc/systemd/system/multi-user.target.wants/oracle-tfa.service to /etc/systemd/system/oracle-tfa.service.
Created symlink from /etc/systemd/system/graphical.target.wants/oracle-tfa.service to /etc/systemd/system/oracle-tfa.service.
.-----------------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID |
+---------------+---------------+--------+------+------------+----------------------+
| exadbdm01 | RUNNING | 397118 | 5000 | 22.3.1.0.0 | 22310020221130144218 |
'---------------+---------------+--------+------+------------+----------------------'
Running TFA Inventory...
Adding default users to TFA Access list...
.----------------------------------------------------------------------.
| Summary of AHF Configuration |
+-----------------+----------------------------------------------------+
| Parameter | Value |
+-----------------+----------------------------------------------------+
| AHF Location | /opt/oracle.ahf |
| TFA Location | /opt/oracle.ahf/tfa |
| Exachk Location | /opt/oracle.ahf/exachk |
| Data Directory | /u01/app/oracle/oracle.ahf/data |
| Repository | /u01/app/oracle/oracle.ahf/data/repository |
| Diag Directory | /u01/app/oracle/oracle.ahf/data/exadbdm01/diag |
'-----------------+----------------------------------------------------'
Starting Orachk Scheduler from AHF
Setting up AHF CLI and SDK
AHF install completed on exadbdm01
Installing AHF on Remote Nodes :
AHF will be installed on exadbdm02, Please wait.
Installing AHF on exadbdm02 :
[exadbdm02] Copying AHF Installer
[exadbdm02] Running AHF Installer
AHF will be installed on exadbdm03, Please wait.
Installing AHF on exadbdm03 :
[exadbdm03] Copying AHF Installer
[exadbdm03] Running AHF Installer
AHF will be installed on exadbdm04, Please wait.
Installing AHF on exadbdm04 :
[exadbdm04] Copying AHF Installer
[exadbdm04] Running AHF Installer
AHF binaries are available in /opt/oracle.ahf/bin
AHF is successfully installed