WAN 연결을 통한 SUSE Multi-Linux Manager 서버와 프록시 간의 긴 동기화 시간 문제 해결
Depending on what changes are executed in the WebUI or via an API call to distribution or system settings, cobbler sync command may be required to transfer files from SUSE Multi-Linux Manager Server to SUSE Multi-Linux Manager Proxy systems. To accomplish this, Cobbler uses a list of proxies specified in /etc/cobbler/settings.
Due to its design, cobbler sync is not able to sync only the changed or recently added files.
Instead, executing cobbler sync triggers a full sync of the /srv/tftpboot directory to all specified proxies configured in /etc/cobbler/settings. It is also influenced by the latency of the WAN connection between the involved systems.
The process of syncing may take a considerable amount of time to finish according to the logs in /var/log/cobbler/.
예를 들어, 다음에 시작됨:
Thu Jun 3 14:47:35 2021 - DEBUG | running python triggers from /var/lib/cobbler/triggers/task/sync/pre/* Thu Jun 3 14:47:35 2021 - DEBUG | running shell triggers from /var/lib/cobbler/triggers/task/sync/pre/*
및 다음에 종료됨:
Thu Jun 3 15:18:49 2021 - DEBUG | running shell triggers from /var/lib/cobbler/triggers/task/sync/post/* Thu Jun 3 15:18:49 2021 - DEBUG | shell triggers finished successfully
전송량은 약 1.8GB였습니다. 전송에 약 30분이 걸렸습니다.
By comparison, copying a single big file of the same size as /srv/tftboot completes within several minutes.
Switching to an rsync-based approach to copy files between SUSE Multi-Linux Manager Server and Proxy may help to reduce the transfer and wait times.
이 작업을 수행하기 위한 스크립트는 https://suse.my.salesforce.com/sfc/p/1i000000gLOd/a/1i000000ll5B/B2AmvIJN2_JsAyjTQzCVP_x5ioVgd0bYN9X9NpMugS8에서 다운로드할 수 있습니다.
The script does not accept command line options. Before running the script, you need to manually edit it and set correctly MLMHOSTNAME, MLMIP and MLMPROXY1 variables for it to work correctly.
|
스크립트의 개별 조정에 사용할 수 있는 지원은 제공되지 않습니다. 스크립트와 내부 주석은 고려해야 할 프로세스 및 단계에 대한 개요를 제공하는 것을 목표로 합니다. 추가적인 도움이 필요한 경우 SUSE Consulting에 문의하십시오. |
스크립트를 사용하는 제안된 접근법은 다음 환경에서 유용합니다.
-
SUSE Multi-Linux Manager 프록시 시스템은 WAN 연결을 통해 연결됩니다.
-
/srv/tftbootcontains a high number of files for distributions and client PXE boot files, in total several thousand files; -
Any proxy in
/etc/cobbler/settingshas been disabled, otherwise SUSE Multi-Linux Manager will continue to sync content to the proxies.#프록시: # - "MLMproxy.MLMproxy.test" # - "MLMproxy2.MLMproxy.test"
-
SUSE Multi-Linux Manager 및 관련 시스템 간의 TCP 트래픽 덤프를 가져옵니다.
-
SUSE Multi-Linux Manager 서버에서:
tcpdump -i ethX -s 200 host <ip-address-of-susemanagerproxy> and not ssh
-
SUSE Multi-Linux Manager 프록시에서:
tcpdump -i ethX -s 200 host <ip-address-of-susemanager> and not ssh
-
그러면 분석을 실행하기에 충분한 200개의 패키지 크기만 캡처됩니다.
-
SUSE Multi-Linux Manager가 프록시와의 통신에 사용하는 각 네트워크 인터페이스에 대한 ethX를 조정합니다.
-
마침내, 더 이상 패키지 수를 줄이기 위해 ssh 통신이 캡처되지 않습니다.
-
-
Start a
cobbler sync.-
To force a sync, delete the Cobbler json cache file first and then issue
cobbler sync:rm /var/lib/cobbler/pxe_cache.json cobbler sync
-
-
When {command]
cobbler syncis finished, stop the TCPdumps. -
Open the TCPdumps using Wireshark, go to
Statistics > Conversationsand wait for the dump to be analyzed. -
TCP 탭으로 전환합니다. 이 탭에 표시되는 숫자는 SUSE Multi-Linux Manager 서버와 SUSE Multi-Linux Manager 프록시 사이에서 수집된 총 대화 수를 나타냅니다.
-
Look for the column
Duration.-
파일 전송에 소요된 최소 시간을 확인하려면 우선 오름차순으로 정렬합니다.
-
내림차순으로 계속 정렬하여, 예를 들어 커널 및 initrd 전송과 같은 대용량 파일의 최대값을 찾습니다.
포트 4505 및 4506은 Salt 통신에 사용되므로 무시합니다.
-
TCP 덤프를 분석한 결과 SUSE Multi-Linux Manager 서버에서 프록시로 약 1,800바이트 크기의 작은 파일을 전송하는 데 약 0.3초가 걸렸습니다.
대용량 파일이 많지는 않았지만, 전송된 모든 단일 파일에 대해 새로운 TCP 연결이 생성되기 때문에 작은 파일의 수가 많으면 많은 수의 연결이 설정됩니다.
그러므로 최소 전송 시간과 필요한 연결 수(예시에서는 약 5,000개)를 알면 전체 전송 시간에 대한 대략적인 예상 시간이 5000 * 0.3 / 60 = 25분이라는 것을 알 수 있습니다.