- 生成的keyFile 方式:
openssl rand -base64 666 > /mongo/key
chmod 600 /mongo/key
- 使用docker-compose 启动的,配置文件如下:
3.报错如下:
mongo_1 | 2019-09-05T06:31:41.432+0000 W CONTROL [main] Option: sslMode is deprecated. Please use tlsMode instead.
mongo_1 | about to fork child process, waiting until server is ready for connections.
mongo_1 | forked process: 27
mongo_1 | 2019-09-05T06:31:41.435+0000 I CONTROL [main] ***** SERVER RESTARTED *****
mongo_1 | 2019-09-05T06:31:41.440+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
mongo_1 | 2019-09-05T06:31:41.443+0000 I ACCESS [main] error opening file: /mongo/key: bad file
mongo_1 | ERROR: child process failed, exited with error number 1
mongo_1 | To see additional information in this output, start without the "--fork" option.
执行一下,
重启.