`
yangzb
  • 浏览: 3508703 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Setting up Glassfish Cluster

阅读更多

Glassfish Server can run in various profile - developer, cluster etc. In order to setup the cluster we need to create a domain with Cluster Profile or in else you can enable the Cluster Support for the existing domain.
Let us create a cluster with 3 machines of which 2 machines will run Application Server Instances and one of them will run DAS - the Domain Administration Server. Following is the step-by-step procedure to setup the cluster.

  1. Install Glassfish on all the machines that must participate in the Cluster.
  2. Start the Server on all 3 machines , Test the working of server through Admin Console
  3. Change the master password (you must stop the domain before you change the master password). Keep the same master password on all machines. Not a must from Glassfish but for the ease of setting up things.
  4. Enable Cluster Support using Admin Console (Application Server >> Add Cluster Support. Alternatively, you can create a new domain using NetBeans specifying the profile of domain as Cluster)
  5. On Machine1 create a cluster using (we will consider this machine as DAS which will host Cluster Config). Use the following command to do so:
    1 asadmin create-cluster --user admin --passwordfile passwords.txt MyCluster
    I suggest you do not create any instance on this server and let this server be purely for Domain Administration Purpose.
  6. Do the following on other two machines i.e. Machine2 and Machine3
    1 asadmin create-node-agent --user admin --passwordfile passwords.txt --host Machine1 --port 4848 Machine2Agent
  7. Now create 1 instance on this machine as follows:
    1 asadmin create-instance --user admin --passwordfile passwords.txt --host Machine1 --port 4848  --nodeagent Machine2Agent
    2        --cluster MyCluster Machine2Instance

    Note that we are creating the agent and instance on Machine2 but for the Cluster on Machine1.
    Be patient - Creation of Instance will take some time as it needs to pick up config info from the Machine1. It communicates with Machine1 through 4848 the port mentioned.
  8. Execute the above steps on Machine3 as well. Change the name of agent and instance to reflect Machine3
    Make a note through Admin Console on Machine1 the Node Agents Sections. You will find the nodes of Machine2 and Machine3 along with their instances running there.
  9. Now start the agents on both the machines (Machine2 and Machine3) using the following CLI
    1 asadmin start-node-agent --user admin --passwordfile passwords.txt --syncinstances=true
    The --syncinstances==true is a must.
    Also note that it is at this time that the directory structure of the instance(s) created on this Machine gets created under nodeagents folder in your appserver. Take a look
  10. Verify that all instances of Machine2 and Machine3 are in running state - Use Admin Console >> Node Agents >> Select Node Agent. Also verify that the instances and their state is visible from Clusters >> MyCluster tab.
  11. Make note of the HTTP Ports allocated to the Instances - Admin Console >> Clusters >> MyCluster >> Instances >> Select Instance >> General Properties Tab Page
  12. Go to MyCluster >> Applications >> Deploy >> and Deploy a web application
    Ensure that your web.xml contains <distributable/> tag
    Also ensure that available checkbox is ticked before you deploy the application
  13. If required, restart all agents on their respective machines with --syncinstances option. Once the instances are restarted check the Clusters >> MyCluster >> Machine1Instance >> Monitor >> Applications >> Select the dropdown - You must be able to see the application you had deployed on the cluster.
  14. Use instance specific ports to check that the application is running on all Instances. for e.g.
    http://Machine1:38081/clusteredapplication


Congratulations - You have setted up the cluster and deployed an application on it. Check out my post on Load Balancing

分享到:
评论

相关推荐

    glassfish集群搭建手册

    标题《Glassfish集群搭建手册》指的是利用Oracle提供的Glassfish应用服务器软件进行集群配置的详细指南。此手册涵盖了在不同场景下通过图形化界面和命令行方式搭建集群的整个过程,并且描述了如何配置集群环境以支持...

    glassfish安装步骤.txt

    ### Glassfish安装步骤详解 #### 一、简介 Glassfish是一款开源的应用服务器,它支持Java EE标准,并且在企业级应用开发中具有广泛的应用。为了能够成功安装并配置Glassfish,确保系统环境中已经安装了合适的JDK...

    glassfish安装配置文档

    GlassFish 安装配置文档 GlassFish 是一个基于 Java 的开源应用服务器,提供了一个强大且灵活的平台来部署和管理基于 Java 的应用程序。本文档将指导 readers 通过安装和配置 GlassFish 服务器,并将其与 Eclipse ...

    glassfish安装手册及源文件

    如果你计划设置集群,可执行`ant -f setup-cluster.xml`。否则,若不需集群功能,可以执行`ant -f setup.xml`来创建单个域。 5. **默认端口配置**:在默认情况下,Glassfish的管理端口为4848,HTTP服务端口为8080,...

    Glassfish部署web项目

    ### Glassfish部署Web项目知识点详解 #### 一、概述 **Glassfish** 是一款开源的Java EE应用服务器,由Oracle公司维护。它基于Java EE标准,支持多种Java EE技术,如EJB、JPA、JSF等。由于其强大的功能和良好的...

    GlassFish4(GlassFish3)安装

    GlassFish4的下载和安装的详细步骤,下载地址,配置等。附带有GlassFish3的安装简述

    glassfish-3.1.2.2.zip

    《深入解析Glassfish 3.1.2.2与Java EE 6的融合应用》 Glassfish 3.1.2.2是一款由Oracle公司开发的开源应用服务器,它是Java EE 6规范的重要实现者,提供了全面的支持和丰富的功能,为开发者提供了构建企业级Web...

    GlassFish安装向导

    然后,需要编辑 setup-cluster.xml 文件,并使用以下命令启动安装:`#lib/ant/bin/ant –f setup-cluster.xml` 三、集群配置 在 GlassFish 中,需要配置 JDBC 连接池。配置完成后,需要创建受管节点和实例。创建受...

    linux下实现glassfish自动启动

    在Linux环境下,Glassfish服务器的自动化启动是系统管理员和开发者常用的需求,这有助于提升服务器管理效率,确保服务的持续性和稳定性。Glassfish是Oracle公司提供的一个开源Java EE应用服务器,它支持各种Web应用...

    glassfish-ose-4.0 白皮书

    《glassfish-ose-4.0 白皮书》是一份详尽的文档,它深入介绍了GlassFish 4.0服务器的各项特性和功能。GlassFish是Oracle公司开发的一款开源的应用服务器,基于Java EE(Java Platform, Enterprise Edition)标准,为...

    glassfish单机集群jk_little

    在IT行业中,Glassfish是一款开源的应用服务器,由Sun Microsystems开发并维护,后来成为Oracle Corporation的一部分。Glassfish支持Java EE(现在称为Jakarta EE)规范,为开发者提供了构建企业级Web应用的平台。当...

    glassfish网络开发服务器

    GlassFish网络开发服务器是一款强大的开放源代码应用服务器,主要用于运行Java EE(Java Platform, Enterprise Edition)应用程序。由Oracle公司维护,它支持各种企业级服务,包括Web服务、EJB(Enterprise ...

    GlassFish2.0的安装

    【GlassFish 2.0 安装详解】 GlassFish 2.0 是 Sun Microsystems 推出的一款免费且开源的 Java EE 服务器,它基于 Java Platform, Enterprise Edition (Java EE) 5规范,提供了包括EJB 3.0、JSF 1.2、Servlet 2.5、...

    GlassFish5.0安装包

    【GlassFish 5.0 安装与配置详解】 GlassFish,由Oracle公司主导的开源项目,是一款功能强大的Web服务器和应用服务器,以其卓越的性能和丰富的特性在开发者社区中备受推崇。相比于Tomcat,GlassFish提供了更全面的...

    Glassfish关于tomcat的文档

    ### Glassfish与Tomcat对比分析 #### 执行摘要 对于Web 2.0初创公司、应用服务提供商以及提供动态Web应用的独立软件供应商(ISVs)而言,应用即业务,而应用服务器中的Web容器技术能够直接影响业务成果。Web容器是...

    GlassFish Eclipse Plugin

    《GlassFish Eclipse Plugin:集成开发环境的强大力量》 GlassFish Eclipse Plugin是专为Eclipse IDE设计的一款插件,旨在提升开发人员在Eclipse环境中对GlassFish应用服务器的管理和开发效率。GlassFish,作为...

    glassfish安装

    《Glassfish安装详解》 Glassfish,作为Oracle公司开源的一款Java EE应用服务器,是开发者进行企业级Java应用程序部署的重要平台。本文将详细讲解如何安装和配置Glassfish,以帮助初学者快速入门。 首先,理解...

    glassfish-5.0.1.zip

    GlassFish 是一款强健的商业兼容应用服务器,达到产品级质量,可免费用于开发、部署和重新分发。开发者可以免费获得源代码,还可以对代码进行更改。 GlassFish 是用于构建 Java EE 5应用服务器的开源开发项目的名称...

    可扩展GlassFish v3的JavaEE 6

    GlassFish v3 的 JavaEE 6 可扩展性架构 GlassFish v3 是一个基于 JavaEE 6 的应用服务器,它具有可扩展、模块化和简化开发等特点。以下是 GlassFish v3 的 JavaEE 6 可扩展性架构的知识点: 可扩展性 GlassFish ...

Global site tag (gtag.js) - Google Analytics