Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure Multi-computer Cluster in GlassFish

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "how to configure multi-machine clusters in GlassFish", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to configure multi-computer clusters in GlassFish".

Set up two virtual computers in VMware, using Windows Server 2003. Originally, I wanted to use Linux, but Ubuntu always had to check the patch online every time, which was so slow that I had to install 2003.

Two virtual machines, the IP address is 192.168.1.103 and the other is 192.168.1.104. Among them, 192.168.1.104 serves as the master proxy server and one of the node servers.

First download and install JDK6 (or at least JDK5) on each computer, and the installation process is not described here.

Then install Glassfish. The author uses Glassfish v2ur1 multilingual version. After downloading from the Internet, execute

Java-Xmx256m-jar glassfish-installer-v2ur1-b09d-windows-ml.jar

Extract the installation documentation. Then go to Glassfish and execute

Lib\ ant\ bin\ ant-f setup-cluster.xml

Both stations have to do this.

In fact, in theory, it should be a proxy server, multiple node servers. However, I was afraid that my machine could not stand it, so I only used two machines. However, one of the machines acts as both an agent and a node, so there is a performance problem. You can experiment by yourself, but you can't match it like this in practice.

If there is no problem with "ant-f setup-cluster.xml" execution, then a cluster-enabled server instance is set up on both servers.

First, go to the bin directory of Glassfish on the proxy server to start the instance

Asadmin strat-domain domain1

"domain1" is the default instance automatically created by the system, and you can also create your own instance. The format is "create-domain-- profile cluster-- adminport 4848", "--profile cluster" indicates that the instance is a cluster instance, and "--adminport 4848" indicates that the management port is 4848.

Establish a node agent on two node servers (currently 192.168.1.104 also serves as a proxy server).

Asadmin create-node-agent-host 192.168.1.104-port 4848 agentOnFirst

Establish * proxy nodes.

Asadmin create-node-agent-host 192.168.1.104-port 4848 agentOnSecond

Establish a second proxy node.

When establishing, you are required to enter the user name, password and master password of the proxy server. The default is the user name "admin" and the password "adminadmin". The master password I created by myself is also set to "adminadmin". If you are using the default instance, the master password should be "changeit". Commands should be executed on two node servers, not on the proxy server. Then start the two node agents respectively

Asadmin start-node-agent agentOnFirst

Asadmin start-node-agent agentOnSecond

You are also required to enter the proxy server user name, password and master password at startup. If there is no problem, the system shows that the node started successfully.

After entering the console, select Cluster, and then select the New button. Enter the cluster name and press OK. The author calls his cluster "MiaoCluster". Then click on the cluster instance, select the "instances" tab on the right, and add the two node agents you just created. * Press the "start Cluster" button in the "General" tab. If everything is normal and both nodes are connected, the cluster will start successfully. You are now ready to deploy the application in the applications tab. The author wrote a default JavaEE application, there is only a default index.jsp file, the above sentence "". The deployment was successful because nothing else was involved.

38080 is the access port of the cluster, and the author's application is called hello. The browser successfully displays "Hello World!". Then visit, go to the node directory of each node server, and you can see the hello directory under "C:\ glassfish\ nodeagents\\ applications\ j2ee-modules\". If you find it inconvenient to access, you can configure HTTP load balancing on the proxy server.

These are all the contents of the article "how to configure multi-computer clusters in GlassFish". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report