我正在尝试通过 Docker Compose 将 SSL 添加到 RabbitMQ 部署:
# rabbitmq.conf
ssl_options.certfile = /container/path/to/certfile.crt
ssl_options.keyfile = /container/path/to/keyfile.key
# docker-compose.yml
rabbitmq:
image: rabbitmq:3.10.7-management
...
volumes:
- /host/path/to/certfile.crt:/container/path/to/certfile.crt
- /host/path/to/keyfile.crt:/container/path/to/keyfile.key
- ...
...
但是,当旋转容器时,我收到错误:
ssl_options.keyfile invalid, file does not exist or cannot be read by the node
我已仔细检查卷安装是否正常工作,并且
keyfile
确实存在。
原来是权限问题。在宿主机中运行解决:
chmod 664 /host/path/to/certfile.crt
chmod 664 /host/path/to/keyfile.crt
可能需要更改包含文件的目录的权限:
chmod 755 /host/path/to