geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v3.0 > Plugin based Farming
Date Tue, 25 Jan 2011 09:52:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/9/4/_/styles/combined.css?spaceKey=GMOxDOC30&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Plugin+based+Farming">Plugin based Farming</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~maojia508">maojia</a>
    </h4>
        <br/>
                         <h4>Changes (66)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-unchanged" >{scrollbar} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{excerpt}This farming system uses plugins directly. Therefore, it is decoupled from the deployment system and allows running the plugin packaging (or &quot;deployment&quot;) and farm administration on different servers or machines.{excerpt}  The current implementation uses multicast for node discovery.  Farming information is stored in a database using jps.  The data model allows a single administration server to manage: <br>* multiple farms (currently sometimes termed _clusters_) <br>* multiple lists of plugins per farm (in an mXn relationship) <br>* multiple plugins per plugin list <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">This farming system uses plugins directly and is thus decoupled from the deployment system. It enables the plugin based farming administration for different servers or machines. Farming information is stored in a database using jps. The data model allows a single administration server to manage: <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">When a node starts up, it broadcasts a service advertisement including an optional node name (defaulting to host:jndi-port) and a farm name. When the administration server detects this as new, it instructs the new node to install all the plugin lists associated with that farm.  If the plugins are already installed, this is a no-op; otherwise the plugins are downloaded and installed from the plugin repository specified in the plugin list. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* multiple farms, also termed clusters  <br>* multiple lists of plugins per farm in an M X N relationship  <br>* multiple plugins per plugin list  <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Administrative operations include: <br>* Add a plugin list to a farm <br>* Add a plugin to a plugin list <br>* Add a plugin to a plugin list and the list to a farm <br>* Remove a plugin list from a farm <br>* Remove a plugin from a plugin list <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">When a node starts up, it broadcasts a service advertisement including an optional node name and a farm name. When the administration server detects this as new, it instructs the new node to install all the plugin lists associated with that farm. If the plugins are already installed, the system provides no further operation; otherwise the plugins are downloaded and installed from the plugin repository specified in the plugin list. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">(I haven&#39;t been able to think of a plausible meaning for &quot;remove a plugin from a plugin list from a farm&quot;) <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Farming administrative operations include: <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">These operations are available through the GShell *cluster/deploy* command. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* Add a plugin list to a farm  <br>* Add a plugin to a plugin list  <br>* Add a plugin to a plugin list and the list to a farm  <br>* Remove a plugin list from a farm  <br>* Remove a plugin from a plugin list  <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. Missing features <br>* Admin console support for the administrative operations <br>* Better support for setting up and starting multiple servers on one geronimo installation. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">These operations are available through the GShell [cluster/deploy|Geronimo GShell Commands#Administering cluster|(cluster/deploy)] command and are discussed in details in the [#Add and remove plugins and plugin lists] section. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">2</span><span class="diff-added-chars"style="background-color: #dfd;">3</span>.</span> Architectural Considerations <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Two separate sets of functionality are required for plugin based farms: <br># A plugin farm controller that tracks the farms node, plugin lists, and plugins and issues instructions to the nodes. The minimum configuration for this is the framework server with the o.a.g.configs/plugin-farm//car plugin installed. <br># A geronimo plugin repository accessible to all farm nodes. This can be a geronimo server running the geronimo-as-maven servlet, the local file system maven repository, a file based repository served by httpd, or a maven repository manager such as nexus. If a geronimo server is used it can be the same server as the plugin farm controller or a separate server. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Plugin based farming requires two separate sets of functionality: <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. Possible plugin-oriented production workflow using maven <br>This scenario assumes use of maven as a build tool and separate development, quality assurance (QA), and production groups. It needs two maven repositories, for development and production artifacts.  These can be simple file/httpd based repositories or something like nexus. Code transfer between groups is in the form of geronimo plugins packaged by the geronimo car-maven-plugin. <br># Development group deploys plugins into the development repository. <br># QA group tests these candidate plugins and upon acceptance deploys them to the production repository. <br># Production group distributes plugins to appropriate farms. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* A plugin farm controller that tracks the farms node, plugin lists, and plugins and issues instructions to the nodes.  <br>* A geronimo plugin repository accessible to all farm nodes. This can be a geronimo server running the geronimo-as-maven servlet, the local file system maven repository, a file based repository served by httpd, or a maven repository manager such as nexus. If a geronimo server is used, it can be the same server as the plugin farm controller or a separate server.  <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">The farming information is stored in the PluginFarmDatatabase database on the farm controller. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. Supporting plugins and assemblies <br>* o.a.g.configs/plugin-farm-member//car (plugins/clustering/plugin-farm-member) plugin turns a server into a plugin farm node. You can configure the multicast address and port, cluster name, and node name in config-substitutions.properties.  It is probably most convenient to not configure node name and rely on the default host:jndi-port. <br>* o.a.g.assemblies/geronimo-plugin-farm-node (plugins/clustering/geronimo-plugin-farm-node) extends the framework assembly with the plugin-farm-member plugin.  This is all you need to start up a farm node. <br>* o.a.g.configs/plugin-farm//car (plugins/clustering/plugin-farm) is the administration plugin for plugin-based farms.  Currently it&#39;s only accessible through the gshell cluster/deploy command. <br>* o.a.g.configs/plugin-farm-datasource//car (plugins/clustering/plugin-farm-datasource) is a derby datasource used by the plugin farm. It is intended to be replaced in production with a remote datasource. As always, the replacement plugin should use an &lt;artifact-alias&gt; element to redirect dependencies on plugin-farm-datasource to itself. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">In my sandbox until we find a better location or solution, as examples <br>* o.a.g.configs/controller-as-repo//car (sandbox/djencks/assemblies/controller-as-repo) is a non-classloader plugin that sets the default plugin repository to be the admin server.  This currently only works if both the admin server and all the farm nodes are running on the same machine -- obviously only a toy example scenario. <br>* o.a.g.assemblies/geronimo-tomcat-farm-controller//tar.gz|zip (sandbox/assemblies/geronimo-tomcat-farm-controller) is a server assembly that extends the tomcat javaee5 server with the plugin farm controller <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3. Supporting plugins and assemblies <br>* {{org.apache.geronimo.configs/plugin-farm-member//car}} (plugins/clustering/plugin-farm-member) plugin turns a server into a plugin farm node. You can configure the multicast address and port, cluster name, and node name in {{&lt;WASCE_HOME&gt;/var/config/config-substitutions.properties}}.  <br>*  {{org.apache.geronimo.assemblies/geronimo-plugin-farm-node//car}} (plugins/clustering/geronimo-plugin-farm-node) extends the framework assembly with the plugin-farm-member plugin. This is all you need to start up a farm node. <br>* {{org.apache.geronimo.configs/plugin-farm//car}} (plugins/clustering/plugin-farm) is the administration plugin for plugin-based farms. Currently it is only accessible through the Gshell [cluster/deploy|Geronimo GShell Commands#Administering cluster|(cluster/deploy)] command. <br>* {{org.apache.geronimo.configs/plugin-farm-datasource//car}} (plugins/clustering/plugin-farm-datasource) is a derby datasource used by the plugin farm. It is intended to be replaced in production with a remote datasource. As always, the replacement plugin should use an &lt;artifact-alias&gt; element to redirect dependencies on plugin-farm-datasource to itself. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. GShell cluster/deploy command syntax <br>The GShell *cluster/deploy* command takes one argument, the action, which must be *add* or *remove*, and options for the farm, plugin list, and plugin. <br>{code} <br>-f (--farm) farm name <br>-l (--pluginlist) plugin list name <br>-a (--pluginartifact) plugin artifact name <br>{code} <br>In addition there are some inherited options for connecting to the server: <br>{code} <br>-s (--hostname, --server) server name or IP address <br>-p (--port) server port <br>-u (--user) user name <br>-w (--password) password <br>--secure (use secure communication to server) <br>{code} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Make sure that the version of the plugins comply with your server.  <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. Example walkthrough <br>This example demonstrates the plugin farm on a single server, using nodes that all share the same geronimo installation, and using the admin server as farm controller, application deployment server, and plugin repository.  We&#39;ll install one of the sample applications on the admin server and deploy it to the farm.  I&#39;ve only tested this with all components built locally on one machine, but some such as the geronimo-plugin-farm-node should be available from the apache snapshot repository. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3. Setup steps <br>The following steps demonstrates the plugin based farming using nodes that all share the same geronimo installation. The admin server acts as the farm controller, application deployment server, and plugin repository. The setup steps for plugin based farming includes: <br># [#Set up farm controller] <br># [#Set up farm node] <br># [#Deploy a sample plugin to the farm] <br># [#Add and remove plugins and plugin lists] <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. Farm node setup <br># Obtain the geronimo-plugin-farm-node assembly, such as by building plugins/clustering. <br># Unpack it and copy the var directory to multiple servers, say server1 through server5. On a unix like system this can be done with a script like <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4. Set up farm controller <br>1. Start the controller server and install the following plugins in the server repository. For example, for a version 2.2 server, the plugins are stored in the http://geronimo/apache/org/plugins/geronimo-2.2 repository: <br>* {{org.apache.geronimo.configs/plugin-farm//car}} <br>* {{org.apache.geronimo.configs/plugin-farm-datasource//car}} <br>* {{org.apache.geronimo.configs/plugin-farm-member//car}} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{code}</span> <span class="diff-added-words"style="background-color: #dfd;"> </span> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">2. Open the {{config-substitutions.properties}} file and set the following attributes: <br>{panel:borderStyle=solid|title=Excerpt from config-substitutions.properties} <br>ClusterName=_farm name_ <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">#!/bin/bash</span> <span class="diff-added-words"style="background-color: #dfd;">NodeName=_name_</span> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">ServerHostname=_Node\_IP_ <br>DefaultPluginRepository=_share install plugin repository_ <br>{panel} <br>where <br>* {{ClusterName}}: defines the name of the farm that the server works in.  <br>* {{NodeName}}: is optional and defaults to {{host:jndi-port}}. For example, if the host IP for this server is 9.186.10.157 and the jndi-port is 1099, the default {{Nodename=9.186.10.157:1099}}.  <br>* {{ServerHostname}}:sets the node IP of this server. <br>* {{DefaultPluginRepository}}: defines the plugin repository accessible to all farm nodes.  For example, you can use the maven repository as the share install plugin repository by defining {{DefaultPluginRepository=http\://9.186.10.157\:8080/plugin/maven-repo}}. <br>\\ <br>3. Restart the server. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">tar xzf geronimo-plugin-farm-node-2.2-SNAPSHOT-bin.tar.gz <br>cd geronimo-plugin-farm-node-2.2-SNAPSHOT <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4. Set up farm node  <br>Use the following steps to set up every node server in the farm: <br>1. Start the node server and install the {{org.apache.geronimo.configs/plugin-farm-member//car}} plugin in the server repository. For example, for a version 2.2 server, the plugin is stored in the http://geronimo/apache/org/plugins/geronimo-2.2 repository. <br>2. Open the {{config-substitutions.properties}} file and set the following attributes: <br>{panel:borderStyle=solid|title=Excerpt from config-substitutions.properties} <br>ClusterName=_farm name_ <br>ServerHostname=_Node\_IP_ <br>{panel} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">for s in {1..5} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">3. Add the share install plugin repository to the {{plugin-repositories.properties}} file under {{&lt;WASCE_HOME&gt;/var/config/}} for each farm node, including access username and password. For example: <br>{panel:borderStyle=solid|title=Excerpt from plugin-repositories.properties} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">do</span> <span class="diff-added-words"style="background-color: #dfd;">http\://9.186.10.157\:8080/plugin/maven-repo/=system\=manager</span> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">sn=&quot;server${s}&quot;</span> <span class="diff-added-words"style="background-color: #dfd;">{panel}</span> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">  mkdir ${sn} <br>  cp -r var ${sn}/ <br>#uncomment to actually start the servers in the background <br># ./bin/gsh geronimo/start-server -G server.name=${sn} -G config.substitution.PortOffset=${s}0 &gt;${sn}.log &amp; <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">done</span> <span class="diff-added-words"style="background-color: #dfd;">where</span> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* the password {{manger}} in this example is in plain text. However, it is recommended to encrypt your password with the [deploy encrypt command|deploy#Encrypt|deploy encrypt command]. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">cd .. <br>{code} <br>Here&#39;s a fancier script that can both start and stop servers but still illustrates my bash illiteracy: <br>{code} <br>#!/bin/bash <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">4. Restart the server. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">BASE=geronimo-plugin-farm-node-2.2-SNAPSHOT <br>if  [ &quot;$1&quot; = &quot;stop&quot; ] ; then <br>( <br>  cd $BASE <br>  for server in server*; do <br>    pid=$(ps ax | grep &quot;gshell-bootstrap.jar geronimo/start-server -s $server&quot; | grep -v &#39;grep&#39; | cut -c 1-6) <br> <br>    if [ $pid ] ; then    <br>      echo &quot;Killing gshell for $server at pid $pid&quot; <br>      kill -9 $pid <br>    fi <br>    pid=$(ps ax |  grep &quot;javaagent.*$server&quot; | grep -v &#39;grep&#39; | cut -c 1-6) <br> <br>    if [ $pid ] ; then    <br>      echo &quot;Killing $server at pid $pid&quot; <br>      kill -9 $pid <br>    fi <br>  done <br>) <br>fi <br> <br>rm -rf $BASE <br>tar xzf $BASE-bin.tar.gz <br>( <br>cd $BASE <br> <br>for s in {1..5} <br>do  <br>  sn=&quot;server${s}&quot; <br>  mkdir ${sn} <br>  cp -r var ${sn}/ <br>  if  [ &quot;$1&quot; = &quot;start&quot; ] ; then <br>    ./bin/gsh geronimo/start-server -s ${sn} -G config.substitution.PortOffset=${s}0 &gt;${sn}.log &amp; <br>  fi <br>done <br>) <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4. Deploy a sample plugin to the farm <br>Install a plugin to the farm controller with command. For example, use the [Gshell command|Geronimo GShell Commands] as follows to install a HelloWorld.car plugin: <br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;"># Start the servers with command lines like this: <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">deploy/install-plugin D:/HelloWorld.car -s 9.186.10.157 <br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">./bin/gsh geronimo/start-server -G server.name=server1 -G config.substitution.PortOffset=10  <br>{code} <br>substituting appropriately for _server1_ and _10_ <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. Farm controller setup <br># Check out bits of my sandbox  <br>{code} <br>svn co https://svn.apache.org/repos/asf/geronimo/sandbox/djencks/assemblies <br>{code} <br># Build the plugin and assembly <br>{code} <br>cd assemblies/controller-as-repo <br>mvn clean install <br>cd ../geronimo-tomcat-farm-controller <br>mvn clean install <br>cd target <br>tar xzf geronimo-tomcat-farm-controller-2.2-SNAPSHOT-bin.tar.gz  <br>./geronimo-tomcat-farm-controller-2.2-SNAPSHOT/bin/gsh geronimo/start-server <br>{code} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* {{-s}}: is a command option that indicates the hostname of the server. For this example, the hostname is 9.186.10.157.  <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. Deploying a sample to the farm <br># Check out and build samples (to get the plan for deployment) <br>{code} <br>svn co https://svn.apache.org/repos/asf/geronimo/samples/trunk <br>cd trunk <br>mvn clean install <br>{code} <br># In a separate terminal in geronimo-tomcat-farm-controller-2.2-SNAPSHOT start GShell(bin/gsh) and run these commands to deploy a dependency (sample-datasource), the sample application, and then distribute it to the farm nodes: <br>{code} <br>deploy/list-plugins --username system --password manager org.apache.geronimo.samples/sample-datasource/2.2-SNAPSHOT/car <br># Choose the file repo based on your local maven repository <br>deploy/deploy /Users/david/geronimo/svn/geronimo/samples/trunk/samples/bank/bank-ear/target/bank-ear-2.2-SNAPSHOT.ear  <br> /Users/david/geronimo/svn/geronimo/samples/trunk/samples/bank/bank-tomcat/target/resources/META-INF/plan.xml  <br># Substitute actual paths to the ear and plan from your samples checkout <br>cluster/deploy add -f cluster1 -l pluginList1 -a org.apache.geronimo.samples/bank-tomcat/2.2-SNAPSHOT/car   <br>{code} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4. Add and remove plugins and plugin lists <br>Use the [cluster/deploy|Geronimo GShell Commands#Administering cluster|(cluster/deploy)] Gshell command to verify the farm that you set up. For example, add and remove plugins and plugin lists with the following commands: <br>Use this command to add a plugin list p1 to farm cluster1: <br>{code}cluster/deploy add -c cluster1 -l p1 -s 9.186.10.157 {code} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">In the server logs for the admin server and the farm nodes you should see that the application is installed along with all dependencies.  You should be able to see the bank sample on the nodes at for example, <br>http://localhost:8120/bank/ <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Use this command to add the {{org.apache.geronimo.samples/HelloWorld/1.0/car}} plugin to plugin list p1: <br>{code}cluster/deploy add -l p1 -a org.apache.geronimo.samples/HelloWorld/1.0/car -s 9.186.10.157{code} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. Removing plugins and plugin lists <br>In the gsh console above try <br>{code} <br>cluster/deploy remove -l pluginList1 -a org.apache.geronimo.samples/bank-tomcat/2.2-SNAPSHOT/car   <br># add back the plugin... <br>cluster/deploy add -f cluster1 -l pluginList1 -a org.apache.geronimo.samples/bank-tomcat/2.2-SNAPSHOT/car  <br># remove it again <br>cluster/deploy remove -f cluster1 -l pluginList1    <br>{code} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Use this command to add the {{org.apache.geronimo.samples/HelloWorld/1.0/car}} plugin to plugin list p1 and add p1 to farm cluster1: <br>{code}cluster/deploy add -c cluster1 -l p1 -a org.apache.geronimo.samples/HelloWorld/1.0/car -s 9.186.10.157{code} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. Configuration of plugin repositories. <br>The example above is set up, for convenience and portability, to use the farm controller server as the plugin repository, and to use _localhost_ as the server name.  This means no custom configuration is needed to run everything on one machine but is obviously incomplete for any serious use. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Use this command to remove a plugin list p1 from farm cluster1: <br>{code}cluster/deploy remove -c cluster1 -l p1{code} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The accessible plugin repositories are configured in each node in the {{var/config/plugin-repositories.properties}} file. This needs to include the appropriate plugin repository with any needed credentials. One way to do this is to write a non-classloader plugin to install a new {{var/config/plugin-repositories.properties}} to replace the default.  You&#39;d assemble a plugin node server including this additional plugin and distribute that to the nodes. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Use this command to remove the {{org.apache.geronimo.samples/HelloWorld/1.0/car}} plugin from plugin list p1: <br>{code}cluster/deploy remove -l p1 -a org.apache.geronimo.samples/HelloWorld/1.0/car -s 9.186.10.157{code} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">In addition, the controller also needs to have this plugin repository configured as the default in {{var/config/config-substitutions.properties}} in this entry: <br>{code} <br>DefaultPluginRepository=http\://localhost\:8080/plugin/maven-repo <br>{code}  <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Access the *Plugin* portlet form the *Administration console* to verify the installation result for all farm members. <br></td></tr>
            <tr><td class="diff-unchanged" > <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">2</span><span class="diff-added-chars"style="background-color: #dfd;">3</span>.</span> Future work <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">The following features could be added in the future: <br>* Provide *Administration console* support for the administrative operations. <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">enhancing</span> <span class="diff-added-words"style="background-color: #dfd;">Enhance</span> the monitoring console to find nodes using multicast <span class="diff-changed-words">discovery<span class="diff-added-chars"style="background-color: #dfd;">.</span></span> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* Provide better support for setting up and starting multiple servers on one geronimo installation. <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">enhancing</span> <span class="diff-added-words"style="background-color: #dfd;">Enhance</span> the car-maven-plugin to assemble servers with multiple instance support in the assembly. <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color: #f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td class='ScrollbarPrevIcon'><a href="/confluence/display/GMOxDOC30/JMS+clustering+in+Geronimo"><img border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td width='33%' class='ScrollbarPrevName'><a href="/confluence/display/GMOxDOC30/JMS+clustering+in+Geronimo">JMS clustering in Geronimo</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a href="/confluence/display/GMOxDOC30/Clustering+and+farming"><img border='0' align='middle' src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a href="/confluence/display/GMOxDOC30/Clustering+and+farming">Clustering and farming</a></td><td width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/GMOxDOC30/Tomcat+Native+Clustering">Tomcat Native Clustering</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/GMOxDOC30/Tomcat+Native+Clustering"><img border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>

