How to add server dynamically in HA proxy backend?












3















I am using HA proxy version 1.6.6 for load balancing rabbitmq server, and it works fine but i want to add server dynamically in ha proxy backend in ubuntu using script. can anyone please tell me how can i done it?










share|improve this question



























    3















    I am using HA proxy version 1.6.6 for load balancing rabbitmq server, and it works fine but i want to add server dynamically in ha proxy backend in ubuntu using script. can anyone please tell me how can i done it?










    share|improve this question

























      3












      3








      3








      I am using HA proxy version 1.6.6 for load balancing rabbitmq server, and it works fine but i want to add server dynamically in ha proxy backend in ubuntu using script. can anyone please tell me how can i done it?










      share|improve this question














      I am using HA proxy version 1.6.6 for load balancing rabbitmq server, and it works fine but i want to add server dynamically in ha proxy backend in ubuntu using script. can anyone please tell me how can i done it?







      tcp load-balancing haproxy






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 19 '16 at 7:00









      Bhoomi ZalavadiyaBhoomi Zalavadiya

      4451019




      4451019
























          3 Answers
          3






          active

          oldest

          votes


















          1














          HAProxy OSS v1.8 does not include add/remove commands in Runtime API, but you can achieve similar functionality by using ready/disabled state commands.




          • Add server(s) config in haproxy.cfg in disabled state: server-template websrv 1-100 192.168.122.1:8080 check disabled //This adds 100 servers (websrv1...websrv100) in disabled state

          • Enable server (similar to add feature): set server be_template/websrv1 state ready

          • Disable server (similar to remove feature): set server be_template/websrv1 state maint


          Address and port can be changed using Runtime API as usual: set server be_template/websrv1 addr 192.168.50.112 port 8000



          Reference(s):




          1. https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/

          2. https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/






          share|improve this answer































            0














            As far as I know haproxy api ( stats socket ) does not support dynamic adding/removing servers to backend.
            One of the solution to use consul, the cost - reload service after some change.
            https://www.hashicorp.com/blog/haproxy-with-consul.html






            share|improve this answer































              0














              I think there is not this kind of features with HAProxy Open Source.



              If you use their ALOHA Load Balancer, there is an API to do this actions here :



              https://www.haproxy.com/resources/documentation/






              share|improve this answer























                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41217315%2fhow-to-add-server-dynamically-in-ha-proxy-backend%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                1














                HAProxy OSS v1.8 does not include add/remove commands in Runtime API, but you can achieve similar functionality by using ready/disabled state commands.




                • Add server(s) config in haproxy.cfg in disabled state: server-template websrv 1-100 192.168.122.1:8080 check disabled //This adds 100 servers (websrv1...websrv100) in disabled state

                • Enable server (similar to add feature): set server be_template/websrv1 state ready

                • Disable server (similar to remove feature): set server be_template/websrv1 state maint


                Address and port can be changed using Runtime API as usual: set server be_template/websrv1 addr 192.168.50.112 port 8000



                Reference(s):




                1. https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/

                2. https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/






                share|improve this answer




























                  1














                  HAProxy OSS v1.8 does not include add/remove commands in Runtime API, but you can achieve similar functionality by using ready/disabled state commands.




                  • Add server(s) config in haproxy.cfg in disabled state: server-template websrv 1-100 192.168.122.1:8080 check disabled //This adds 100 servers (websrv1...websrv100) in disabled state

                  • Enable server (similar to add feature): set server be_template/websrv1 state ready

                  • Disable server (similar to remove feature): set server be_template/websrv1 state maint


                  Address and port can be changed using Runtime API as usual: set server be_template/websrv1 addr 192.168.50.112 port 8000



                  Reference(s):




                  1. https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/

                  2. https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/






                  share|improve this answer


























                    1












                    1








                    1







                    HAProxy OSS v1.8 does not include add/remove commands in Runtime API, but you can achieve similar functionality by using ready/disabled state commands.




                    • Add server(s) config in haproxy.cfg in disabled state: server-template websrv 1-100 192.168.122.1:8080 check disabled //This adds 100 servers (websrv1...websrv100) in disabled state

                    • Enable server (similar to add feature): set server be_template/websrv1 state ready

                    • Disable server (similar to remove feature): set server be_template/websrv1 state maint


                    Address and port can be changed using Runtime API as usual: set server be_template/websrv1 addr 192.168.50.112 port 8000



                    Reference(s):




                    1. https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/

                    2. https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/






                    share|improve this answer













                    HAProxy OSS v1.8 does not include add/remove commands in Runtime API, but you can achieve similar functionality by using ready/disabled state commands.




                    • Add server(s) config in haproxy.cfg in disabled state: server-template websrv 1-100 192.168.122.1:8080 check disabled //This adds 100 servers (websrv1...websrv100) in disabled state

                    • Enable server (similar to add feature): set server be_template/websrv1 state ready

                    • Disable server (similar to remove feature): set server be_template/websrv1 state maint


                    Address and port can be changed using Runtime API as usual: set server be_template/websrv1 addr 192.168.50.112 port 8000



                    Reference(s):




                    1. https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/

                    2. https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 14 '18 at 6:14









                    CᴴᴀZCᴴᴀZ

                    155316




                    155316

























                        0














                        As far as I know haproxy api ( stats socket ) does not support dynamic adding/removing servers to backend.
                        One of the solution to use consul, the cost - reload service after some change.
                        https://www.hashicorp.com/blog/haproxy-with-consul.html






                        share|improve this answer




























                          0














                          As far as I know haproxy api ( stats socket ) does not support dynamic adding/removing servers to backend.
                          One of the solution to use consul, the cost - reload service after some change.
                          https://www.hashicorp.com/blog/haproxy-with-consul.html






                          share|improve this answer


























                            0












                            0








                            0







                            As far as I know haproxy api ( stats socket ) does not support dynamic adding/removing servers to backend.
                            One of the solution to use consul, the cost - reload service after some change.
                            https://www.hashicorp.com/blog/haproxy-with-consul.html






                            share|improve this answer













                            As far as I know haproxy api ( stats socket ) does not support dynamic adding/removing servers to backend.
                            One of the solution to use consul, the cost - reload service after some change.
                            https://www.hashicorp.com/blog/haproxy-with-consul.html







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Dec 19 '16 at 11:25









                            Bohdan BiehovBohdan Biehov

                            176113




                            176113























                                0














                                I think there is not this kind of features with HAProxy Open Source.



                                If you use their ALOHA Load Balancer, there is an API to do this actions here :



                                https://www.haproxy.com/resources/documentation/






                                share|improve this answer




























                                  0














                                  I think there is not this kind of features with HAProxy Open Source.



                                  If you use their ALOHA Load Balancer, there is an API to do this actions here :



                                  https://www.haproxy.com/resources/documentation/






                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    I think there is not this kind of features with HAProxy Open Source.



                                    If you use their ALOHA Load Balancer, there is an API to do this actions here :



                                    https://www.haproxy.com/resources/documentation/






                                    share|improve this answer













                                    I think there is not this kind of features with HAProxy Open Source.



                                    If you use their ALOHA Load Balancer, there is an API to do this actions here :



                                    https://www.haproxy.com/resources/documentation/







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Dec 19 '16 at 11:36









                                    Nic0Nic0

                                    785




                                    785






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41217315%2fhow-to-add-server-dynamically-in-ha-proxy-backend%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        Bressuire

                                        Vorschmack

                                        Quarantine