我在Ubuntu 18.04上设置了Hashicorp-Vault(Vault v1.5.4)。我的后端是Consul(与Vault在同一服务器上运行的单个节点)-领事服务已启动。
我的保管库服务无法启动
systemctl list-units --type=service | grep "vault"
vault.service loaded failed failed vault service
journalctl -xe -u vault
Oct 03 00:21:33 ubuntu2 systemd[1]: vault.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
- Unit vault.service has finished shutting down.
Oct 03 00:21:33 ubuntu2 systemd[1]: vault.service: Start request repeated too quickly.
Oct 03 00:21:33 ubuntu2 systemd[1]: vault.service: Failed with result 'exit-code'.
Oct 03 00:21:33 ubuntu2 systemd[1]: Failed to start vault service.
-- Subject: Unit vault.service has failed
vault config.json
"api_addr": "http://<my-ip>:8200",
storage "consul" {
address = "127.0.0.1:8500"
path = "vault"
},
Service config
StandardOutput=/opt/vault/logs/output.log
StandardError=/opt/vault/logs/error.log
cat /opt/vault/logs/error.log
cat: /opt/vault/logs/error.log: No such file or directory
cat /opt/vault/logs/output.log
cat: /opt/vault/logs/output.log: No such file or directory
sudo tail -f /opt/vault/logs/error.log
tail: cannot open '/opt/vault/logs/error.log' for reading: No such file or
directory
:/opt/vault/logs$ ls -al
total 8
drwxrwxr-x 2 vault vault 4096 Oct 2 13:38 .
drwxrwxr-x 5 vault vault 4096 Oct 2 13:38 ..
答案 0 :(得分:0)
经过大量调试后,问题出在将.hcl和.json (它们是如此相似-但不同)混合在一起的愚蠢的愚蠢行为-在存储(如发布)需要填充的东西之间进行剪切粘贴采用json格式。 当错误消息什么也不说,日志中什么也没有时,问题当然更加复杂了。
"storage": {
"consul": {
"address": "127.0.0.1:8500",
"path" : "vault"
}
},
还有其他一些其他问题需要解决,例如disable_mlock : true
,打开8200防火墙:sudo ufw allow 8200/tcp
。
终于完成了(宁可开始了)。