<p>This farming system uses plugins directly and is thus decoupled from the deployment system. It enables the plugin based farming administration for different servers or machines. Farming information is stored in a database using jps. The data model allows a single administration server to manage:</p>

<ul>
	<li>multiple farms, also termed clusters</li>
	<li>multiple lists of plugins per farm in an M X N relationship</li>
	<li>multiple plugins per plugin list</li>
</ul>


<p>When a node starts up, it broadcasts a service advertisement including an optional node name and a farm name. When the administration server detects this as new, it instructs the new node to install all the plugin lists associated with that farm. If the plugins are already installed, the system provides no further operation; otherwise the plugins are downloaded and installed from the plugin repository specified in the plugin list.</p>

<p>Farming administrative operations include:</p>

<ul>
	<li>Add a plugin list to a farm</li>
	<li>Add a plugin to a plugin list</li>
	<li>Add a plugin to a plugin list and the list to a farm</li>
	<li>Remove a plugin list from a farm</li>
	<li>Remove a plugin from a plugin list</li>
</ul>


<p>These operations are available through the GShell <a href="/confluence/display/GMOxDOC30/Geronimo+GShell+Commands#GeronimoGShellCommands-Administeringcluster" title="(cluster/deploy)">cluster/deploy</a> command and are discussed in details in the <a href="#PluginbasedFarming-Addandremovepluginsandpluginlists">Add and remove plugins and plugin lists</a> section.</p>

