1
votes

Running single node Consul (v1.8.4) on Ubuntu 18.04. consul service is up, I had set the ui to be true (default). But when I try access http://192.168.37.128:8500/ui This site can’t be reached 192.168.37.128 took too long to respond.

ui.json

{
"addresses": {
"http": "0.0.0.0"
  }
}

consul.service file:

[Unit] Description=Consul Documentation=https://www.consul.io/ [Service] ExecStart=/usr/bin/consul agent –server –ui –data-dir=/temp/consul –bootstrap-expect=1 –node=vault –bind=–config-dir=/etc/consul.d/ ExecReload=/bin/kill –HUP $MAINPID LimitNOFILE=65536 [Install] WantedBy=multi-user.target

systemctl status consul

    ● consul.service - Consul
       Loaded: loaded (/etc/systemd/system/consul.service; disabled; vendor preset: enabled)
       Active: active (running) since Sun 2020-10-04 19:19:08 CDT; 50min ago
         Docs: https://www.consul.io/
     Main PID: 9477 (consul)
        Tasks: 9 (limit: 4980)
       CGroup: /system.slice/consul.service
               └─9477 /opt/consul/bin/consul agent -server -ui -data-dir=/temp/consul -bootstrap-expect=1 -node=vault -bind=1
    
agent.server.raft: heartbeat timeout reached, starting election: last-leader=
agent.server.raft: entering candidate state: node="Node at 192.168.37.128:8300 [Candid
agent.server.raft: election won: tally=1                
agent.server.raft: entering leader state: leader="Node at 192.168.37.128:8300 [Leader]
agent.server: cluster leadership acquired               
agent.server: New leader elected: payload=vault         
agent.leader: started routine: routine="federation state anti-entropy"  
agent.leader: started routine: routine="federation state pruning"   
agent.leader: started routine: routine="CA root pruning"        
agent: Synced node info     

            

Shows bind at 192.168.37.128:8300

1
Can you share the output from Consul after you start the service? It should contain info on what addresses it bound to during startup. Also, would you mind sharing more of your Consul configuration so that we can help validate Consul is correctly configured? Thanks. - Blake Covarrubias
Posted in main. When I start with sudo systemctl start consul I don't get any output. (?). Posted when I do systemctl status consul. I had Not configured config.json - based on the setup instruction I used. Shows bid at 8300 - I dont see any config for this(?). So I tried ui on 8300 - but does not work. - Sam-T
Port 8300 is used for RPC communication between the servers. There's other output that should be omitted when Consul starts that is not captured in those logs. Can you just try starting Consul directly from the CLI using the ExecStart command instead of starting it through systemd? - Blake Covarrubias
ran from CLI ExecStart=/opt/consul/bin/consul agent -server -ui -data-dir=/temp/consul -bootstrap-expect=1 -node=vault -bind=192.168.37.128 -config-dir=/etc/consul.d Command 'agent' not found, but can be installed with: sudo snap install agent But I can start with consul agent -dev - Sam-T
The command you should run is /opt/consul/bin/consul agent -server -ui -data-dir=/temp/consul -bootstrap-expect=1 -node=vault -bind=192.168.37.128 -config-dir=/etc/consul.d, without the ExecStart= prefix. Does that start Consul, and provide you with additional log output? - Blake Covarrubias

1 Answers

0
votes

This issue was firewall, had to open firewall on 8500 sudo ufw allow 8500/tcp