5- Glass Fish 21 Impl Cluster LB

  • Upload
    wynboek

  • View
    218

  • Download
    0

Embed Size (px)

Citation preview

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    1/15

    Glassfish 2.1 ESB Enterprise Installation and

    Cluster Setup

    Table of Contents

    Table of Contents ................................................................................................................................. 1Requirements: ...................................................................................................................................... 2References: ........................................................................................................................................... 2JDK 1.6_07 Installation ....................................................................................................................... 2Glassfish v.2.1 Enterprise Installation .................................................................................................. 4Domain Setup ....................................................................................................................................... 7Enable and create Cluster ..................................................................................................................... 8Create the Node-Agents ..................................................................................................................... 11Creating the Instances ........................................................................................................................ 12Starting the Cluster after a DAS server restart ................................................................................... 14Deploy a .war file and enable it to deploy within the cluster............................................................. 14Appendix ASetup Diagram ............................................................................................................ 15

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    2/15

    Requirements:Glassfish ESB 2.1

    JDK 1.6_07

    References:10.4.0.71EXXAKDA2.EXXARO.COMDASFirst Machine

    10.4.0.72EXXAKPA3.EXXARO.COMNODE1Second Machine

    ! NOTE Images depicted in this guide are for illustration only, and do not necessarily represent theactual outcome of the instructions provided.

    JDK 1.6_07 Installation1. Run the JDK setup .exe file.

    Select accept if you agree with the license (declining will end the installation).

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    3/15

    2. Select the components to be installed.

    3. Select the component features to be installed.

    4. Select next, and complete the installation of the JDK.

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    4/15

    Glassfish v.2.1 Enterprise Installation1. Run the Glassfish ESB 2.1 Installation

    2. Choose to accept or reject the license agreement (rejecting will end the installation)

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    5/15

    3. Select the installation location of Netbeans as well as the JDK location (this could be found

    automatically and only needs confirmation)

    4. Select the installation location of Glassfish and location of the installed JDK. Keep the other

    settings as default, we will delete the default domain (domain 1) later and create our own.

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    6/15

    5. Confirm the settings and install

    ! Installation of the JDK and Glassfish are to be performed on all the machines that will form partof the cluster.

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    7/15

    Domain SetupSelect which server will be the primary server (Domain Administration ServerDAS)

    For the purpose of this document I will be using IP: 10.4.0.71EXXAKDA2.EXXARO.COM

    1. Open the command line interface on the first machine: Start Run cmd OK.2. Navigate to the location of Glassfish\bin (ie. C:\GlassfishESBv21\Glassfish\bin)3. Enter: asadmin list-domains4. The domain 'domain1' should appear5. Enter: asadmin delete-domain domain16. Enter: asadmin create-domain --instanceport 8082 --adminport 4848 --

    savemasterpassword=true --savelogin=true PROD

    7. The PROD domain will be created with instance port 8080, administration port 4848 andwill save the master and admin password to the default password file.

    8. You will now be prompted for the admin username, admin password and master password.Enter these to complete the domain creation.

    9. Enter: asadmin start-domain PROD10.Repeat these steps on 10.4.0.72EXXAKPA3.EXXARO.COM

    However, change instanceport to 8083 as DEV domain already uses 8082.

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    8/15

    Enable and create ClusterThe domain is set up on a development profile. We need to enable cluster support to create a

    Cluster. The following steps will describe how to enable and create the cluster.

    1. Using your browser type the following address to open the login page for the Administrationconsole:http://10.4.0.71:4848/

    2. Type in the admin username and password you entered when creating the domain. Uponlogin, either register or cancel the registration dialogue.

    3. On the left select 'Application Server', the application server options and settings will appearin the left window, select 'Add Cluster Support'.

    You will now be presented with a description of the changes that will be performed:

    Read the notes, and then select OK.

    http://10.4.0.71:4848/http://10.4.0.71:4848/http://10.4.0.71:4848/http://10.4.0.71:4848/
  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    9/15

    Once the process has been completed, you will see a 'successful' message as well as an option to

    stop the domain. We will need to restart the domain anyway, so go ahead and select 'Stop Instance'.

    Go back to the command line and enter asadmin list-domains

    The domain should not be running.

    Go ahead and enter: asadmin start-domain PROD

    Once started, go into the administration console again. You will notice that 'Clusters' is now

    available on the left navigation in the console.

    Repeat 'add cluster support' on all machines and Glassfish domains that will participate in thecluster. For the purpose of this document the above steps are repeated on 10.4.0.72

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    10/15

    Click on the 'Clusters' option, and then select 'New...' in the right window. Enter the name of the

    cluster (for this document I have used 'Pilog-Cluster' this could be anything to describe the cluster).

    Ensure the default configuration is selected as well as 'Make a copy of the selected Configuration'.

    Then click 'OK'.

    The Cluster will be created and appear as a sub-section of 'Clusters'

    NOTE: A new cluster is only created on the machine that will function as the DAS (domain

    administration server), so for the purpose of this document a new cluster is only created on

    10.4.0.71 and not on 10.4.0.72

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    11/15

    Create the Node-Agents

    Second Machine (NODE1)

    Open the command line interface on the second machine (10.4.0.72): Start Run cmd OK.

    Navigate to the location of Glassfish\bin (ie. C:\GlassfishESBv21\Glassfish\bin)Enter: asadmin create-node-agent --hostEXXAKDA2.EXXARO.COM NODE1

    This will create a node agent with the name NODE1 on 10.4.0.72 pointing to 10.4.0.71

    You can check this by entering: asadmin list-node-agents

    Now start the node agent: asadmin start-node-agent NODE1

    First Machine (DAS)

    Open the command line interface on the first machine (10.4.0.71): Start Run cmd OK.

    Navigate to the location of Glassfish\bin (ie. C:\GlassfishESBv21\Glassfish\bin)

    Enter: asadmin create-node-agent --hostlocalhost* DAS

    This will create a node agent with the name DASon 10.4.0.71 pointing to itself.

    You can check this by entering: asadmin list-node-agents

    Now start the node agent: asadmin start-node-agent DAS

    * You can also type: asadmin create-node-agent --hostEXXAKDA2.EXXARO.COM DAS

    (The host will always be the DAS and all nodes on every machine will point to it).

    Once the node agents have been created and started, you will see them under the Node Agents

    section on the left window:

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    12/15

    Creating the InstancesEnter the first machines Glassfish Administration Console: http://10.4.0.71:4848

    Navigate to Clusters and select the cluster you created earlier

    Click on the Instances tab located on the top right window

    Select New

    ! Notice the two node agents in the drop down list. (DAS and NODE1)

    Create the first instance which will be located on DAS by giving it the name Instance 1 and select

    OK.

    Repeat the steps to create another instance pointing to NODE1 with the name Instance 2 and select

    OK.

    Repeat the steps to create another instance pointing to DAS with the name Instance 3 and select

    OK.

    Repeat the steps to create another instance pointing to NODE1 with the name Instance 4 and select

    OK.

    You will now have four instances, twopointing to DAS and twoto NODE1

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    13/15

    example:

    Instance1 DAS

    Instance2 NODE1

    Instance3 DAS

    Instance4 NODE1

    The creation of instances is now complete.

    Click on Clusters, select the cluster by ticking the box and select Stop Cluster

    You will be asked to confirm, select OK

    Select the cluster again by ticking the box and select Start Cluster

    Confirm once again by selecting OK

    The cluster will start up and automatically start the instances associated with it; the instances will

    have the indicators Running with a green ticked image.

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    14/15

    Starting the Cluster after a DAS server restartAccess the DAS server (either by remote desktop or directly)

    Select Start Run cmd

    Navigate to the glassfish bin directory

    Enter: asadmin start-domain PRODOnce the domain is running:

    Enter: asadmin start-node-agent

    Log into the Administration Console and navigate to the Clusters option

    Select the cluster by ticking the box and click on Start Cluster

    Ensure all instances are running by selecting the Instances tab, the Status should be a green

    ticked image on all instances.

    Deploy a .war file and enable it to deploy within the cluster

    Log into the Administration Console and navigate to ApplicationsSelect Web Applications

    On the right window select Deploy

    Select the file by browsing to it.

    Select the Availability check box.

    Ensure the Target is selected for the Cluster and not server (standalone)

    Click on OK

    The .war file will be deployed on the cluster and propagated to all instances.

  • 8/8/2019 5- Glass Fish 21 Impl Cluster LB

    15/15

    Appendix A Setup Diagram

    Current Setup Diagram

    Future Setup Diagram (With Load Balancing)