Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

16.5. Configure a load-balanced cluster with NSAPI


Task: Configure a Load-balanced Cluster with NSAPI

Complete this task to configure a load-balanced cluster consisting of two worker nodes.

Prerequisites

  1. Define the paths to serve via NSAPI

    Open SJWS/PROFILE/config/obj.conf and define paths that should be served through NSAPI at the end of the default Object definition, as shown:
    <Object name="default">
          [...]
       NameTrans fn="assign-name" from="/status" name="jknsapi"
       NameTrans fn="assign-name" from="/images(|/*)" name="jknsapi"
       NameTrans fn="assign-name" from="/css(|/*)" name="jknsapi"
       NameTrans fn="assign-name" from="/nc(|/*)" name="jknsapi"
       NameTrans fn="assign-name" from="/jmx-console(|/*)" name="jknsapi"
       NameTrans fn="assign-name" from="/jkmanager/*" name="jknsapi"
    </Object>
    Copy to Clipboard Toggle word wrap
    You can map the path of any application deployed on your JBoss Enterprise Platform instance in this obj.conf file. In the example code, the /nc path is mapped to an application deployed under the name nc.
  2. Define the worker that serves each path

    Open SJWS/PROFILE/config/obj.conf and add the following jknsapi Object definition after the default Object definition.
    <Object name="jknsapi">
       ObjectType fn=force-type type=text/plain
       Service fn="jk_service" worker="status" path="/jkmanager(/*)"
       Service fn="jk_service" worker="router"
    </Object>
    Copy to Clipboard Toggle word wrap
    This jknsapi Object defines the worker nodes used to serve each path that was assigned to name="jknsapi" in the default Object.
  3. Define the workers and their attributes

    Create SJWS/PROFILE/config/workers.properties.
    Define the list of worker nodes and each worker node's properties in this file:

    Note

    For an explanation of workers.properties directives, refer to Appendix A, Reference: workers.properties
    # The advanced router LB worker
    worker.list=router,status
    
    #First EAP server definition, port 8009 is standard port for AJP in EAP
    #
    #lbfactor defines how much the worker will be used. 
    #The higher the number, the more requests are served
    #lbfactor is useful when one machine is more powerful 
    #ping_mode=A – all possible probes will be used to determine that
    #connections are still working
    worker.worker01.port=8009
    worker.worker01.host=127.0.0.1
    worker.worker01.type=ajp13
    worker.worker01.ping_mode=A
    worker.worker01.socket_timeout=10
    worker.worker01.lbfactor=3
    
    #Second EAP server definition
    worker.worker02.port=8009
    worker.worker02.host=127.0.0.100
    worker.worker02.type=ajp13
    worker.worker02.ping_mode=A
    worker.worker02.socket_timeout=10
    worker.worker02.lbfactor=1
    
    # Define the LB worker
    worker.router.type=lb
    worker.router.balance_workers=worker01,worker02
    
    # Define the status worker
    worker.status.type=status
    Copy to Clipboard Toggle word wrap
  4. Restart the server

    Once your Sun Java System Web Server instance is configured, restart it so that your changes take effect.
    For Sun Java System Web Server 6.1:
    SJWS/PROFILE/stop
    SJWS/PROFILE/start
    Copy to Clipboard Toggle word wrap
    For Sun Java System Web Server 7.0:
    SJWS/PROFILE/bin/stopserv
    SJWS/PROFILE/bin/startserv
    Copy to Clipboard Toggle word wrap
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat