12 Replies Latest reply on May 3, 2013 4:41 PM by ctomc

    Unable to add mod_cluster via CLI

    dastraub

      We try to add mod_cluster via CLI (using JBoss EAP 6 Final or JBoss 7.1.2) :

       

      [standalone@localhost:9999 /] /subsystem=modcluster:add

      {

          "outcome" => "failed",

          "failure-description" => "JBAS014746: connector may not be null",

          "rolled-back" => true

      }

       

      If I look in the source code of ModClusterSubsystemAdd, I can't find a way to provide the required information.

       

      We have the requirement to rollout a "plain" JBoss installation, based on standalone.xml (no HA) and add all other services, extension etc. via CLI.

        • 1. Re: Unable to add mod_cluster via CLI
          ctomc

          Hi,

           

          add operation requres you to pass some paramters

           

          try typing /subsystem=modcluster:add(

          and then press "tab" it will show you all params avalibale.

           

           

          --

          tomaz

          • 2. Re: Unable to add mod_cluster via CLI
            rhusar

            +1

             

            and for other stuff, https://docs.jboss.org/author/display/AS71/mod_cluster+in+AS7 might come in handy.

            • 3. Re: Unable to add mod_cluster via CLI
              dastraub

              -1

               

              Well, very cool and helpfull .. we know and read the docs ...

               

              By pressing "tab" => nothing else matters  - try it by yourself  (before answer ...)

               

              If we guess the parameters like this:

               

              [standalone@localhost:9999 /] /subsystem=modcluster:add(connector=http)

              Operation 'add' does not expect any property.

               

              Also, thanks for providing a working solution ...

              • 4. Re: Unable to add mod_cluster via CLI
                dastraub

                For clarification:

                Before we started using  the CLI, we have read the documentation and created a working mod_cluster configuration manually. I'm surprised what you expect here ...

                 

                Now we try to get the same results using cli:

                 

                [standalone@localhost:9999 /] /extension=org.jboss.as.modcluster:add

                {"outcome" => "success"}

                [standalone@localhost:9999 /] /subsystem=modcluster:add(

                ...

                By pressing tab (we already knew how CLI works), appears only the closing parenthesis.

                 

                What we use: release-version=7.1.2.Final-redhat-1, product-version=6.0.0.GA - ok, we should use the customer service rather then the community.

                • 5. Re: Unable to add mod_cluster via CLI
                  rhusar

                  Right, you need to add the extension as described e.g. here https://community.jboss.org/wiki/AddingANewExtensionSubsystemViaTheCLI

                   

                  So I suppose you figured out what you needed?

                   

                  PS: Yes, always prefer the customer service for questions like this.

                  1 of 1 people found this helpful
                  • 6. Re: Unable to add mod_cluster via CLI
                    dastraub

                    For those of you who are interested in a solution, after a few try and error as well as beers :

                     

                    [standalone@localhost:9999 /] /:composite(steps=[ {"operation" => "add", "address" => [ ("subsystem" => "modcluster") ] },

                    { "operation" => "add", "address" => [ ("subsystem" => "modcluster"), ("mod-cluster-config" => "configuration") ], "connector" => "http", "advertise" => "false", "proxy-list" => "localhost:6666" } ])

                    {

                        "outcome" => "success",

                        "result" => {

                            "step-1" => {"outcome" => "success"},

                            "step-2" => {"outcome" => "success"}

                        }

                    }

                    • 7. Re: Unable to add mod_cluster via CLI
                      ctomc

                      hi,

                       

                      you are doing this in composite operation, that might explain why tab complition did not work...

                       

                      anyhow, you can always see the structure and what is required by typing

                       

                      /subsystem=modcluster:read-resource-description(operations=true)

                       

                      it will show you what operations are avabile and what do they take as paramters.

                       

                      --

                      tomaz

                      • 8. Re: Unable to add mod_cluster via CLI
                        akostadinov
                        /:composite(steps=[ {"operation" => "add", "address" => [ ("profile" => "default"), ("subsystem" => "modcluster") ] },{ "operation" => "add", "address" => [ ("profile" => "default"), ("subsystem" => "modcluster"), ("mod-cluster-config" => "configuration") ], "advertise" => "false", "proxy-list" => "${jboss.modcluster.proxyList}", "connector" => "ajp"}, { "operation" => "add", "address" => [ ("profile" => "default"), ("subsystem" => "modcluster"), ("mod-cluster-config" => "configuration"), ("dynamic-load-provider" => "configuration") ]}, { "operation" => "add", "address" => [ ("profile" => "default"), ("subsystem" => "modcluster"), ("mod-cluster-config" => "configuration"), ("dynamic-load-provider" => "configuration"), ("load-metric" => "busyness")], "type" => "busyness"} ])
                        

                         

                        The above must have worked for 6.0.1 GA in domain mode but at the moment it is telling me: Operation 'composite' does not expect any property.

                         

                        Any idea how to fix?

                        • 9. Re: Unable to add mod_cluster via CLI
                          ctomc

                          If you are working in cli i would recommend you to use batching as it is much more natural as manualy creating complex composite operation call.

                           

                          batch

                          /subsystem=modcluster:add

                          /subsystem=modcluster/mod-cluster-config=configuration:add(....)

                          ...

                          ...

                          batch-run

                           

                          that is much more readable and easier to write in cli

                          • 10. Re: Unable to add mod_cluster via CLI
                            akostadinov

                            That's real cool but I'm getting:

                            [domain@10.4.144.8:9999 /] /profile=default/subsystem=web/connector=ajp:add(name=ajp,protocol=AJP/1.3,scheme=http,socket-binding=ajp)
                            [domain@10.4.144.8:9999 /] /profile=default/subsystem=modcluster:add 
                            {                                                                                  "outcome" => "failed",
                                "result" => undefined,
                                "failure-description" => "JBAS010839: Operation failed or was rolled back on all servers.",
                                "rolled-back" => true,
                                "server-groups" => {"main-server-group" => {"host" => {"ip-10-0-24-48" => {
                                    "server-one" => {"response" => {
                                        "outcome" => "failed",
                                        "result" => undefined,
                                        "failure-description" => "JBAS014746: connector may not be null",
                                        "rolled-back" => true
                                    }},
                                    "server-two" => {"response" => {
                                        "outcome" => "failed",
                                        "result" => undefined,
                                        "failure-description" => "JBAS014746: connector may not be null",
                                        "rolled-back" => true
                                    }}
                                }}}}
                            }
                            

                             

                            I don't see a way to supply the necessary parameter so the subsystem is added. Any ideas?

                             

                            Btw I translated the above command to the following batch:

                            /profile=default/subsystem=web/connector=ajp:add(name=ajp,protocol=AJP/1.3,scheme=http,socket-binding=ajp)
                            batch
                            /profile=default/subsystem=modcluster:add
                            /profile=default/subsystem=modcluster/mod-cluster-config=configuration:add(advertise=false, proxy-list="${jboss.modcluster.proxyList}", connector=ajp)
                            /profile=default/subsystem=modcluster/mod-cluster-config=configuration/dynamic-load-provider=configuration:add
                            /profile=default/subsystem=modcluster/mod-cluster-config=configuration/dynamic-load-provider=configuration/load-metric=busyness:add(type=busyness)
                            run-batch
                            

                             

                            Unfortunately id doesn't want to execute in any mode (batch or non-batch).

                             

                            UPDATE: the above commands are working to setup mod_cluster but *only* if no app servers are started at the time of executing the command. See my comment in bugzilla 900801.

                            UPDATE2: I've updated the above batch command now is complete and should work, adding mod_cluster outside of a batch is not possible but that totally makes sense because it needs some configuration and adding it without that configuration would not be desirable even if it was possible.

                            • 11. Re: Unable to add mod_cluster via CLI
                              rhusar

                              Operation 'composite' does not expect any property.

                              Seems to be a bug, see https://bugzilla.redhat.com/show_bug.cgi?id=959545

                              • 12. Re: Unable to add mod_cluster via CLI
                                ctomc

                                There is an workaround for this.

                                 

                                composite operation is marked as private and as such CLI does not know anything about it, aka it does not know what parameters it takes.

                                 

                                problem arised when newer version of CLI got better validation of operations and its parameters that is why it fails.

                                 

                                workaround would be to tell CLI not to validate operation parameters.

                                 

                                open jboss-cli.xml (in bin folder) and change value of validate-operation-requests to false

                                 

                                 

                                --

                                tomaz