5 Replies Latest reply on Apr 8, 2014 9:34 AM by Radoslav Husar

    what is nonce for

    Roman Jurkov Newbie

      Hello,

       

      can someone please elaborate on the use of "nonce" and also how do you get it programmatically?

       

      thank you

        • 1. Re: what is nonce for
          Radoslav Husar Master

          It's an unique identifier of the apache instance IMHO to prevent accindental actions being executed on the wrong balancer.

           

          You can disable the check if you wish to: Chapter 3. httpd configuration

           

          Also, you don't need to do it programatically and just use JBoss AS 7 / WildFly CLI to send those commands.

           

          See the section in the MCMP: https://community.jboss.org/wiki/Mod-ClusterManagementProtocol

           

          The ID is the one passed on links on the mod_cluster-manager handler page.

           

          HTH,

          Rado

          • 2. Re: what is nonce for
            Roman Jurkov Newbie

            thank you for your reply.

             

            I am actually integrating Catalyst (perl mvc framework) with mod_cluster via mcmp, so i don't have any jboss tools. i also have another use case, where our internal monitoring system would require to call mod_cluster-manager to request information about deployed applications, and their statuses. i do realize that i can disable nonce check, and that is what i am doing right now, however i would like not to disable it, and teach our monitoring app on how to get it, that is if nonce is necessary... i also do not wish to scrape nonce from main manager page (which i did do also, before i discovered CheckNonce option).

             

            thank you

            Roman.

            • 3. Re: what is nonce for
              Radoslav Husar Master

              Anyway, there is probably little reason to send commands to mod_cluster manager page, rather send commands over to virtual host where you normally send MCMP requests. IIUC, there isn't any extra operation that cannot be done this way. The page itself is designed for human interaction.

               

              Note that the demo attached also parses the HTML for the query to simulate administrator interaction with the page.

              1 of 1 people found this helpful
              • 4. Re: what is nonce for
                Roman Jurkov Newbie

                Thank you Rado,

                 

                i've missed that there are DUMP and INFO methods in MCMP, must of been looking at the docs for too long , for this thread here are usage samples via curl

                 

                curl -X INFO 'http://127.0.0.1:6666'

                Output:

                Node: [1],Name: barJvmRoute,Balancer: barBalancer,LBGroup: barDomain,Host: 127.0.0.1,Port: 3000,Type: http,Flushpackets: Off,Flushwait: 10,Ping: 5,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 99

                Node: [2],Name: barJvmRoute1,Balancer: barBalancer,LBGroup: barDomain1,Host: 127.0.0.1,Port: 3000,Type: http,Flushpackets: Off,Flushwait: 10,Ping: 5,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 99

                Node: [3],Name: barJvmRoute2,Balancer: barBalancer,LBGroup: barDomain2,Host: 127.0.0.1,Port: 3000,Type: http,Flushpackets: Off,Flushwait: 10,Ping: 5,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 99

                Node: [4],Name: barJvmRoute3,Balancer: barBalancer,LBGroup: barDomain3,Host: 127.0.0.1,Port: 3000,Type: http,Flushpackets: Off,Flushwait: 10,Ping: 5,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 99

                Node: [5],Name: barJvmRoute4,Balancer: barBalancer,LBGroup: barDomain4,Host: 127.0.0.1,Port: 3000,Type: http,Flushpackets: Off,Flushwait: 10,Ping: 5,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 99

                Vhost: [1:1:1], Alias: barAlias

                Vhost: [2:1:2], Alias: barAlias1

                Vhost: [3:1:3], Alias: barAlias2

                Vhost: [4:1:4], Alias: barAlias3

                Vhost: [5:1:5], Alias: barAlias4

                Context: [1:1:1], Context: /bar, Status: ENABLED

                Context: [1:1:2], Context: /cluster, Status: ENABLED

                Context: [2:1:3], Context: /bar, Status: STOPPED

                Context: [2:1:4], Context: /cluster, Status: ENABLED

                Context: [3:1:5], Context: /bar, Status: STOPPED

                Context: [3:1:6], Context: /cluster, Status: ENABLED

                Context: [4:1:7], Context: /bar, Status: STOPPED

                Context: [4:1:8], Context: /cluster, Status: ENABLED

                Context: [5:1:9], Context: /bar, Status: STOPPED

                Context: [5:1:10], Context: /cluster, Status: ENABLED

                 

                curl -X DUMP 'http://127.0.0.1:6666'

                Output:

                balancer: [1] Name: barBalancer Sticky: 1 [JSESSIONID]/[/cluster] remove: 0 force: 1 Timeout: 0 maxAttempts: 1

                node: [1:1],Balancer: barBalancer,JVMRoute: barJvmRoute,LBGroup: [barDomain],Host: 127.0.0.1,Port: 3000,Type: http,flushpackets: 0,flushwait: 10,ping: 5,smax: 1,ttl: 60,timeout: 0

                node: [2:2],Balancer: barBalancer,JVMRoute: barJvmRoute1,LBGroup: [barDomain1],Host: 127.0.0.1,Port: 3000,Type: http,flushpackets: 0,flushwait: 10,ping: 5,smax: 1,ttl: 60,timeout: 0

                node: [3:3],Balancer: barBalancer,JVMRoute: barJvmRoute2,LBGroup: [barDomain2],Host: 127.0.0.1,Port: 3000,Type: http,flushpackets: 0,flushwait: 10,ping: 5,smax: 1,ttl: 60,timeout: 0

                node: [4:4],Balancer: barBalancer,JVMRoute: barJvmRoute3,LBGroup: [barDomain3],Host: 127.0.0.1,Port: 3000,Type: http,flushpackets: 0,flushwait: 10,ping: 5,smax: 1,ttl: 60,timeout: 0

                node: [5:5],Balancer: barBalancer,JVMRoute: barJvmRoute4,LBGroup: [barDomain4],Host: 127.0.0.1,Port: 3000,Type: http,flushpackets: 0,flushwait: 10,ping: 5,smax: 1,ttl: 60,timeout: 0

                host: 1 [barAlias] vhost: 1 node: 1

                host: 2 [barAlias1] vhost: 1 node: 2

                host: 3 [barAlias2] vhost: 1 node: 3

                host: 4 [barAlias3] vhost: 1 node: 4

                host: 5 [barAlias4] vhost: 1 node: 5

                context: 1 [/bar] vhost: 1 node: 1 status: 1

                context: 2 [/cluster] vhost: 1 node: 1 status: 1

                context: 3 [/bar] vhost: 1 node: 2 status: 3

                context: 4 [/cluster] vhost: 1 node: 2 status: 1

                context: 5 [/bar] vhost: 1 node: 3 status: 3

                context: 6 [/cluster] vhost: 1 node: 3 status: 1

                context: 7 [/bar] vhost: 1 node: 4 status: 3

                context: 8 [/cluster] vhost: 1 node: 4 status: 1

                context: 9 [/bar] vhost: 1 node: 5 status: 3

                context: 10 [/cluster] vhost: 1 node: 5 status: 1

                 

                 

                apache configuration for Vhost on port 6666:

                Listen 127.0.0.1:6666

                  Maxsessionid 10

                  PersistSlots On

                  CheckNonce Off

                <VirtualHost 127.0.0.1:6666>

                  <Directory />

                    Order deny,allow

                    Deny from all

                    Allow from all

                  </Directory>

                 

                  EnableMCPMReceive

                  ServerAdvertise On

                  KeepAliveTimeout 60

                  MaxKeepAliveRequests 0

                  ManagerBalancerName mycluster

                  AdvertiseFrequency 1

                  AdvertiseGroup 224.0.1.105:23364

                </VirtualHost>

                 

                 

                thank you

                Roman.