服务器间同步 - 版本 2
如果您安装了多个 SUSE Manager,有时需要在服务器之间复制内容。使用服务器间同步 (ISS) 可以导出一台服务器(源)的数据,并将其导入另一台(目标)服务器。这对于中心部署方案或断开连接的设置很有用。
在第 2 版 ISS 实现中,SUSE 去除了主从概念。可以在任何 SUSE Manager 服务器之间朝任一方向导出和导入内容。 |
1. 安装 ISS 软件包
要使用 ISS,需要在源服务器和目标服务器上安装 inter-server-sync
软件包。
2. 内容同步
请在服务器容器内执行相应步骤之前使用 |
-
At the command prompt of the SUSE Manager container host of the source server, as root, enter the server container:
mgrctl term
-
在容器内部,执行以下步骤:
-
Execute the ISS export command. The
-h
option provides detailed help:inter-server-sync export -h
-
导出过程会创建一个输出目录,其中包含导入过程所需的所有数据。
To avoid data loss or filling up the container file system, store the data on a persistent volume (preferably |
Contents from the source server needs to be synchronized to the target server.
-
At the command prompt of the SUSE Manager container host of the source server, as root, enter the server container:
mgrctl term
-
在容器内部,执行以下步骤:
-
Synchronize to the target server:
rsync -r <导出目录的路径> root@<目标服务器>:~/
-
复制所有内容后,开始导入这些内容。
-
At the command prompt of the SUSE Manager container host of the target server, as root, enter the server container:
mgrctl term
-
在容器内部,执行以下步骤:
-
Execute the ISS import command. The
-h
option provides detailed help:inter-server-sync import -h
-
3. 数据库连接配置
默认会从 /etc/rhn/rhn.conf
加载数据库连接配置。可以使用参数 --serverConfig
覆盖属性文件位置。
4. 已知限制
-
源服务器和目标服务器需使用同一版本。
-
导出和导入组织应该同名。组织名称区分大小写。