Bağlantıların sınanması

WebSphere Automation ve WebSphere Application Server ya da WebSphere Application Server Liberty sunucuları arasında uzaktan erişimi doğrulayın.

Başlamadan önce

Bu görev, WebSphere Automation kümesine yönetici erişimi gerektirir.

Yordam

  1. runcli testConnection komutunu çalıştırın. runcli testConnection komutu, runbook-manager bölmesinin bir konsolundan çalıştırılabilir.
    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]

    Yönetilen sunucunun anasistem adını parametre olarak geçirin ya da işletim sistemi adını parametre olarak geçirin. Aşağıdaki örneğe bakın.

    oc rsh $MANAGER_POD runcli testConnection myvm linux

    Yapılandırılan SSH ya da WinRM parametrelerini kullanarak yönetilen sunucuya bağlanmayı deneyen bir iş başlatılır. Aşağıdaki örnek çıkışa bakın.

    Ekim 22, 2021 6:47:23 PM com.ibm.ws.automation.core.runbook.manager.RunbookManagerCLI clientMode
    BİLGİ: başlatma
    Yaratılan iş: test-connection-1634928445267
    Çalışan iş günlüklerini görmek için: oc logs --tail=100 -l job-name=test-connection-1634928445267
  2. Bağlantı sorunları olup olmadığını saptamak için iş günlüklerini inceleyin.
    Başarılı bir bağlantının çıkışı:
    [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
    

    Belirgin hata ya da tamamlanma iletileri yoksa, stdout, stdout_lines, stderr ve stderr_linesanahtar sözcüklerini arayın.

    Not: Sunucu PowerShell sürüm gereksinimini karşılasa bile PowerShell gereksinim satırı görüntülenebilir. Bu ifadeyi göz ardı edebilirsiniz.
Bağlantıyı sınarken sorunlarla karşılaşırsanız, aşağıdaki sorun giderme ipuçlarına bakın.
Eksik wsa-ansible veya wsa-ansible-win secret
ERROR: The /was/ssh directory with the Ansible connection
        parameters is empty. Make sure the wsa-ansible secret exists.

SSH ya da WinRM bağlantı parametrelerinde wsa-ansible ya da wsa-ansible-win güvenlik dizgisi eksik. Bkz. Güvenli uzaktan erişimin ayarlanması.

Anasistem adı çözülemiyor
Failed to connect to the host via ssh: ssh: Could not
        resolve hostname <hostname>

Bazı sunucular, DNS tarafından çözülemeyen anasistem adlarıyla yapılandırılmış olabilir. Bu tür durumlarda, WebSphere Automation ' in özel bir anasistem eşlemesiyle yapılandırılması gerekebilir. Daha fazla anasistem ya da IP eşlemesi sağlamak için WebSphereAutomation özel kaynağındaki .runbookManager.runbookRunner.hostAliases parametresini kullanın. Örneğin,

apiVersion: automation.websphere.ibm.com/v1
kind: WebSphereAutomation
metadata:
  name: wsa
spec:
  runbookManager:
    runbookRunner:
      hostAliases:
      - hostnames:
        - myvm
        ip: 9.46.84.208
Anasistem anahtarı doğrulaması başarısız oldu
Failed to connect to the host via ssh: Host key verification
        failed.

WebSphere Automation , anasistem anahtarlarını doğrular, ancak bir sunucunun anasistem anahtarı değişir. Anasistem anahtarı değişikliği kasıtlı olarak yapıldıysa, wsa-ansible-known-hosts yapılandırmasını güncellenen anahtarla güncelleyin. Ayrıntılar için WebSphere Automation for SSH to Linux ya da UNIX servers başlıklı konuya bakın.