Prueba de conexiones

Valide el acceso remoto entre los servidores WebSphere Automation y WebSphere Application Server o WebSphere Application Server Liberty.

Antes de empezar

Esta tarea requiere acceso administrativo al clúster de WebSphere Automation.

Procedimiento

  1. Ejecute el mandato runcli testConnection . El mandato runcli testConnection se puede ejecutar desde una consola del pod runbook-manager .
    MANAGER_POD=$(oc get pod -l app.kubernetes.io/component=runbook-manager -o name | head -n 1)
    oc rsh $MANAGER_POD runcli testConnection <hostname> [operatingSystem]

    Pase el nombre de host del servidor gestionado como parámetro o pase el nombre del sistema operativo como parámetro. Consulte el ejemplo siguiente.

    oc rsh $MANAGER_POD runcli testConnection myvm linux

    Se inicia un trabajo que intenta conectarse al servidor gestionado utilizando los parámetros SSH o WinRM configurados. Consulte la salida de ejemplo siguiente.

    22 de octubre de 2021 6:47:23 PM com.ibm.ws.automation.core.runbook.manager.RunbookManagerCLI clientMode
    INFO: iniciando
    Trabajo creado: test-connection-1634928445267
    Para ver los registros del trabajo ejecute: oc logs --tail=100 -l job-name=test-connection-1634928445267
  2. Examine los registros de trabajo para ver si hay problemas de conexión.
    Salida de una conexión correcta:
    [11/02/21 19:05:36:746 UTC] 1    com.ibm.ws.automation.core.runbook.runner.RunbookRunnerCLI INFO appMode Runbook Runner Starting
    [11/02/21 19:05:38:952 UTC] 1    com.ibm.ws.automation.core.runbook.runner.RunbookRunnerCLI INFO start Request received to execute runbook: test-connection against server: test-server.example.com (correlationId: 1635879932990)
    [11/02/21 19:05:39:033 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook Here is the standard output of the command:
    
    [11/02/21 19:05:39:129 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook was:
    [11/02/21 19:05:39:129 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook   hosts:
    [11/02/21 19:05:39:129 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook     test-server.example.com:
    [11/02/21 19:05:39:130 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook       ansible_connection: ssh
    [11/02/21 19:05:39:130 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook       ansible_shell_type: powershell
    [11/02/21 19:05:39:130 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook       ansible_user: Administrator
    [11/02/21 19:05:39:133 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook Agent pid 48
    [11/02/21 19:05:39:138 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook The known_hosts file is not present
    [11/02/21 19:05:39:138 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook ANSIBLE_HOST_KEY_CHECKING=<notset>
    [11/02/21 19:05:40:049 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook No config file found; using defaults
    [11/02/21 19:05:40:438 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook 
    [11/02/21 19:05:40:438 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook PLAY [Test Connection] *********************************************************
    [11/02/21 19:05:40:447 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook 
    [11/02/21 19:05:40:447 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook TASK [test : Check PowerShell Version] *****************************************
    [11/02/21 19:05:46:192 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook changed: [test-server.example.com] => {"changed": true, "cmd": "Write-Output (\"PowerShell version: \" + $PSVersionTable.PSVersion.Major + \".\" + $PSVersionTable.PSVersion.Minor)\nif ($PSVersionTable.PSVersion.Major -lt 5) {\n  Write-Output \"ERROR: PowerShell version 5 or later is required.\"\n  Exit 25\n}", "delta": "0:00:00.921839", "end": "2021-11-02 07:05:45.760941", "rc": 0, "start": "2021-11-02 07:05:44.839102", "stderr": "", "stderr_lines": [], "stdout": "PowerShell version: 5.1\r\n", "stdout_lines": ["PowerShell version: 5.1"]}
    [11/02/21 19:05:46:196 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook 
    [11/02/21 19:05:46:196 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook PLAY RECAP *********************************************************************
    [11/02/21 19:05:46:196 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook test-server.example.com  : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
    [11/02/21 19:05:46:197 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook 
    [11/02/21 19:05:46:264 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook Here is the standard error of the command (if any):
    
    [11/02/21 19:05:46:265 UTC] 1    com.ibm.ws.automation.core.runbook.runner.AnsibleRunner INFO runRunbook Identity added: /was/win/ssh_private_key_file (example.user@example.com)
    [11/02/21 19:05:46:265 UTC] 1    com.ibm.ws.automation.core.runbook.runner.RunbookRunnerCLI INFO start Ansible return code=0
    [11/02/21 19:05:46:265 UTC] 1    com.ibm.ws.automation.core.runbook.runner.RunbookRunnerCLI INFO stop Runbook Runner Stopping
    

    En ausencia de mensajes de error o finalización obvios, busque las palabras clave stdout, stdout_lines, stderr y stderr_lines.

    Nota: La línea de requisitos de PowerShell puede aparecer incluso si el servidor cumple el requisito de versión de PowerShell . Puede ignorar esta frase.
Si encuentra problemas al probar la conexión, consulte las siguientes sugerencias para la resolución de problemas.
Falta un secreto wsa-ansible o wsa-ansible-win
ERROR: The /was/ssh directory with the Ansible connection
        parameters is empty. Make sure the wsa-ansible secret exists.

Falta el secreto wsa-ansible o wsa-ansible-win con los parámetros de conexión SSH o WinRM. Consulte Configuración del acceso remoto seguro.

No se puede resolver el nombre de host
Failed to connect to the host via ssh: ssh: Could not
        resolve hostname <hostname>

Es posible que algunos servidores se hayan configurado con nombres de host que DNS no puede resolver. En tales casos, puede ser necesario configurar WebSphere Automation con una correlación de host personalizada. Utilice el .runbookManager.runbookRunner.hostAliases parámetro en el recurso personalizado WebSphereAutomation para proporcionar más asignaciones de host o IP. Por ejemplo:

apiVersion: automation.websphere.ibm.com/v1
kind: WebSphereAutomation
metadata:
  name: wsa
spec:
  runbookManager:
    runbookRunner:
      hostAliases:
      - hostnames:
        - myvm
        ip: 9.46.84.208
La verificación de la clave de host ha fallado
Failed to connect to the host via ssh: Host key verification
        failed.

WebSphere Automation verifica las claves de host, pero la clave de host de uno de los servidores ha cambiado. Si el cambio de la clave de host ha sido intencionado, actualice la configuración de wsa-ansible-known-hosts con la clave actualizada. Consulte Configuración de la automatización de SSH para servidores Linux o UNIX en WebSphere para obtener más información.