glassfish
  1. glassfish
  2. GLASSFISH-17106

[UB]Add userdefined library information to load-balancer documentation

    Details

    • Type: Bug Bug
    • Status: In Progress
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: not determined
    • Component/s: docs
    • Labels:
      None

      Description

      There is Readme for userdefined library bundled with load-balancer plugin. This information can be captured in load-balancer documentation itself.

        Issue Links

          Activity

          Hide
          kshitiz_saxena added a comment -

          Content of user defined README
          ---------------------------------

          With User Defined Loadbalancer the user can have a custom logic for loadbalancing. Examples would be user identity based redirect, mime based load balancing etc. The user of this feature has to develop a shared library which would be loaded by load balancer. The user has to implement the interface as defined in loadbalancer.h which be placed in <glassfish plugin install dir>/lib/install/templates. An example module which implements the basic roundrobin algorithm(roundrobin.c) is included. The following are the steps needed to compile and configure the User Defined module.
          1. Copy the roundrobin.c to a work directory (for example: /home/user/workspacelb).
          2. Compile roundrobin.c with either the ANSI C/C++ compiler(for eg. sunstudio compiler or gcc). Take care to build a dynamic shared library and not a static executable.

          • Using sun studio cc compiler:
            % cc -m64 -G -I<glassfish plugin install dir>/lib/install/templates roundrobin.c -o roundrobin.so
            Note: In case of relocations error, use option "-xcode=pic32" with cc. cc -m64 -G -xcode=pic32 -I<glassfish plugin install dir>/lib/install/templates roundrobin.c -o roundrobin.so
          • Using gcc
            % gcc -m64 -shared -I<glassfish plugin install dir>/lib/install/templates roundrobin.c -o roundrobin.so
            Note: In case of relocations error, use option "-fPIC" with gcc. The command will look like: gcc -m64 -shared -fPIC -I<glassfish plugin install dir>/lib/install/templates roundrobin.c -o roundrobin.so
          • On windows download MSVC++ 2008 Express Edition from http://www.microsoft.com/express/download/ . Ensure that system environment variables related to MSVC are set. These include INCLUDE=<msvc-install-dir/VC/include>, LIB=<msvc-install-dir>/VC/lib;<microsoft-sdk-lib-dir>. Also note to update the PATH to include <msvc-install-dir>/VC/bin;<msvc-install-dir>/Common7/IDE. The command to build the dll would be:
            % cl /D_WINDOWS /I<glassfish plugin install dir>/lib/install/templates /LD roundrobin.c

          3. Change the loadbalancer.xml to point to the newly built module.
          <cluster name="cluster1" policy="user-defined" policy-module="home/user/workspacelb/roundrobin.so">

          4. Start the webserver if its not running or wait till LB re-configure.

          Show
          kshitiz_saxena added a comment - Content of user defined README --------------------------------- With User Defined Loadbalancer the user can have a custom logic for loadbalancing. Examples would be user identity based redirect, mime based load balancing etc. The user of this feature has to develop a shared library which would be loaded by load balancer. The user has to implement the interface as defined in loadbalancer.h which be placed in <glassfish plugin install dir>/lib/install/templates. An example module which implements the basic roundrobin algorithm(roundrobin.c) is included. The following are the steps needed to compile and configure the User Defined module. 1. Copy the roundrobin.c to a work directory (for example: /home/user/workspacelb). 2. Compile roundrobin.c with either the ANSI C/C++ compiler(for eg. sunstudio compiler or gcc). Take care to build a dynamic shared library and not a static executable. Using sun studio cc compiler: % cc -m64 -G -I<glassfish plugin install dir>/lib/install/templates roundrobin.c -o roundrobin.so Note: In case of relocations error, use option "-xcode=pic32" with cc. cc -m64 -G -xcode=pic32 -I<glassfish plugin install dir>/lib/install/templates roundrobin.c -o roundrobin.so Using gcc % gcc -m64 -shared -I<glassfish plugin install dir>/lib/install/templates roundrobin.c -o roundrobin.so Note: In case of relocations error, use option "-fPIC" with gcc. The command will look like: gcc -m64 -shared -fPIC -I<glassfish plugin install dir>/lib/install/templates roundrobin.c -o roundrobin.so On windows download MSVC++ 2008 Express Edition from http://www.microsoft.com/express/download/ . Ensure that system environment variables related to MSVC are set. These include INCLUDE=<msvc-install-dir/VC/include>, LIB=<msvc-install-dir>/VC/lib;<microsoft-sdk-lib-dir>. Also note to update the PATH to include <msvc-install-dir>/VC/bin;<msvc-install-dir>/Common7/IDE. The command to build the dll would be: % cl /D_WINDOWS /I<glassfish plugin install dir>/lib/install/templates /LD roundrobin.c 3. Change the loadbalancer.xml to point to the newly built module. <cluster name="cluster1" policy="user-defined" policy-module="home/user/workspacelb/roundrobin.so"> 4. Start the webserver if its not running or wait till LB re-configure.
          Hide
          Mike Fitch added a comment -

          The attachment user-defined-load-balancing.pdf shows the content added to the HA Admin Guide to resolve this issue. Please review this content and update this issue with comments.

          Show
          Mike Fitch added a comment - The attachment user-defined-load-balancing.pdf shows the content added to the HA Admin Guide to resolve this issue. Please review this content and update this issue with comments.
          Hide
          kshitiz_saxena added a comment -

          Change
          < To Build the Sample User-Defined Load Balancing Algorithm on Solaris
          to
          >To Build the Sample User-Defined Load Balancing Algorithm on Unix platform

          Change
          < The cc compiler, version 4.0.4 or later
          to
          > The sun studio cc compiler, version 4.0.4 or later

          Show
          kshitiz_saxena added a comment - Change < To Build the Sample User-Defined Load Balancing Algorithm on Solaris to >To Build the Sample User-Defined Load Balancing Algorithm on Unix platform Change < The cc compiler, version 4.0.4 or later to > The sun studio cc compiler, version 4.0.4 or later
          Hide
          Tom Mueller added a comment -

          Bulk update to set Fix Version to "not determined" for issues that had it set to a version that has already been released.

          Show
          Tom Mueller added a comment - Bulk update to set Fix Version to "not determined" for issues that had it set to a version that has already been released.

            People

            • Assignee:
              Mike Fitch
              Reporter:
              kshitiz_saxena
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: