Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2
    • Fix Version/s: 2.1.5, 2.2.1, 3.0.0
    • Component/s: Clustering
    • Security Level: public (Regular issues)
    • Labels:
      None
    • Environment:

      Windows XP g214

    • Patch Info:
      Patch Available

      Description

      Redeploy feature for farming.

      1. 5027_21.patch
        14 kB
        Ashish Jain
      2. 5027_21_updated.patch
        29 kB
        Ashish Jain

        Activity

        Hide
        Rex Wang added a comment -

        closing it

        Show
        Rex Wang added a comment - closing it
        Hide
        Rex Wang added a comment -

        Please link the new jira to this so that we can have a track. thanks

        Show
        Rex Wang added a comment - Please link the new jira to this so that we can have a track. thanks
        Hide
        Ashish Jain added a comment -

        Thanks Shawn I will open a new JIRA for GShell equivalence.

        Show
        Ashish Jain added a comment - Thanks Shawn I will open a new JIRA for GShell equivalence.
        Hide
        Shawn Jiang added a comment -

        Committed the patch to 21, 22, trunk with Revsion 924620,924622,924625

        Thanks Ashish for the patch ! Please open another JIRA to track the gshell equivalence.

        Show
        Shawn Jiang added a comment - Committed the patch to 21, 22, trunk with Revsion 924620,924622,924625 Thanks Ashish for the patch ! Please open another JIRA to track the gshell equivalence.
        Hide
        Shawn Jiang added a comment -

        Thanks, I'll hold on until the gshell patch is ready.

        Show
        Shawn Jiang added a comment - Thanks, I'll hold on until the gshell patch is ready.
        Hide
        Ashish Jain added a comment -

        Forgot to update yesterday-"I will upload another patch for gshell equivalent".

        Show
        Ashish Jain added a comment - Forgot to update yesterday-"I will upload another patch for gshell equivalent".
        Hide
        Ashish Jain added a comment -

        Uploading a modified patch.

        Show
        Ashish Jain added a comment - Uploading a modified patch.
        Hide
        Shawn Jiang added a comment -

        The scenarios are enough for this function. I'm looking forward to your updated patch.

        Show
        Shawn Jiang added a comment - The scenarios are enough for this function. I'm looking forward to your updated patch.
        Hide
        Ashish Jain added a comment -

        Hi Shawn,
        I have tested the following scenarios:
        1)deploy redeploy --targets <target_name> [module] [plan]
        2) deploy redeploy --targets <target_name> [module]
        3) deploy redeploy --targets <target_name> [module] [moduleId]

        Can you advice if there are other scenarios I need to test??

        I am still looking at the gshell equivalent.

        Thanks
        Ashish

        Show
        Ashish Jain added a comment - Hi Shawn, I have tested the following scenarios: 1)deploy redeploy --targets <target_name> [module] [plan] 2) deploy redeploy --targets <target_name> [module] 3) deploy redeploy --targets <target_name> [module] [moduleId] Can you advice if there are other scenarios I need to test?? I am still looking at the gshell equivalent. Thanks Ashish
        Hide
        Shawn Jiang added a comment -

        1, the --targets sequence problem, I think we need to document it somewhere.

        2, note the message when redeploy with the module-id, seems the redeploy are trying to find the module under GERONIMO_HOME\bin instead of GERONIMO_HOME\repository

        org.apache.geronimo.deployment.cli.DeploymentSyntaxException: Module or plan file does not exist: R:\farm_deploy\server0\bin\samples\servlet-examples-cluster-server1_G_MASTE
        

        3, The gshell equivalence is still needed.

        Thanks.

        Show
        Shawn Jiang added a comment - 1, the --targets sequence problem, I think we need to document it somewhere. 2, note the message when redeploy with the module-id, seems the redeploy are trying to find the module under GERONIMO_HOME\bin instead of GERONIMO_HOME\repository org.apache.geronimo.deployment.cli.DeploymentSyntaxException: Module or plan file does not exist: R:\farm_deploy\server0\bin\samples\servlet-examples-cluster-server1_G_MASTE 3, The gshell equivalence is still needed. Thanks.
        Hide
        Ashish Jain added a comment -

        Hi Shawn,

        Thanks for all your comments and improvements.

        I have fixed 1). I am not sure how 2) works because I do not see any app or plan which you are trying to redeploy.

        The results above indicate the patch you upload need to rework. I also found two obvious possible problems in the patch:

        1, if(args.length>=3 && args[0].equalsIgnoreCase("--targets")) //case of cluster redeployment
        + {

        The lines above hard coded the --targets as the first args, If the user put the --targets in different sequence, the command will fail.

        """""I am not sure if user can specify --targets in any order because I see ""commandLine = parser.parse(options, args, true); in DistributeCommandArgsImpl gives different results if u specify
        --target in any order.""""""""

        Thanks
        Ashish

        I am still looking into it

        Show
        Ashish Jain added a comment - Hi Shawn, Thanks for all your comments and improvements. I have fixed 1). I am not sure how 2) works because I do not see any app or plan which you are trying to redeploy. The results above indicate the patch you upload need to rework. I also found two obvious possible problems in the patch: 1, if(args.length>=3 && args [0] .equalsIgnoreCase("--targets")) //case of cluster redeployment + { The lines above hard coded the --targets as the first args, If the user put the --targets in different sequence, the command will fail. """""I am not sure if user can specify --targets in any order because I see ""commandLine = parser.parse(options, args, true); in DistributeCommandArgsImpl gives different results if u specify --target in any order."""""""" Thanks Ashish I am still looking into it
        Hide
        Shawn Jiang added a comment -

        Hi Ashish,

        I tried your patch but it does not work, see following two error scenarios:

        1, redeploy with the application and plan:

        R:\farm_deploy\server0\bin>deploy redeploy --targets org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car,j2eeType=ConfigurationStore,name=MasterConfigurationStore ../..
        /servlet-examples-cluster-server0.war ../../servlet-examples-cluster-plan0.xml
        Using GERONIMO_HOME:   R:\farm_deploy\server0
        Using GERONIMO_TMPDIR: var\temp
        Using JRE_HOME:        D:\dev\JDKs\sun_jdk6\jre
            No ModuleID or TargetModuleID provided.  Attempting to guess based
            on the content of the archive.
            Unable to locate Geronimo deployment plan in archive.  Calculating
            default ModuleID from archive name.
            Attempting to use ModuleID
            'default/servlet-examples-cluster-server0_G_MASTER//'
        2010-03-08 16:39:49,047 ERROR [DeployTool] Error:
        org.apache.geronimo.common.DeploymentException: default/servlet-examples-cluster-server0_G_MASTER// does not appear to be a the name of a module available on the selected server. Perhaps it has already been stopped or undeployed?  If you're
         trying to specify a TargetModuleID, use the syntax TargetName|ModuleName instead. If you're not sure what's running, try the list-modules command.
                at org.apache.geronimo.deployment.plugin.ConfigIDExtractor.identifyTargetModuleIDs(ConfigIDExtractor.java:205)
                at org.apache.geronimo.deployment.cli.CommandRedeploy.guessModuleId(CommandRedeploy.java:107)
                at org.apache.geronimo.deployment.cli.CommandRedeploy.execute(CommandRedeploy.java:181)
                at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:171)
                at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
                at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
                at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31)
        
        

        default/servlet-examples-cluster-server0_G_MASTER// was caculated by mistake. It should be samples/servlet-examples-cluster-server1_G_MASTER/2.2/war

        2, redeploy with the moduleId directly:

        R:\farm_deploy\server0\bin>deploy list-modules  org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car,j2eeType=ConfigurationStore,name=MasterConfigurationStore
        Using GERONIMO_HOME:   R:\farm_deploy\server0
        Using GERONIMO_TMPDIR: var\temp
        Using JRE_HOME:        D:\dev\JDKs\sun_jdk6\jre
        Found 1 module
          + samples/servlet-examples-cluster-server1_G_MASTER/2.2/war
        
        
        R:\farm_deploy\server0\bin>deploy redeploy --targets org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car,j2eeType=ConfigurationStore,name=MasterConfigurationStore sampl
        es/servlet-examples-cluster-server1_G_MASTER/2.2/war
        Using GERONIMO_HOME:   R:\farm_deploy\server0
        Using GERONIMO_TMPDIR: var\temp
        Using JRE_HOME:        D:\dev\JDKs\sun_jdk6\jre
        2010-03-08 16:36:56,937 ERROR [DeployTool] Error:
        org.apache.geronimo.deployment.cli.DeploymentSyntaxException: Module or plan file does not exist: R:\farm_deploy\server0\bin\samples\servlet-examples-cluster-server1_G_MASTER\2.2\war
                at org.apache.geronimo.deployment.cli.CommandRedeploy.checkFirstArguement(CommandRedeploy.java:53)
                at org.apache.geronimo.deployment.cli.CommandRedeploy.execute(CommandRedeploy.java:150)
                at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:171)
                at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
                at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
                at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31)
        

        -------------------------------------------------------------------------------------------------------------------------------------------------------------------

        The results above indicate the patch you upload need to rework. I also found two obvious possible problems in the patch:

        1, if(args.length>=3 && args[0].equalsIgnoreCase("--targets")) //case of cluster redeployment
        + {

        The lines above hard coded the --targets as the first args, If the user put the --targets in different sequence, the command will fail.

        2, The gshell equivalence does not get updated to pull in the new command options so that your new farm redeploy will definitely not work in gshell.
        The corresponding file should be
        framework\modules\geronimo-commands\src\main\groovy\org\apache\geronimo\commands\DeployModuleCommand.groovy

        Show
        Shawn Jiang added a comment - Hi Ashish, I tried your patch but it does not work, see following two error scenarios: 1, redeploy with the application and plan: R:\farm_deploy\server0\bin>deploy redeploy --targets org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car,j2eeType=ConfigurationStore,name=MasterConfigurationStore ../.. /servlet-examples-cluster-server0.war ../../servlet-examples-cluster-plan0.xml Using GERONIMO_HOME: R:\farm_deploy\server0 Using GERONIMO_TMPDIR: var\temp Using JRE_HOME: D:\dev\JDKs\sun_jdk6\jre No ModuleID or TargetModuleID provided. Attempting to guess based on the content of the archive. Unable to locate Geronimo deployment plan in archive. Calculating default ModuleID from archive name. Attempting to use ModuleID 'default/servlet-examples-cluster-server0_G_MASTER//' 2010-03-08 16:39:49,047 ERROR [DeployTool] Error: org.apache.geronimo.common.DeploymentException: default/servlet-examples-cluster-server0_G_MASTER// does not appear to be a the name of a module available on the selected server. Perhaps it has already been stopped or undeployed? If you're trying to specify a TargetModuleID, use the syntax TargetName|ModuleName instead. If you're not sure what's running, try the list-modules command. at org.apache.geronimo.deployment.plugin.ConfigIDExtractor.identifyTargetModuleIDs(ConfigIDExtractor.java:205) at org.apache.geronimo.deployment.cli.CommandRedeploy.guessModuleId(CommandRedeploy.java:107) at org.apache.geronimo.deployment.cli.CommandRedeploy.execute(CommandRedeploy.java:181) at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:171) at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45) at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67) at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31) default/servlet-examples-cluster-server0_G_MASTER// was caculated by mistake. It should be samples/servlet-examples-cluster-server1_G_MASTER/2.2/war 2, redeploy with the moduleId directly: R:\farm_deploy\server0\bin>deploy list-modules org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car,j2eeType=ConfigurationStore,name=MasterConfigurationStore Using GERONIMO_HOME: R:\farm_deploy\server0 Using GERONIMO_TMPDIR: var\temp Using JRE_HOME: D:\dev\JDKs\sun_jdk6\jre Found 1 module + samples/servlet-examples-cluster-server1_G_MASTER/2.2/war R:\farm_deploy\server0\bin>deploy redeploy --targets org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/farming/2.1.5-SNAPSHOT/car,j2eeType=ConfigurationStore,name=MasterConfigurationStore sampl es/servlet-examples-cluster-server1_G_MASTER/2.2/war Using GERONIMO_HOME: R:\farm_deploy\server0 Using GERONIMO_TMPDIR: var\temp Using JRE_HOME: D:\dev\JDKs\sun_jdk6\jre 2010-03-08 16:36:56,937 ERROR [DeployTool] Error: org.apache.geronimo.deployment.cli.DeploymentSyntaxException: Module or plan file does not exist: R:\farm_deploy\server0\bin\samples\servlet-examples-cluster-server1_G_MASTER\2.2\war at org.apache.geronimo.deployment.cli.CommandRedeploy.checkFirstArguement(CommandRedeploy.java:53) at org.apache.geronimo.deployment.cli.CommandRedeploy.execute(CommandRedeploy.java:150) at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:171) at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45) at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67) at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31) ------------------------------------------------------------------------------------------------------------------------------------------------------------------- The results above indicate the patch you upload need to rework. I also found two obvious possible problems in the patch: 1, if(args.length>=3 && args [0] .equalsIgnoreCase("--targets")) //case of cluster redeployment + { The lines above hard coded the --targets as the first args, If the user put the --targets in different sequence, the command will fail. 2, The gshell equivalence does not get updated to pull in the new command options so that your new farm redeploy will definitely not work in gshell. The corresponding file should be framework\modules\geronimo-commands\src\main\groovy\org\apache\geronimo\commands\DeployModuleCommand.groovy
        Hide
        Ashish Jain added a comment -

        To use this feature. Run the following command
        deploy.bat --user system --password manager redeploy --targets org.apache.geronimo.configs/farming/2.1.4/car?ServiceModule=org.apache.geronimo.configs/farming/2.1.4/car,j2eeType=ConfigurationStore,name=MasterConfigurationStore <application_file>

        Show
        Ashish Jain added a comment - To use this feature. Run the following command deploy.bat --user system --password manager redeploy --targets org.apache.geronimo.configs/farming/2.1.4/car?ServiceModule=org.apache.geronimo.configs/farming/2.1.4/car,j2eeType=ConfigurationStore,name=MasterConfigurationStore <application_file>
        Hide
        Ashish Jain added a comment -

        Please verify the patch thanks.

        Show
        Ashish Jain added a comment - Please verify the patch thanks.
        Hide
        Ashish Jain added a comment -

        Here is what I have understood

        Redeploy in geronimo is handled by a set of STOP, UNLOAD, UNINSTALL, INSTALL. LOAD, START operations. In case of farming as there are set of nodes we will have to obtain the JMX info of each of the nodes so as to get a kernel for each of the nodes. Any of the deploy commands is executed by obtaning the meta data and than calling up
        the execute for the meta data. In case of farming install and uninstall are taken care of by ConfigurationStore.install/uninstall.

        In case of redeploy configuration manager is being used which is obtained through COnfigurationUtil.getConfigurationManager(kernel).

        There were various ways I have tried to achieve this for farming

        1) To get the meta data for deploy and undeploy in redeploy, which is not possible due to private constructors.
        2) Extend the DeployTool to take up this case but this does not seem to be correct to be specific for one funtionality.
        3) Get the NodeInfo's in RedeployCommand and with some modifications to artifact call up a series of STOP, UNLOAD, UNINSTALL, INSTALL. LOAD, START operations.

        There can be many other approaches which could be used of which I am not aware of..

        Comments please??

        Show
        Ashish Jain added a comment - Here is what I have understood Redeploy in geronimo is handled by a set of STOP, UNLOAD, UNINSTALL, INSTALL. LOAD, START operations. In case of farming as there are set of nodes we will have to obtain the JMX info of each of the nodes so as to get a kernel for each of the nodes. Any of the deploy commands is executed by obtaning the meta data and than calling up the execute for the meta data. In case of farming install and uninstall are taken care of by ConfigurationStore.install/uninstall. In case of redeploy configuration manager is being used which is obtained through COnfigurationUtil.getConfigurationManager(kernel). There were various ways I have tried to achieve this for farming 1) To get the meta data for deploy and undeploy in redeploy, which is not possible due to private constructors. 2) Extend the DeployTool to take up this case but this does not seem to be correct to be specific for one funtionality. 3) Get the NodeInfo's in RedeployCommand and with some modifications to artifact call up a series of STOP, UNLOAD, UNINSTALL, INSTALL. LOAD, START operations. There can be many other approaches which could be used of which I am not aware of.. Comments please??

          People

          • Assignee:
            Shawn Jiang
            Reporter:
            Ashish Jain
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development