Synchronization CLI Tools
| 
 서버 컨테이너 내부의 셸에 액세스하려면 컨테이너 호스트에서   | 
There are two tools for synchronizing clients to the server. For clients that are connected to the SUSE Customer Center, use mgr-sync. For all other clients, use spacewalk-repo-sync.
1. Synchronize SCC Repositories With mgr-sync
The primary use of mgr-sync is to connect to the SUSE Customer Center, retrieve product and package information, and prepare channels for synchronization with the SUSE Multi-Linux Manager Server.
이 도구는 SUSE 지원 구독과 함께 사용하도록 설계되었으며, openSUSE, CentOS 및 Ubuntu 등 오픈 소스 배포에는 필요하지 않습니다.
mgr-sync에서 사용할 수 있는 명령과 인수는 이 테이블에서 확인할 수 있습니다. mgr-sync 명령에 다음 구문을 사용합니다.
mgr-sync [-h] [--version] [-v] [-s] [-d {1,2,3}] {list,add,refresh,delete}
| Command | Description | Example Use | 
|---|---|---|
list  | 
List channels, organization credentials, or products  | 
  | 
add  | 
Add channels, organization credentials, or products  | 
  | 
refresh  | 
Refresh the local copy of products, channels, and subscriptions  | 
  | 
delete  | 
Delete existing SCC organization credentials from the local system  | 
  | 
sync  | 
Synchronize specified channel or ask for it when left blank  | 
  | 
명령과 관련된 전체 옵션 목록을 확인하려면 다음 명령을 사용합니다.
mgr-sync <command> --help
| 옵션 | 약식 옵션 | 설명 | 예시 사용 | 
|---|---|---|---|
help  | 
  | 
명령 사용법 및 옵션 표시  | 
  | 
version  | 
N/A  | 
현재 설치된   | 
  | 
verbose  | 
  | 
자세한 출력 제공  | 
  | 
store-credentials  | 
  | 
자격 증명을 로컬 숨김 파일에 저장  | 
  | 
debug  | 
  | 
추가 디버깅 정보 기록. 1, 2, 3의 수준 필요. 3은 가장 많은 양의 디버깅 정보를 제공  | 
  | 
no-sync  | 
N/A  | 
동기화를 시작하지 않고 제품 또는 채널을 추가하려면   | 
  | 
다음은 mgr-sync에 대한 로그의 위치입니다.
- 
/var/log/rhn/mgr-sync.log - 
/var/log/rhn/rhn_web_api.log 
2. Synchronize Repositories with spacewalk-repo-sync
The spacewalk-repo-sync tool synchronizes software repositories into SUSE Multi-Linux Manager channels. In most cases, this happens automatically, but you can use the tool to run it manually if required.
The spacewalk-repo-sync tool has these primary commands:
| Option | Description | Example Use | 
|---|---|---|
list  | 
List all custom channels and the repositories assigned to them.  | 
  | 
channel  | 
Synchronize a single channel to all repositories assigned to it.  | 
  | 
deep-verify  | 
ignore cached package checksums.  | 
  | 
force-all-errata  | 
force re-importing all the patches.  | 
  | 
no-packages  | 
excludes packages from the operation.  | 
  | 
For a complete list of options, see the spacewalk-repo-sync manpage:
man spacewalk-repo-sync
3. 문제 해결 동기화
If you are having trouble synchronizing with spacewalk-repo-sync you can find out more by watching the HTTP log as the command runs.
- 
Log the HTTP output into
/var/log/zypper.log:ZYPP_MEDIA_CURL_DEBUG=2 spacewalk-repo-sync --channel <channel-label>
 - 
Export the setting:
export URLGRABBER_DEBUG=DEBUG
 - 
Start the synchronization:
/usr/bin/spacewalk-repo-sync --channel <channel-label> --type yum
You can increase the debug level, by adding the [option]``-vvv`` option to the command.
 - 
When the complete completes, or fails, disable debug mode:
unset URLGRABBER_DEBUG
 
3.1. Add Custom Extra HTTP Headers
You can add custom HTTP headers to the requests made by spacewalk-repo-sync at the time of synchronization. The custom HTTP headers are defined in the /etc/rhn/spacewalk-repo-sync/extra_headers.conf configuration file. The headers can be defined by repository name or channel label. You can also define global headers by putting them in the main section. For example:
[testchannel] X-MY-HEADER-1=VALUE X-MY-HEADER-2=VALUE [mychannel] X-MY-HEADER-3=VALUE X-MY-HEADER-4=VALUE [main] X-MYGLOBAL-HEADER=VALUE
This can be particularly useful when dealing with Red Hat Update Infrastructure (RHUI) repositories in the public cloud.