No access to Consul UI with "agent -server -bootstrap-expect=1 -ui" parameters

767 views
Skip to first unread message

Stéphane Klein

unread,
Nov 30, 2016, 3:19:21 AM11/30/16
to Consul
This is my docker compose

# docker-compose.yml
version
: '2'
services
:
  consul
:
    image
: consul:0.7.1
    command
: agent -server -bootstrap-expect=1 -ui
    volumes
:
     
- ./consul-data/:/consul/data
       
    ports
:
     
- "8400:8400"
     
- "8500:8500"
     
- "8600:53/udp"
    expose
:
     
- "8300"
     
- "8301"
     
- "8301/udp"
     
- "8302"
     
- "8302/udp"  
     
- "8500"


  whoami1
:
    image
: emilevauge/whoami
    ports
:
     
- 80


Next:

$ docker-compose up
Recreating testconsul_consul_1
Starting testconsul_whoami1_1
Attaching to testconsul_whoami1_1, testconsul_consul_1
whoami1_1  
| Starting up on port 80
consul_1  
| ==> WARNING: BootstrapExpect Mode is specified as 1; this is the same as Bootstrap mode.
consul_1  
| ==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
consul_1  
| ==> Starting Consul agent...
consul_1  
| ==> Starting Consul agent RPC...
consul_1  
| ==> Consul agent running!
consul_1  
|            Version: 'v0.7.1'
consul_1  
|          Node name: '34f293021531'
consul_1  
|         Datacenter: 'dc1'
consul_1  
|             Server: true (bootstrap: true)
consul_1  
|        Client Addr: 127.0.0.1 (HTTP: 8500, HTTPS: -1, DNS: 8600, RPC: 8400)
consul_1  
|       Cluster Addr: 172.19.0.3 (LAN: 8301, WAN: 8302)
consul_1  
|     Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false
consul_1  
|              Atlas: <disabled>
consul_1  
|
consul_1  
| ==> Log data will now stream in as it occurs:
consul_1  
|
consul_1  
|     2016/11/30 05:56:34 [INFO] raft: Initial configuration (index=1): [{Suffrage:Voter ID:172.19.0.3:8300 Address:172.19.0.3:8300}]
consul_1  
|     2016/11/30 05:56:34 [INFO] raft: Node at 172.19.0.3:8300 [Follower] entering Follower state (Leader: "")
consul_1  
|     2016/11/30 05:56:34 [INFO] serf: EventMemberJoin: 34f293021531 172.19.0.3
consul_1  
|     2016/11/30 05:56:34 [INFO] consul: Adding LAN server 34f293021531 (Addr: tcp/172.19.0.3:8300) (DC: dc1)
consul_1  
|     2016/11/30 05:56:34 [INFO] serf: EventMemberJoin: 34f293021531.dc1 172.19.0.3
consul_1  
|     2016/11/30 05:56:34 [INFO] consul: Adding WAN server 34f293021531.dc1 (Addr: tcp/172.19.0.3:8300) (DC: dc1)
consul_1  
|     2016/11/30 07:50:34 [ERR] agent: failed to sync remote state: No cluster leader
consul_1  
|     2016/11/30 07:50:39 [WARN] raft: Heartbeat timeout from "" reached, starting election
consul_1  
|     2016/11/30 07:50:39 [INFO] raft: Node at 172.19.0.3:8300 [Candidate] entering Candidate state in term 2
consul_1  
|     2016/11/30 07:50:39 [INFO] raft: Election won. Tally: 1
consul_1  
|     2016/11/30 07:50:39 [INFO] raft: Node at 172.19.0.3:8300 [Leader] entering Leader state
consul_1  
|     2016/11/30 07:50:39 [INFO] consul: cluster leadership acquired
consul_1  
|     2016/11/30 07:50:39 [INFO] consul: New leader elected: 34f293021531
consul_1  
|     2016/11/30 07:50:39 [INFO] consul: member '34f293021531' joined, marking health alive
consul_1  
|     2016/11/30 07:50:41 [INFO] agent: Synced service 'consul'


I have no access to ui:

$ curl http://127.0.0.1:8500/ui/
curl
: (52) Empty reply from server



When I use this docker-compose.yml, without command:

# docker-compose.yml
version
: '2'
services
:
  consul
:
    image
: consul:0.7.1
    volumes
:
     
- ./consul-data/:/consul/data
    ports
:
     
- "8400:8400"
     
- "8500:8500"
     
- "8600:53/udp"
    expose
:
     
- "8300"
     
- "8301"
     
- "8301/udp"
     
- "8302"
     
- "8302/udp"  
     
- "8500"

  whoami1
:
    image
: emilevauge/whoami
    ports
:
     
- 80

Here, I have access to Consul UI:

$ curl http://127.0.0.1:8500/ui/ -I
HTTP
/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 29230
Content-Type: text/html; charset=utf-8
Last-Modified: Wed, 30 Nov 2016 08:12:44 GMT
Date: Wed, 30 Nov 2016 08:14:37 GMT


Where is my mistake in the first docker compose? What argument to use to get UI?

Best regards,
Stéphane

Stéphane Klein

unread,
Dec 7, 2016, 4:08:39 AM12/7/16
to Consul
Up :)

kyle havlovitz

unread,
Dec 7, 2016, 3:53:49 PM12/7/16
to consu...@googlegroups.com
You want to add "-client 0.0.0.0" to the command line args - http defaults to listening on 127.0.0.1. By omitting the command you're getting the default arguments for the image, which include that option: https://github.com/hashicorp/docker-consul/blob/master/0.X/Dockerfile#L71.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/dbcd68a6-5d9c-4e8b-9d3c-52c791e80967%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Stéphane Klein

unread,
Dec 12, 2016, 4:17:26 PM12/12/16
to Consul


Le mercredi 7 décembre 2016 21:53:49 UTC+1, Kyle Havlovitz a écrit :
You want to add "-client 0.0.0.0" to the command line args - http defaults to listening on 127.0.0.1. By omitting the command you're getting the default arguments for the image, which include that option: https://github.com/hashicorp/docker-consul/blob/master/0.X/Dockerfile#L71.


Yes it's that! Thanks



version
: '2'
services
:
  consul
:
    image
: consul:0.7.1

    command
: agent -server -bootstrap-expect=1 -ui -client 0.0.0.0
Reply all
Reply to author
Forward
0 new messages