Git Product home page Git Product logo

Comments (4)

smebberson avatar smebberson commented on June 2, 2024 1

Yeah, I've had dig not work before. Usually host or getent or something similar will. You should find something that works and replace that script with that works in your containers on the VM. Then, everything should be fine.

Also, have you considered moving to Kubernetes? There is no need for Consul in Kubernetes.

from docker-alpine.

longtechmaster avatar longtechmaster commented on June 2, 2024

tks you! I run docker-compose first and run a script after that. The script show list ip of consul from the container outside ( base on docker-inspect) and export to text file. The text file is used to volumes from outside to /root/usr/bin/ inside container. I changed container-find file -> read the text file.

This my way. I cant show list ip from inside container with dig, getent, host, ... at my server (Debian Virtual Machine).

Can you help me another better way! Tks you!

from docker-alpine.

longtechmaster avatar longtechmaster commented on June 2, 2024

when i changed dig to getent ahosts ${1:-$CONSUL_SERVER_NAME} | awk '{print $1}' | awk 'NR % 2' at local

i receive list ip same dig

/ # getent ahosts ${1:-$CONSUL_SERVER_NAME} | awk '{print $1}' | awk 'NR % 2'
172.18.0.9
172.18.0.8
172.18.0.5
/ # dig +short ${1:-$CONSUL_SERVER_NAME}
172.18.0.8
172.18.0.9
172.18.0.5
/ #

BUT Consul NOT working

 2018/05/17 01:22:35 [INFO] raft: Election won. Tally: 1

    2018/05/17 01:22:35 [INFO] raft: Node at 172.18.0.9:8300 [Leader] entering Leader state

    2018/05/17 01:22:35 [INFO] consul: cluster leadership acquired

    2018/05/17 01:22:35 [INFO] consul: New leader elected: e0d5eecc154a

    2018/05/17 01:22:35 [INFO] consul: member '39a08603c401' joined, marking health alive

    2018/05/17 01:22:35 [INFO] consul: member 'e0d5eecc154a' joined, marking health alive

    2018/05/17 01:22:35 [ERR] consul: 'ba7e4254ead0' and 'f782fa5e353f' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

    2018/05/17 01:22:35 [INFO] consul: member 'ba7e4254ead0' joined, marking health alive

    2018/05/17 01:22:35 [ERR] consul: '97368f1f55c0' and 'e0d5eecc154a' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

    2018/05/17 01:22:35 [INFO] consul: member '97368f1f55c0' joined, marking health alive

    2018/05/17 01:22:35 [INFO] agent: Synced service 'consul'

    2018/05/17 01:22:35 [ERR] consul: 'f782fa5e353f' and 'e07b1d5ff119' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

    2018/05/17 01:22:35 [INFO] consul: member 'f782fa5e353f' joined, marking health alive

    2018/05/17 01:22:35 [ERR] consul: 'e07b1d5ff119' and 'f0cf753f5b09' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

    2018/05/17 01:22:35 [INFO] consul: member 'e07b1d5ff119' joined, marking health alive

    2018/05/17 01:22:35 [ERR] consul: 'f0cf753f5b09' and 'e0d5eecc154a' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

    2018/05/17 01:22:35 [INFO] consul: member 'f0cf753f5b09' joined, marking health alive

    2018/05/17 01:22:35 [INFO] consul: New leader elected: 97368f1f55c0

    2018/05/17 01:22:36 [INFO] consul: New leader elected: f0cf753f5b09

    2018/05/17 01:22:36 [INFO] consul: New leader elected: f782fa5e353f

    2018/05/17 01:22:36 [INFO] consul: New leader elected: e07b1d5ff119

    2018/05/17 01:23:35 [ERR] consul: 'f782fa5e353f' and '97368f1f55c0' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

    2018/05/17 01:23:35 [ERR] consul: 'e07b1d5ff119' and 'e0d5eecc154a' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

    2018/05/17 01:23:35 [ERR] consul: 'f0cf753f5b09' and 'e0d5eecc154a' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

    2018/05/17 01:23:35 [ERR] consul: 'ba7e4254ead0' and 'e0d5eecc154a' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

    2018/05/17 01:23:35 [ERR] consul: '97368f1f55c0' and 'e07b1d5ff119' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

from docker-alpine.

smebberson avatar smebberson commented on June 2, 2024

Are you familiar with how Consul works?

You could try setting CONSUL_BOOTSTRAP_DEBUG to true and then review the log file at /var/log/consul-bootstrap/consul-bootstrap.log. This documents decisions made by the custom Consul bootstrapping functionality within these containers.

Also, have a read of https://github.com/smebberson/docker-alpine#consul-and-service-discovery and review the example. See if you can get that to work.

from docker-alpine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.