此内容没有您所选择的语言版本。

Chapter 22. Example: Managing JBoss ON Server Configuration


Even in different environments, JBoss ON servers can share a lot of the same configuration. For example, different JBoss ON servers may manage a development environment, staging environment, and production environment, yet on all three, the servers use similar metric templates and configuration settings. To simplify managing separate but similar environments, JBoss ON can export the configuration for a server and then import that configuration into another server.
Any user with permissions to manage settings can export the server configuration.

22.1. Simple Export/Import Synchronization

At its simplest, synchronizing server settings exports all metrics and server configuration settings and then imports that information directly, without any adjustment to the data before its imported or filters on what data to import.
TIP
This can be automated by including login information for both JBoss ON servers, and then running the script. This could also be broken into two scripts, one run against server1 and the other against server2. Using a wrapper script would allow you to run the export script, then to run a utility like SCP to copy over the archive, and then to run the import script.
The first part of the script exports the data from server1 and creates a zipped XML archive.
//log into the first server
rhq.login('rhqadmin','rhqadmin','server1.example.com','7080');

//export the settings
var ex = SynchronizationManager.exportAllSubsystems();
rhqadmin@localhost:7080$ saveBytesToFile(ex.exportFile, 'export.xml.gz');

// log out of the first server
rhq.logout()
Copy to Clipboard Toggle word wrap
The archive file then needs to be copied over to server2 in some way.
When the archive is copied over, it can then be imported into server2. The null parameter means that the import process uses the default settings in the XML file or, if the defaults are missing from the XML, that it uses the settings defined on the target server.
// log into the second server
rhq.login('rhqadmin','rhqadmin','server2.example.com','7080');

// import the settings
var data = getFileBytes('export.xml.gz');
SynchronizationManager.importAllSubsystems(data, null);

// log out of the second server
rhq.logout()
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat