环境配置:CentOS 7 x64 * 3
IP: 172.24.0.100 172.24.0.101 172.24.0.102
服务器配置:
172.24.0.100 - Nginx 前端负载均衡
172.24.0.101 - JBOSS - Wildfly-8.1.0.Final
172.24.0.102 - JBOSS - Wildfly-8.1.0.Final
Nginx 负载均衡 - 略
JBOSS - Wildfly-8.1.0.Final 安装配置:
http://download.jboss.org/wildfly/8.1.0.Final/wildfly-8.1.0.Final.zip
wget http://download.jboss.org/wildfly/8.1.0.Final/wildfly-8.1.0.Final.zip
unzip wildfly-8.1.0.Final.zip
mv wildfly-8.1.0.Final /opt/local/wildfly
cd /opt/local/wildfly
主要的配置都会在目录“/wildfly/domain/configuration”中完成。主要操作的是其中的两个文件:
domain.xml
host.xml
主节点:domain.xml、host.xml
辅助节点:host.xml
节点一
1.添加管理用户
admin
jicki
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.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : admin
The username 'admin' is easy to guess
Are you sure you want to add user 'admin' yes/no? yes
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
- The password should not be one of the following restricted values {root, admin, administrator}
- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
- The password should be different from the username
Password :
JBAS152565: Password must not be equal to 'admin', this value is restricted.
Are you sure you want to use the password entered yes/no? yes
Re-enter Password :
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]:
About to add user 'admin' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'admin' to file '/opt/local/wildfly/standalone/configuration/mgmt-users.properties'
Added user 'admin' to file '/opt/local/wildfly/domain/configuration/mgmt-users.properties'
Added user 'admin' with groups to file '/opt/local/wildfly/standalone/configuration/mgmt-groups.properties'
Added user 'admin' with groups to file '/opt/local/wildfly/domain/configuration/mgmt-groups.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="YWRtaW4=" />
-------------------------------------------------------------------------------------------------------------------------
cat /wildfly/domain/configuration/mgmt-groups.properties 查看是否添加成功 添加成功最后会出现两个帐号名称
2. 修改host.xml文件
cd /opt/local/wildfly/domain/configuration
vi host.xml
搜索 <interfaces>
修改jboss.bind.address.management:127.0.0.1 的ip为 172.24.0.101
jboss.bind.address:127.0.0.1 的ip为 172.24.0.101
jboss.bind.address.unsecure:172.24.0.101 的ip为 172.24.0.101
3. 启动JBOSS
/opt/local/wildfly/bin/domain.sh &
4. 访问 Wildfly 应用
http://172.24.0.101:8080/
http://172.24.0.102:8080/
wildfly后台:
http://172.24.0.101:9990/
http://172.24.0.102:9990/