<h3><a name="PluginbasedFarming-ArchitecturalConsiderations"></a>Architectural Considerations</h3>
<p>Plugin based farming requires two separate sets of functionality:</p>

<ul>
	<li>A plugin farm controller that tracks the farms node, plugin lists, and plugins and issues instructions to the nodes.</li>
	<li>A geronimo plugin repository accessible to all farm nodes. This can be a geronimo server running the geronimo-as-maven servlet, the local file system maven repository, a file based repository served by httpd, or a maven repository manager such as nexus. If a geronimo server is used, it can be the same server as the plugin farm controller or a separate server.</li>
</ul>


<p>The farming information is stored in the PluginFarmDatatabase database on the farm controller.</p>


<h3><a name="PluginbasedFarming-Supportingpluginsandassemblies"></a>Supporting plugins and assemblies</h3>
<ul>
	<li><tt>org.apache.geronimo.configs/plugin-farm-member//car</tt> (plugins/clustering/plugin-farm-member) plugin turns a server into a plugin farm node. You can configure the multicast address and port, cluster name, and node name in <tt>&lt;WASCE_HOME&gt;/var/config/config-substitutions.properties</tt>.</li>
	<li><tt>org.apache.geronimo.assemblies/geronimo-plugin-farm-node//car</tt> (plugins/clustering/geronimo-plugin-farm-node) extends the framework assembly with the plugin-farm-member plugin. This is all you need to start up a farm node.</li>
	<li><tt>org.apache.geronimo.configs/plugin-farm//car</tt> (plugins/clustering/plugin-farm) is the administration plugin for plugin-based farms. Currently it is only accessible through the Gshell <a href="/confluence/display/GMOxDOC30/Geronimo+GShell+Commands#GeronimoGShellCommands-Administeringcluster" title="(cluster/deploy)">cluster/deploy</a> command.</li>
	<li><tt>org.apache.geronimo.configs/plugin-farm-datasource//car</tt> (plugins/clustering/plugin-farm-datasource) is a derby datasource used by the plugin farm. It is intended to be replaced in production with a remote datasource. As always, the replacement plugin should use an &lt;artifact-alias&gt; element to redirect dependencies on plugin-farm-datasource to itself.</li>
