연결 테스트

WebSphere AutomationWebSphere Application Server 또는 WebSphere Application Server Liberty 서버 간 원격 액세스의 유효성을 검증하십시오.

시작하기 전에

이 태스크를 수행하려면 WebSphere Automation 클러스터에 대한 관리 액세스 권한이 필요합니다.

프로시저

  1. runcli testConnection 명령을 실행하십시오. runcli testConnection 명령은 runbook-manager 팟 (Pod) 의 콘솔에서 실행할 수 있습니다.
    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]

    관리 서버의 호스트 이름을 매개변수로 전달하거나 운영 체제 이름을 매개변수로 전달하십시오. 다음 예를 참조하십시오.

    oc rsh $MANAGER_POD runcli testConnection myvm linux

    구성된 SSH 또는 WinRM 매개변수를 사용하여 관리 서버에 연결을 시도하는 작업이 시작됩니다. 다음 예제 출력을 참조하십시오.

    2021년 10월 22일 6:47:23 PM com.ibm.ws.automation.core.runbook.manager.RunbookManagerCLI clientMode
    정보: 시작 중
    작성된 작업: test-connection-1634928445267
    실행된 작업 로그를 확인하려면: oc logs --tail=100 -l job-name=test-connection-1634928445267
  2. 작업 로그에서 연결 문제점을 검사하십시오.
    성공적인 연결의 출력은 다음과 같습니다.
    [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
    

    명백한 오류 또는 완료 메시지가 없는 경우 stdout, stdout_lines, stderrstderr_lines키워드를 검색하십시오.

    참고: 서버가 PowerShell 버전 요구사항을 충족하는 경우에도 PowerShell 요구사항 행이 표시될 수 있습니다. 이 명령문을 무시할 수 있습니다.
연결을 테스트할 때 문제가 발생하면 다음 문제점 해결 팁을 참조하십시오.
wsa-ansible 또는 wsa-ansible-win 시크릿 누락
ERROR: The /was/ssh directory with the Ansible connection
        parameters is empty. Make sure the wsa-ansible secret exists.

SSH 또는 WinRM 연결 매개변수에서 wsa-ansible 또는 wsa-ansible-win 시크릿이 누락되었습니다. 보안 원격 액세스 설정하기를 참조하십시오.

호스트 이름을 분석할 수 없습니다.
Failed to connect to the host via ssh: ssh: Could not
        resolve hostname <hostname>

일부 서버는 DNS에서 해석할 수 없는 호스트 이름으로 구성될 수 있습니다. 이 경우 사용자 정의 호스트 맵핑을 사용하여 WebSphere Automation 를 구성해야 할 수 있습니다. WebSphereAutomation 사용자 지정 리소스의 .runbookManager.runbookRunner.hostAliases 매개변수를 사용하여 더 많은 호스트 또는 IP 매핑을 제공하십시오. 예를 들면 다음과 같습니다.

apiVersion: automation.websphere.ibm.com/v1
kind: WebSphereAutomation
metadata:
  name: wsa
spec:
  runbookManager:
    runbookRunner:
      hostAliases:
      - hostnames:
        - myvm
        ip: 9.46.84.208
호스트 키 검증 실패
Failed to connect to the host via ssh: Host key verification
        failed.

WebSphere Automation 는 호스트 키를 확인하지만 서버 중 하나의 호스트 키가 변경되었습니다. 호스트 키 변경이 의도적인 경우 업데이트된 키로 wsa-ansible-known-hosts 구성을 업데이트하십시오. 자세한 내용은 SSH를 통한 Linux 또는 UNIX 서버용 WebSphere 자동화 설정 방법을 참조하십시오.