consul.service: main process exited, code=exited, status=1/FAILURE

1,768 views
Skip to first unread message

jb9...@g.rit.edu

unread,
Jun 26, 2018, 5:02:28 PM6/26/18
to Vault
Running on centos 7, 
Downloaded the package consul on /usr/local/bin/

The config file under /usr/local/etc/consul/client_agent.json is:
{ "server": true, "node_name": "consul_s1", "datacenter": "dc1", "data_dir": "/var/consul/data", "bind_addr": "0.0.0.0", "client_addr": "0.0.0.0", "advertise_addr": "10.142.0.3", "bootstrap_expect": 3, "retry_join": ["10.142.0.3", "10.142.0.4"], "ui": true, "log_level": "DEBUG", "enable_syslog": true, "acl_enforce_version_8": false}
{
  "server": true,
  "node_name": "consul_s1",
  "datacenter": "dc1",
  "data_dir": "/var/consul/data",
  "bind_addr": "0.0.0.0",
  "client_addr": "0.0.0.0",
  "advertise_addr": "10.142.0.3",
  "bootstrap_expect": 3,
  "retry_join": ["10.142.0.3", "10.142.0.4"],
  "ui": true,
  "log_level": "DEBUG",
  "enable_syslog": true,
  "acl_enforce_version_8": false
}



The /etc/systemd/system/consul.service config:

### BEGIN INIT INFO
# Provides:          consul
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Consul agent
# Description:       Consul service discovery framework
### END INIT INFO

[Unit]
Description=Consul server agent
Requires=network-online.target
After=network-online.target

[Service]
User=consul
Group=consul
PIDFile=/var/run/consul/consul.pid
PermissionsStartOnly=true
ExecStartPre=-/bin/mkdir -p /var/run/consul
ExecStartPre=/bin/chown -R consul:consul /var/run/consul
ExecStart=/usr/local/bin/consul agent \
    -config-file=/usr/local/etc/consul/server_agent.json \
    -pid-file=/var/run/consul/consul.pid
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
KillSignal=SIGTERM
Restart=on-failure
RestartSec=42s

[Install]

WantedBy=multi-user.target


After systemctl daemon-reload
and systemctl start consul.service, I am getting this error


 consul.service - Consul server agent   Loaded: loaded (/etc/systemd/system/consul.service; disabled; vendor preset: disabled)   Active: activating (auto-restart) (Result: exit-code) since Tue 2018-06-26 21:01:07 UTC; 23s ago  Process: 4500 ExecStart=/usr/local/bin/consul agent -config-file=/usr/local/etc/consul/server_agent.json -pid-file=/var/run/consul/consul.pid (code=exited, status=1/FAILURE)  Process: 4498 ExecStartPre=/bin/chown -R consul:consul /var/run/consul (code=exited, status=0/SUCCESS)  Process: 4497 ExecStartPre=/bin/mkdir -p /var/run/consul (code=exited, status=0/SUCCESS) Main PID: 4500 (code=exited, status=1/FAILURE)Jun 26 21:01:07 consul-serv-1 systemd[1]: consul.service: main process exited, code=exited, status=1/FAILUREJun 26 21:01:07 consul-serv-1 systemd[1]: Unit consul.service entered failed state.Jun 26 21:01:07 consul-serv-1 systemd[1]: consul.service failed.

I am just following the documentation to set up consul for vault but not working 

Sattrra

unread,
Nov 18, 2018, 10:28:11 PM11/18/18
to Vault
I'm getting the same error. Would be great if you can explain how you have fixed this 

Lowe Schmidt

unread,
Nov 19, 2018, 4:08:16 AM11/19/18
to vault...@googlegroups.com
Does /var/consul/data exists and does the consul user have permissions to write to it ? 
What does the consul logs say?
--
Lowe Schmidt | +46 723 867 157


--
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/vault/issues
IRC: #vault-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Vault" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vault-tool+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/4a51a1a3-bca8-43f4-aad0-66a307443b8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages