WildFly8.1 (JBoss) +mod_cluster (Apache) cluster configuration

Source: Internet
Author: User
Tags in domain jboss wildfly

after the Apache+jboss cluster configuration was last used with MOD_JK, the JBoss5.1 boot was too slow to start trying to configure with the latest WildFly8.1 (Wildfly is JBoss, renamed after JBOSS7).

System Environment:
windows 7 SP1 (Windows Server 2003 has been tested, Wildfly will have an unknown problem)
Software Environment:
JDK 7+ (be sure to use more than 7, otherwise wildfly not supported)
WildFly 8.1.0 (http://wildfly.org/downloads/)
mod_cluster 1.2.6 (http://mod-cluster.jboss.org/downloads/1-2-6-Final-bin)
Note: Mod_cluster has two versions of Windows Httpd+ssl downloaded, corresponding to 32-bit and 64-bit

First, the domain mode configuration for wildfly
This is configured with two server nodes:
master:192.168.0.10;
slave1:192.168.0.11 (You can configure multiple slave)
1, respectively in two servers decompression wildfly 8.1.0;
2, master configuration (the following does not describe the folder XML is under Domain/configuration)
(1) Modify the <server-groups> node of the Domain.xml file:
server group settings for the server cluster.
Note: Both the profile and Socket-binding-group configuration are used in Full-ha mode (this mode is required for late use of mod_cluster).
<server-groups>    <!--Configuring server groups--    <server-group name= "Main-server-group" profile= "Full-ha" >        <JVM name= "Default" >            

(2) Modify the <cluster-password> node of the Domain.xml file:
Note: Here does not modify the normal use, but will error, recommended changes, change to any password can be.
<cluster-password>password</cluster-password>

(3) Modify the <interfaces> node of the Host.xml file
Replace all 127.0.0.1 with 192.168.0.10 for Master.
<interfaces>    <interface name= "Management" >        <inet-address value= "${ jboss.bind.address.management:192.168.0.10} "/>    </interface>    <interface name=" public ">        <inet-address value= "${jboss.bind.address:192.168.0.10}"/>    </interface>    <interface Name= "unsecure" >        <!--used for IIOP sockets in the standard configuration.             To secure Jacorb-need to setup SSL--        <inet-address value= "${jboss.bind.address.unsecure:192.168.0.10}"/ >    </interface></interfaces>

(4) Modify the <servers> node of the Host.xml file:
make the settings for the server instance in master.
Note: Group is the server group declared in Domain.xml, where the group must be in the Domain.xml file.
<servers>    <server name= "Master-one" group= "Main-server-group" auto-start= "true" >        < Socket-bindings port-offset= "0"/>    </server>    <server name= "Master-two" group= " Main-server-group "auto-start=" true ">        <socket-bindings port-offset="/>    </server></ Servers>

(5) Add admin account using Bin/add-user.bat:
add a user with a user name of master and a password of 123123. The final stage of the setup will ask "Is this new user going to being used for one as process to connect to another as process?" You can choose no here.
Note: You can also use a different name for the user.

2, SLAVE1 configuration (The following does not describe the folder XML is under Domain/configuration)
(1) Modify the <server-groups> node of the Domain.xml file:
Remove all of the server groups in the configuration and turn the node into an empty node.
<server-groups/>

(2) Modify the <cluster-password> node of the Domain.xml file:
The password here is consistent with the master configuration.
<cluster-password>password</cluster-password>

(3) Back up the original host.xml, duplicate a copy of the host-slave.xml renamed to Host.xml.
(4) Modify the <domain-controller> node of the new Host.xml file:
This sets the master address 192.168.0.10.
<domain-controller>    <remote host= "${jboss.domain.master.address:192.168.0.10}" .../></ Domain-controller>

(5) Modify the <interfaces> node of the new Host.xml file:
Replace all of the 127.0.0.1 for the slave1 192.168.0.11.
<interfaces>    <interface name= "Management" >        <inet-address value= "${ jboss.bind.address.management:192.168.0.11} "/>    </interface>    <interface name=" public ">        <inet-address value= "${jboss.bind.address:192.168.0.11}"/>    </interface>    <interface Name= "unsecure" >        <!--used for IIOP sockets in the standard configuration.             To secure Jacorb-need to setup SSL--        <inet-address value= "${jboss.bind.address.unsecure:192.168.0.11}"/ >    </interface></interfaces>

(6) Modify the <servers> node of the new Host.xml file:
make the settings for the server instance in slave1.
<servers>    <server name= "Slave1-one" group= "Main-server-group" auto-start= "true" >        < Socket-bindings port-offset= "0"/>    </server>    <server name= "Slave1-two" group= " Main-server-group "auto-start=" true ">        <socket-bindings port-offset=" 1 "/>    </server></ Servers>

(7) Add an account for slave1 using the Bin/add-user.bat of master:
Add a user named Slave1 with a password of 123123. The last query selects Yes, then a line of text will appear, including a section of XML, similar to <secret value= "Mtizmtiz"/>
Note: The user is on master.
(8) Modify the
Add an attribute name= "slave1" (this name must be the same as the user name of the slave1 created in master in the previous step).

(9) Modify the <server-identities> node of the Host.xml file:
Modify the connection master's validation settings (XML when adding slave1 users).
<server-identities>    <secret value= "Mtizmtiz"/></server-identities>
3, according to the above configuration, in the master and slave1 in turn, using Bin/domain.bat to start the server. To start all, access the http://192.168.0.10:9990/, enter the master username and password, enter the interface to view the health of the server.


second, the cluster and load balancing settings for Mod_cluster
1, on the master server decompression Mod_cluster, run Bin/installconf.bat, generate the default configuration file;
2. Modify the conf/httpd.conf file:
(1) Listen 8000 modified to Listen 80 (listening on 80 ports)
(2) #ServerName localhost:8000 modified to ServerName 192.168.0.10:80 (uncomment, change to master address)
(3) Modify the <ifmodule manager_module> node at the bottom (modify address and access restrictions):
<ifmodule manager_module>    Listen 192.168.0.10:6666    managerbalancername mycluster    < VirtualHost 192.168.0.10:6666>        <location/>            Order deny,allow            deny from all            to        </Location>        KeepAliveTimeout        maxkeepaliverequests 0        advertisefrequency 5        enablemcpmreceive        < location/mod_cluster_manager>            SetHandler mod_cluster-manager            Order deny,allow            deny from all Allow from all        </Location>    </VirtualHost></IfModule>

3. Start the Mod_cluster httpd server in turn, domain.bat the master server's domain.bat,slave1 server, Access Http://192.168.0.10:6666/mod_ Cluster_manager can see the status of the cluster.

WildFly8.1 (JBoss) +mod_cluster (Apache) cluster configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.