How to add server dynamically in HA proxy backend?
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
add a comment |
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
add a comment |
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
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
tcp load-balancing haproxy
asked Dec 19 '16 at 7:00
Bhoomi ZalavadiyaBhoomi Zalavadiya
4451019
4451019
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
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):
- https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/
- https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/
add a comment |
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
add a comment |
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/
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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):
- https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/
- https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/
add a comment |
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):
- https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/
- https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/
add a comment |
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):
- https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/
- https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/
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):
- https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/
- https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/
answered Nov 14 '18 at 6:14
CᴴᴀZCᴴᴀZ
155316
155316
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Dec 19 '16 at 11:25
Bohdan BiehovBohdan Biehov
176113
176113
add a comment |
add a comment |
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/
add a comment |
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/
add a comment |
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/
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/
answered Dec 19 '16 at 11:36
Nic0Nic0
785
785
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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