7 Replies Latest reply on Sep 5, 2014 2:04 AM by Dima Kononov

    How to create and configure cluster in my Wildfly server. I want to use mod_cluster.

    Dima Kononov Newbie

      I create 2 examples standalone-server and I want to use mod_cluster for load balancing. I add to /etc/httpd/conf/httpd.conf next lines:

      LoadModule proxy_module modules/mod_proxy.so

      LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

      LoadModule slotmem_module modules/mod_slotmem.so

      LoadModule manager_module modules/mod_manager.so

      LoadModule proxy_cluster_module modules/mod_proxy_cluster.so

      LoadModule advertise_module modules/mod_advertise.so

      and I add appropriate files to  /etc/httpd/modules, but I can't run httpd service. If I delete this lines, I run httpd succesfull.

      Please, give me step-by-step instruction for configure cluster and load balancing.

      Sorry for my bad english=)))

        • 3. Re: How to create and configure cluster in my Wildfly server. I want to use mod_cluster.
          Dima Kononov Newbie

          I create file mod-cluster.conf in /etc/httpd/conf.d:

           

          LoadModule slotmem_module modules/mod_slotmem.so

          LoadModule manager_module modules/mod_manager.so

          LoadModule proxy_cluster_module modules/mod_proxy_cluster.so

          LoadModule advertise_module modules/mod_advertise.so

          Listen *:10001

          MemManagerFile /var/cache/httpd

          <VirtualHost *:10001>

              <Directory />

                  Order deny,allow

                  Deny from all

                  Allow from all

              </Directory>

              # This directive allows you to view mod_cluster status at URL http://10.211.55.4:10001/mod_cluster-manager

              <Location /mod_cluster-manager>

                  SetHandler mod_cluster-manager

                  Order deny,allow

                  Deny from all

                  Allow from all

              </Location>

                  KeepAliveTimeout 60

                  MaxKeepAliveRequests 0

                  ManagerBalancerName mycluster

                  AdvertiseFrequency 5

          </VirtualHost>

           

          and I performed the actions to configure Wildfly (WildFly 8 Cluster Howto - WildFly 9 - Project Documentation Editor), but I can't run test application on 10001 or 80 ports. Application run on 8080, 8230 and 8330 ports only.

          • 4. Re: How to create and configure cluster in my Wildfly server. I want to use mod_cluster.
            Dima Kononov Newbie

            I change my-cluster.conf:

             

            LoadModule slotmem_module modules/mod_slotmem.so

            LoadModule manager_module modules/mod_manager.so

            LoadModule proxy_cluster_module modules/mod_proxy_cluster.so

            LoadModule advertise_module modules/mod_advertise.so

             

            Listen *:80

            <IfModule manager_module>

                Listen 10.19.4.102:10001

                ManagerBalancerName mybalancer

                MemManagerFile /var/cache/httpd

                <VirtualHost 10.19.4.102:10001>

                    ServerName 10.19.4.102

                    <Location /mod_cluster-manager>

                        SetHandler mod_cluster-manager

                        Order allow,deny

                        Allow from all

                    </Location>

                    <Location / >

                        Order allow,deny

                        Allow from all

                    </Location>

                    KeepAliveTimeout 60

                    MaxKeepAliveRequests 0

                    AdvertiseFrequency 60

                    AdvertiseSecurityKey secret

                    AdvertiseGroup 224.0.1.105:23364

                    EnableMCPMReceive

                    ServerAdvertise on http://10.19.4.102:10001

                    AllowDisplay On

                    LogLevel debug

                    ErrorLog "logs/mycluster_log"

                </VirtualHost>

            </IfModule>

            ProxyPreserveHost On

            ProxyPass / balancer://mybalancer/

            ProxyPassReverse / balancer://mybalancer

             

            but I can,t open my application on 10001 port.

            mycluster_log:

            [Wed Aug 27 16:39:50 2014] [debug] mod_proxy_cluster.c(1010): update_workers_node starting

            [Wed Aug 27 16:39:50 2014] [debug] mod_proxy_cluster.c(1025): update_workers_node done

            [Wed Aug 27 16:40:00 2014] [debug] mod_manager.c(1910): manager_trans STATUS

            [Wed Aug 27 16:40:00 2014] [debug] mod_manager.c(2618): manager_handler STATUS processing: "JVMRoute=subchik%3Aserver-three-subchik&Load=100"

            [Wed Aug 27 16:40:00 2014] [debug] mod_manager.c(1625): Processing STATUS

            [Wed Aug 27 16:40:00 2014] [debug] proxy_util.c(1964): proxy: ajp: retrying the worker for (10.19.4.46)

            [Wed Aug 27 16:40:00 2014] [debug] proxy_util.c(1970): proxy: ajp: worker for (10.19.4.46) has been marked for retry

            [Wed Aug 27 16:40:00 2014] [debug] proxy_util.c(2026): proxy: ajp: has acquired connection for (10.19.4.46)

            [Wed Aug 27 16:40:00 2014] [debug] proxy_util.c(2082): proxy: connecting ajp://10.19.4.46:8259/ to 10.19.4.46:8259

            [Wed Aug 27 16:40:00 2014] [debug] proxy_util.c(2209): proxy: connected / to 10.19.4.46:8259

            [Wed Aug 27 16:40:00 2014] [debug] proxy_util.c(2460): proxy: ajp: fam 2 socket created to connect to 10.19.4.46

            [Wed Aug 27 16:40:00 2014] [error] (13)Permission denied: proxy: ajp: attempt to connect to 10.19.4.46:8259 (10.19.4.46) failed

            [Wed Aug 27 16:40:00 2014] [error] ap_proxy_connect_backend disabling worker for (10.19.4.46)

            [Wed Aug 27 16:40:00 2014] [debug] mod_proxy_cluster.c(1361): proxy_cluster_try_pingpong: can't connect to backend

            [Wed Aug 27 16:40:00 2014] [debug] proxy_util.c(2044): proxy: ajp: has released connection for (10.19.4.46)

            [Wed Aug 27 16:40:00 2014] [debug] mod_proxy_cluster.c(2331): proxy_cluster_isup: pingpong ajp://10.19.4.46:8259/ failed

            [Wed Aug 27 16:40:00 2014] [debug] mod_manager.c(2667): manager_handler STATUS  OK

             

            If I run command

            telnet 10.19.4.46 8259

            I successful connect to 10.19.4.46

            This is my mod_cluster-manager display:

            modcluster.png

            what do I do wrong?

            • 5. Re: Re: How to create and configure cluster in my Wildfly server. I want to use mod_cluster.
              Radoslav Husar Master

              I don't see anything obviously wrong. With this setup, the 10.19.4.102:10001 should only be receiving configuration commands from mod_cluster in WildFly, then on the 10.19.4.102:80 you should be able to access the application such as http://10.19.4.102/cluster-demo.

               

              Always check your mod_cluster-manager page that the appropriate contexts are registered.

              • 6. Re: Re: Re: How to create and configure cluster in my Wildfly server. I want to use mod_cluster.
                Radoslav Husar Master

                Well, actually the httpd failed to connect to the backend WildFly server from the logs:

                 

                [Wed Aug 27 16:40:00 2014] [debug] mod_proxy_cluster.c(2331): proxy_cluster_isup: pingpong ajp://10.19.4.46:8259/ failed
                

                Make sure there isn't a firewall blocking the traffic. Have you tried the telnet command from the machine that runs the httpd?

                • 7. Re: How to create and configure cluster in my Wildfly server. I want to use mod_cluster.
                  Dima Kononov Newbie

                  I entered the next command

                  setsebool httpd_can_network_connect 1

                  and I connected to my application.

                  Thank you!