JBOSS series -- Cluster -- basic configuration (1) -- client,
1. What is a cluster?
A cluster is a set of computer nodes that provide users with a set of network resources as a whole. The ideal cluster is transparent to users. Users can access the cluster resources from a single portal without realizing the existence of the cluster. You can add or reduce nodes to clusters without affecting user access.
2. JBOSS Domain mode and Standalone Mode
Standalone Mode is a single-process Mode of machines. It is easy to configure and deploy and is suitable for general single-server projects. Domain Mode is a multi-machine multi-process Mode with slightly complicated configurations and is suitable for large-scale distributed projects.
The Domain mode solves the problem of unified management of multiple Jboss servers, so that the server configuration can be centralized, unified configuration, and unified deployment to achieve centralized management. In Standalone mode, each JBOSSServer needs to be configured, And the maintenance workload is huge.
Therefore, the Domain Mode is more suitable for the product environment with multiple servers. If a single Server does not need to obtain anything from the Domain Mode, it is better to select the Standalone Mode.
Standalone Mode is more suitable in the development phase. Domain Mode is useful in some advanced development scenarios and requires interaction between multiple instances.
3. What problems does the cluster solve?
The cluster solves the load balancing and high availability, that is, it shares the pressure on the server. When one or more servers go down, the server can continue to run.
The domain mode combines multiple servers into a server group, and provides single-point centralized configuration and single-point unified deployment for multiple hosts in a server group.
By combining the domain mode with the cluster, the project deployment and server performance are greatly displayed. Therefore, JBOSS operations become faster and more convenient, providing us with high scalability in O & M.
Iv. Cluster Lifecycle
Apache can automatically discover newly started JBOSS nodes. When the first jboss node is started, the jboss cluster is automatically created. Add other nodes to the cluster in turn.
Apache can monitor the status of nodes in the cluster and automatically remove inaccessible nodes from the cluster to ensure that each request is responded. All nodes in the group immediately stop working and the cluster disappears.
Iv. Practice
Use two computers as servers
1. master server configuration 1) Go to "jboss_home \ domain \ configuration" and open host. xml
<interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:192.168.24.17}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:192.168.24.17}"/> </interface> <interface name="unsecure"> <inet-address value="${jboss.bind.address.unsecure:192.168.24.17}"/> </interface> </interfaces>
Note: you only need to change the above IP address to the IP address of the Master Server (for example, my machine is the master server ).
2) Start master Server in domain Mode
Jboss_home \ bin \ domain. bat
3) add an Administrator Account
Note: If you have an account, go to the JBOSS console. If not, add an account.
3.1) add an account
A. Open jbossHome/bin/add-user.bat
B. Select the Administrator account and enter the user name and password.
Note: The password follows certain rules, such as my username: liutengteng, and password :! The liutengteng123 password must be at least eight characters long.
C. Keep "yes" until you finish writing down the final encoding.
4) create a group
In this JBOSS version, select JBOSS EAP6.2. When creating a group, select full mode. This article uses jboss eap 6.3 and selects the full-ha mode.
Go to the Jboss Console
4.1) create a group
Note that when creating a group, select full-ha for the profile type, as shown below:
4.2) create a Server
Note that when adding a server, PortOffset is an offset. After the server is created, the corresponding port is 8080 + 1, that is, port 8081.
In this way, group and Serve are created:
4.3) Server enabling and disabling
Place the mouse over a server to enable or disable it. However, if a Server is enabled, you must remove the server and stop it.
4.4) The Jboss structure of the Master Server
Jboss on Master
Group:
This article introduces the JBOSS server configuration first.