</ul>


<p>Make sure that the version of the plugins comply with your server. </p>

<h3><a name="PluginbasedFarming-Setupsteps"></a>Setup steps</h3>
<p>The following steps demonstrates the plugin based farming using nodes that all share the same geronimo installation. The admin server acts as the farm controller, application deployment server, and plugin repository. The setup steps for plugin based farming includes:</p>
<ol>
	<li><a href="#PluginbasedFarming-Setupfarmcontroller">Set up farm controller</a></li>
	<li><a href="#PluginbasedFarming-Setupfarmnode">Set up farm node</a></li>
	<li><a href="#PluginbasedFarming-Deployasampleplugintothefarm">Deploy a sample plugin to the farm</a></li>
	<li><a href="#PluginbasedFarming-Addandremovepluginsandpluginlists">Add and remove plugins and plugin lists</a></li>
</ol>


<h4><a name="PluginbasedFarming-Setupfarmcontroller"></a>Set up farm controller</h4>
<p>1. Start the controller server and install the following plugins in the server repository. For example, for a version 2.2 server, the plugins are stored in the <a href="http://geronimo/apache/org/plugins/geronimo-2.2" class="external-link" rel="nofollow">http://geronimo/apache/org/plugins/geronimo-2.2</a> repository:</p>
<ul>
	<li><tt>org.apache.geronimo.configs/plugin-farm//car</tt></li>
	<li><tt>org.apache.geronimo.configs/plugin-farm-datasource//car</tt></li>
	<li><tt>org.apache.geronimo.configs/plugin-farm-member//car</tt>
