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

Source: Internet
Author: User
Tags in domain jboss wildfly

Following the last use of MOD_JK conduction apache+jboss cluster configuration. Because JBoss5.1 started too slowly, I started experimenting with the latest WildFly8.1 constructs (Wildfly that 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 a version number of two Windows Httpd+ssl to download. Corresponding 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 (can configure multiple slave)
1, respectively in two servers decompression wildfly 8.1.0;
2, master configuration (the following does not indicate that the directory XML is under Domain/configuration)
(1) Change the <server-groups> node of domain.xml file:
server group settings for the server cluster.
Note: The profile and Socket-binding-group configurations are used in Full-ha mode (this mode is required for later use Mod_cluster).

<server-groups>    <!--Configuring server groups--    <server-group name= "Main-server-group" profile= "Full-ha" >        <JVM name= "Default" >            

(2) Change the <cluster-password> node of domain.xml file:
Note: Here are two ways to change, one is to set username and password (for communication security between the clusters), and two is to disable the security policy.
<!--<cluster-user>jms-user</cluster-user><cluster-password>jms-pass</cluster-password >--><security-enabled>false</security-enabled>

(3) Change the <interfaces> node of 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) Change the <servers> node of host.xml file:
Make the settings for the server instance in master.


Note: Group is the server group declared in Domain.xml. The group must appear 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) Use Bin/add-user.bat to join the Administrator account:
Join a user, username is master. Password is 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: Users with other names can also be used.



2, SLAVE1 configuration (The following does not describe the directory XML is under Domain/configuration)
(1) Change the <server-groups> node of domain.xml file:
Remove all the server groups in the configuration and make the node empty.

<server-groups/>

(2) Change the <cluster-password> node of domain.xml file:
The configuration here is identical to the master.

<!--<cluster-user>jms-user</cluster-user><cluster-password>jms-pass</cluster-password >--><security-enabled>false</security-enabled>

(3) Back up the original host.xml, duplicate a copy of the host-slave.xml renamed to Host.xml.
(4) Change 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) Change 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) Change 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) Use Master's Bin/add-user.bat to add an account to slave1:
join a user, username to slave1. Password is 123123. The final query selects Yes, and then a line of text appears, containing an XML, similar to <secret value= "Mtizmtiz"/>. Need to be written down.
Note: The user is on master.
(8) Change the
Add an attribute name= "slave1" (this name must match the username of the slave1 created in master in the previous step).

(9) Change the <server-identities> node of host.xml file:
Changes the authentication settings of the connection master (XML when the user joins the slave1).

<server-identities>    <secret value= "Mtizmtiz"/></server-identities>
3, in accordance with the above configuration, in turn in master and Slave1, using Bin/domain.bat to start the server. After all launches, visit http://192.168.0.10:9990/, enter masterusername and password, enter the interface, you can view the server's performance status.


second, the cluster and load balancing settings for Mod_cluster
1, in Masterserver decompression Mod_cluster, execute bin/installconf.bat, generate the default configuration file;
2. Change conf/httpd.conf file:
(1) Listen 8000 change to Listen 80 (monitor 80port)
(2) #ServerName localhost:8000 change to ServerName 192.168.0.10:80 (remove gaze, change to master address)
(3) Change the bottom of the <ifmodule manager_module> node (change 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, in turn, start Mod_cluster httpdserver,masterserver of the Domain.bat,slave1server Domain.bat. Visit Http://192.168.0.10:6666/mod_cluster_manager You can see the status of a cluster.

Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

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.