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}
| コマンド | 説明 | 使用例 | 
|---|---|---|
list  | 
チャンネル、組織の資格情報、または製品を一覧表示する  | 
  | 
add  | 
チャンネル、組織の資格情報、または製品を追加する  | 
  | 
refresh  | 
製品、チャンネル、およびサブスクリプションのローカルコピーを更新する  | 
  | 
delete  | 
ローカルシステムから既存のSCC組織の資格情報を削除する  | 
  | 
sync  | 
指定されたチャンネルを同期するか、空白のままの場合は尋ねる  | 
  | 
コマンドに固有のオプションの全リストを表示するには、次のコマンドを使用します。
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.