When I try to start the server getting the ==> data_dir cannot be empty
Consul v1.3.1
Steps to reproduce this issue, eg:
{
"bind_addr": "10.26.8.9",
"datacenter": "dc1",
"data_dir": "/var/consul",
"log_level": "INFO",
"encrypt": "37NMU0F6/lNLFg7Le61blg==",//Generated key. Should be same on all servers and client
"enable_syslog": true,
"enable_debug": true,
"node_name": "Server1", //Server1, Server2, Server3
"server": true,
"bootstrap_expect": 3,
"leave_on_terminate": false,
"skip_leave_on_interrupt": true,
"rejoin_after_leave": true,
"retry_join": [
"10.26.8.9 :8301",
"10.26.8.4 :8301",
"10.26.8.124:8301",
]
}
OS: CentOS Linux release 7.5.1804
Helle @satheeshCharles, thanks for reporting your issue!
I tried to reproduce your issue with consul v1.3.1, but your json config is invalid json. When I make it valid, remove the bind_addr because I don't have the same IP and change the data_dir to a directory my user has access to, consul starts.
{
"datacenter": "dc1",
"data_dir": "data-dir",
"log_level": "INFO",
"enable_syslog": true,
"enable_debug": true,
"server": true,
"bootstrap_expect": 3,
"leave_on_terminate": false,
"skip_leave_on_interrupt": true,
"rejoin_after_leave": true,
"retry_join": [
"10.26.8.9 :8301",
"10.26.8.4 :8301",
"10.26.8.124:8301"
]
}
Are you sure you are actually loading your configuration?
Given we haven't heard anything based on our suggestions/questions above I'm going to close this issue, but I encourage you to comment and we can re-open it if you want to pick this up again.
Alternatively, if things have changed dramatically, feel free to create a new issue or PR.
I was able to workaround this issue by passing
--data-dir /path/to/datadir
in my upstart script/startup options. I presume consul is not parsing the option out of the config file correctly.
consul agent -data-dir /var/consul -config-dir /etc/consul.d/client
Most helpful comment
I was able to workaround this issue by passing
--data-dir /path/to/datadirin my upstart script/startup options. I presume consul is not parsing the option out of the config file correctly.
consul agent -data-dir /var/consul -config-dir /etc/consul.d/client