<br class="atl-forced-newline" />
2. Open the <tt>config-substitutions.properties</tt> file and set the following attributes:
<div class="panel" style="border-style: solid;border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>Excerpt from config-substitutions.properties</b></div><div class="panelContent">
<p>ClusterName=<em>farm name</em><br/>
NodeName=<em>name</em> <br/>
ServerHostname=<em>Node&#95;IP</em><br/>
DefaultPluginRepository=<em>share install plugin repository</em></p>
</div></div>
<p>where</p></li>
	<li><tt>ClusterName</tt>: defines the name of the farm that the server works in.</li>
	<li><tt>NodeName</tt>: is optional and defaults to <tt>host:jndi-port</tt>. For example, if the host IP for this server is 9.186.10.157 and the jndi-port is 1099, the default <tt>Nodename=9.186.10.157:1099</tt>.</li>
	<li><tt>ServerHostname</tt>:sets the node IP of this server.</li>
	<li><tt>DefaultPluginRepository</tt>: defines the plugin repository accessible to all farm nodes.  For example, you can use the maven repository as the share install plugin repository by defining <tt>DefaultPluginRepository=http\://9.186.10.157\:8080/plugin/maven-repo</tt>.
<br class="atl-forced-newline" />
3. Restart the server.</li>
</ul>


