JBoss7/WildFly有两种模式可供选择,即standalone和dimain模式,详细请参照社区文档(链接),本文给出一个简单配置domain模式的步骤。
本配置涉及到2台机器domain controller(10.66.218.46),host controller(10.66.218.47),本配置修改的文件均为JBOSS_HOME/domain/configuration/host.xml,即下文中描述到修改或编辑都是指这个文件。
1. 在domain controller一段创建一个Management User,具体到JBOSS_HOME/bin目录下执行add-user.sh,Windows执行add-user.bat,如下为一示例
[kylin@unused bin]$ ./add-user.sh What type of user do you wish to add? a) Management User (mgmt-users.properties) b) Application User (application-users.properties) (a): Enter the details of the new user to add. Realm (ManagementRealm) : Username : admin123 Password : Re-enter Password : About to add user 'admin123' for realm 'ManagementRealm' Is this correct yes/no? yes Added user 'admin123' to file '/home/kylin/work/./standalone/configuration/mgmt-users.properties' Added user 'admin123' to file '/home/kylin/work/./domain/configuration/mgmt-users.properties' Is this new user going to be used for one AS process to connect to another AS process? e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls. yes/no? yes To represent the user add the following to the server-identities definition <secret value="UmVkSGF0MSE=" />
./domain.sh -b 10.66.218.46 -bmanagement=10.66.218.46
如下所有修改全是指host.xml文件,位于domain/configuration目录之下。
1. 修改<domain-controller>部分内容如下:
<domain-controller> <!-- Alternative remote domain controller configuration with a host and port --> <remote host="${jboss.domain.master.address}" port="${jboss.domain.master.port:9999}" username="admin123" security-realm="ManagementRealm"/> </domain-controller>
<management> <security-realms> <security-realm name="ManagementRealm"> <server-identities> <secret value="UmVkSGF0MSE=" /> </server-identities>
<host name="slave"
<servers> <server name="server-four" group="main-server-group"> </server> <server name="server-five" group="main-server-group" auto-start="true"> <socket-bindings port-offset="150"/> </server> <server name="server-six" group="other-server-group" auto-start="false"> <socket-bindings port-offset="250"/> </server> </servers>
./domain.sh -Djboss.domain.master.address=10.66.218.46
登录domain controller管理界面(http://10.66.218.46:9990/console)确保上面添加的server已经存在。