Docker consul cluster without swarm
Due to company restrictions I cannot use docker-swarm, so I am trying to setup a consul cluster on multiple machines sharing the same host network, let's pretend these are the 3 machines addresses (I am using virtualbox with docker-machine for testing), these IP are known as HOST_IP
by their containers:
dm1: 192.168.99.100
dm2: 192.168.99.101
dm3: 192.168.99.102
CONSUL_BOOTSTRAP_IP
is the main consul bootstrap server 192.168.99.100
.
This setup works (I get the 3 nodes up and running in the web UI) but I get some weird logs in the containers:
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:48 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:50 [WARN] consul: error getting server health from "64bbf570ff39": context deadline exceeded
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:51 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:52 [WARN] consul: error getting server health from "64bbf570ff39": context deadline exceeded
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:53 [WARN] consul: error getting server health from "64bbf570ff39": last request still outstanding
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:54 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
Why is consul trying to access the docker container internal IP 172.18.0.*
instead of using the -advertise
address ? This is annoying and in the UI I can see some ghost nodes appearing and disappearing with an error status.
Here are my compose files:
dm1
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-01
-server
-client 0.0.0.0
-bootstrap-expect 3
-ui
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
dm2
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-02
-server
-client 0.0.0.0
-bootstrap-expect 3
-retry-join ${CONSUL_BOOTSTRAP_IP}
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
dm3
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-03
-server
-client 0.0.0.0
-bootstrap-expect 3
-retry-join ${CONSUL_BOOTSTRAP_IP}
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
docker docker-compose consul
add a comment |
Due to company restrictions I cannot use docker-swarm, so I am trying to setup a consul cluster on multiple machines sharing the same host network, let's pretend these are the 3 machines addresses (I am using virtualbox with docker-machine for testing), these IP are known as HOST_IP
by their containers:
dm1: 192.168.99.100
dm2: 192.168.99.101
dm3: 192.168.99.102
CONSUL_BOOTSTRAP_IP
is the main consul bootstrap server 192.168.99.100
.
This setup works (I get the 3 nodes up and running in the web UI) but I get some weird logs in the containers:
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:48 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:50 [WARN] consul: error getting server health from "64bbf570ff39": context deadline exceeded
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:51 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:52 [WARN] consul: error getting server health from "64bbf570ff39": context deadline exceeded
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:53 [WARN] consul: error getting server health from "64bbf570ff39": last request still outstanding
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:54 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
Why is consul trying to access the docker container internal IP 172.18.0.*
instead of using the -advertise
address ? This is annoying and in the UI I can see some ghost nodes appearing and disappearing with an error status.
Here are my compose files:
dm1
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-01
-server
-client 0.0.0.0
-bootstrap-expect 3
-ui
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
dm2
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-02
-server
-client 0.0.0.0
-bootstrap-expect 3
-retry-join ${CONSUL_BOOTSTRAP_IP}
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
dm3
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-03
-server
-client 0.0.0.0
-bootstrap-expect 3
-retry-join ${CONSUL_BOOTSTRAP_IP}
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
docker docker-compose consul
add a comment |
Due to company restrictions I cannot use docker-swarm, so I am trying to setup a consul cluster on multiple machines sharing the same host network, let's pretend these are the 3 machines addresses (I am using virtualbox with docker-machine for testing), these IP are known as HOST_IP
by their containers:
dm1: 192.168.99.100
dm2: 192.168.99.101
dm3: 192.168.99.102
CONSUL_BOOTSTRAP_IP
is the main consul bootstrap server 192.168.99.100
.
This setup works (I get the 3 nodes up and running in the web UI) but I get some weird logs in the containers:
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:48 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:50 [WARN] consul: error getting server health from "64bbf570ff39": context deadline exceeded
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:51 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:52 [WARN] consul: error getting server health from "64bbf570ff39": context deadline exceeded
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:53 [WARN] consul: error getting server health from "64bbf570ff39": last request still outstanding
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:54 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
Why is consul trying to access the docker container internal IP 172.18.0.*
instead of using the -advertise
address ? This is annoying and in the UI I can see some ghost nodes appearing and disappearing with an error status.
Here are my compose files:
dm1
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-01
-server
-client 0.0.0.0
-bootstrap-expect 3
-ui
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
dm2
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-02
-server
-client 0.0.0.0
-bootstrap-expect 3
-retry-join ${CONSUL_BOOTSTRAP_IP}
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
dm3
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-03
-server
-client 0.0.0.0
-bootstrap-expect 3
-retry-join ${CONSUL_BOOTSTRAP_IP}
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
docker docker-compose consul
Due to company restrictions I cannot use docker-swarm, so I am trying to setup a consul cluster on multiple machines sharing the same host network, let's pretend these are the 3 machines addresses (I am using virtualbox with docker-machine for testing), these IP are known as HOST_IP
by their containers:
dm1: 192.168.99.100
dm2: 192.168.99.101
dm3: 192.168.99.102
CONSUL_BOOTSTRAP_IP
is the main consul bootstrap server 192.168.99.100
.
This setup works (I get the 3 nodes up and running in the web UI) but I get some weird logs in the containers:
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:48 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:50 [WARN] consul: error getting server health from "64bbf570ff39": context deadline exceeded
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:51 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:52 [WARN] consul: error getting server health from "64bbf570ff39": context deadline exceeded
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:53 [WARN] consul: error getting server health from "64bbf570ff39": last request still outstanding
consul-server_1_46f1167db7a9 | 2018/11/14 08:06:54 [WARN] consul: error getting server health from "64bbf570ff39": rpc error getting client: failed to get conn: dial tcp <nil>->172.18.0.2:8300: connect: no route to host
Why is consul trying to access the docker container internal IP 172.18.0.*
instead of using the -advertise
address ? This is annoying and in the UI I can see some ghost nodes appearing and disappearing with an error status.
Here are my compose files:
dm1
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-01
-server
-client 0.0.0.0
-bootstrap-expect 3
-ui
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
dm2
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-02
-server
-client 0.0.0.0
-bootstrap-expect 3
-retry-join ${CONSUL_BOOTSTRAP_IP}
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
dm3
version: '2'
services:
consul-server:
image: consul:latest
networks:
- back
command:
agent
-node consul-03
-server
-client 0.0.0.0
-bootstrap-expect 3
-retry-join ${CONSUL_BOOTSTRAP_IP}
-advertise ${HOST_IP}
ports:
- "8300:8300"
- "8301:8301"
- "8301:8301/udp"
- "8302:8302"
- "8302:8302/udp"
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:53/udp"
docker docker-compose consul
docker docker-compose consul
asked Nov 14 '18 at 8:09
kitenseikitensei
1,34012355
1,34012355
add a comment |
add a comment |
0
active
oldest
votes
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%2f53295572%2fdocker-consul-cluster-without-swarm%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f53295572%2fdocker-consul-cluster-without-swarm%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