<h4><a name="PluginbasedFarming-Setupfarmnode"></a>Set up farm node </h4>
<p>Use the following steps to set up every node server in the farm:<br/>
1. Start the node server and install the <tt>org.apache.geronimo.configs/plugin-farm-member//car</tt> plugin in the server repository. For example, for a version 2.2 server, the plugin is stored in the <a href="http://geronimo/apache/org/plugins/geronimo-2.2" class="external-link" rel="nofollow">http://geronimo/apache/org/plugins/geronimo-2.2</a> repository.<br/>
2. Open the <tt>config-substitutions.properties</tt> file and set the following attributes:</p>
<div class="panel" style="border-style: solid;border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>Excerpt from config-substitutions.properties</b></div><div class="panelContent">
<p>ClusterName=<em>farm name</em><br/>
ServerHostname=<em>Node&#95;IP</em></p>
</div></div>

<p>3. Add the share install plugin repository to the <tt>plugin-repositories.properties</tt> file under <tt>&lt;WASCE_HOME&gt;/var/config/</tt> for each farm node, including access username and password. For example:</p>
<div class="panel" style="border-style: solid;border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>Excerpt from plugin-repositories.properties</b></div><div class="panelContent">
<p>http\://9.186.10.157\:8080/plugin/maven-repo/=system\=manager</p>
</div></div>
<p>where</p>
<ul>
	<li>the password <tt>manger</tt> in this example is in plain text. However, it is recommended to encrypt your password with the <a href="/confluence/display/GMOxDOC30/deploy#deploy-Encrypt" title="deploy encrypt command">deploy encrypt command</a>.</li>
</ul>


<p>4. Restart the server.</p>

<h4><a name="PluginbasedFarming-Deployasampleplugintothefarm"></a>Deploy a sample plugin to the farm</h4>
<p>Install a plugin to the farm controller with command. For example, use the <a href="/confluence/display/GMOxDOC30/Geronimo+GShell+Commands" title="Geronimo GShell Commands">Gshell command</a> as follows to install a HelloWorld.car plugin:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
deploy/install-plugin D:/HelloWorld.car -s 9.186.10.157
</pre>
</div></div>

<ul>
	<li><tt>-s</tt>: is a command option that indicates the hostname of the server. For this example, the hostname is 9.186.10.157.</li>
</ul>


<h4><a name="PluginbasedFarming-Addandremovepluginsandpluginlists"></a>Add and remove plugins and plugin lists</h4>
<p>Use the <a href="/confluence/display/GMOxDOC30/Geronimo+GShell+Commands#GeronimoGShellCommands-Administeringcluster" title="(cluster/deploy)">cluster/deploy</a> Gshell command to verify the farm that you set up. For example, add and remove plugins and plugin lists with the following commands:<br/>
Use this command to add a plugin list p1 to farm cluster1:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">cluster/deploy add -c cluster1 -l p1 -s 9.186.10.157 </pre>
</div></div>

<p>Use this command to add the <tt>org.apache.geronimo.samples/HelloWorld/1.0/car</tt> plugin to plugin list p1:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">cluster/deploy add -l p1 -a org.apache.geronimo.samples/HelloWorld/1.0/car -s 9.186.10.157</pre>
</div></div>

<p>Use this command to add the <tt>org.apache.geronimo.samples/HelloWorld/1.0/car</tt> plugin to plugin list p1 and add p1 to farm cluster1:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">cluster/deploy add -c cluster1 -l p1 -a org.apache.geronimo.samples/HelloWorld/1.0/car -s 9.186.10.157</pre>
</div></div>

<p>Use this command to remove a plugin list p1 from farm cluster1:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">cluster/deploy remove -c cluster1 -l p1</pre>
</div></div>

<p>Use this command to remove the <tt>org.apache.geronimo.samples/HelloWorld/1.0/car</tt> plugin from plugin list p1:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">cluster/deploy remove -l p1 -a org.apache.geronimo.samples/HelloWorld/1.0/car -s 9.186.10.157</pre>
</div></div>

<p>Access the <b>Plugin</b> portlet form the <b>Administration console</b> to verify the installation result for all farm members.</p>


<h3><a name="PluginbasedFarming-Futurework"></a>Future work</h3>
<p>The following features could be added in the future:</p>
<ul>
	<li>Provide <b>Administration console</b> support for the administrative operations.</li>
	<li>Enhance the monitoring console to find nodes using multicast discovery.</li>
	<li>Provide better support for setting up and starting multiple servers on one geronimo installation.</li>
	<li>Enhance the car-maven-plugin to assemble servers with multiple instance support in the assembly.</li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Plugin+based+Farming">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20645455&revisedVersion=3&originalVersion=2">View Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Plugin+based+Farming?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message