Closed dyumin closed 2 months ago
@dyumin Thank You for your request, but unfortunately, your edits do not work :( If you clear the MongoDB data and try to run it, you get the following error:
docker inspect --format "{{json .State.Health }}" 6692638ed797 | python3 -m json.tool
{
"Status": "starting",
"FailingStreak": 1,
"Log": [
{
"Start": "2024-05-05T19:02:51.31873601Z",
"End": "2024-05-05T19:02:51.760723218Z",
"ExitCode": 0,
"Output": ""
},
{
"Start": "2024-05-05T19:03:01.764394625Z",
"End": "2024-05-05T19:03:02.224474584Z",
"ExitCode": 0,
"Output": ""
},
{
"Start": "2024-05-05T19:03:45.099564715Z",
"End": "2024-05-05T19:03:45.607875048Z",
"ExitCode": 2,
"Output": "MongoServerError: no replset config has been received\n/bin/sh: 1: test: -eq: unexpected operator\n"
},
{
"Start": "2024-05-05T19:03:55.611954387Z",
"End": "2024-05-05T19:03:56.060191137Z",
"ExitCode": 2,
"Output": "MongoServerError: no replset config has been received\n/bin/sh: 1: test: -eq: unexpected operator\n"
},
{
"Start": "2024-05-05T19:04:06.066012919Z",
"End": "2024-05-05T19:04:06.530823919Z",
"ExitCode": 2,
"Output": "MongoServerError: no replset config has been received\n/bin/sh: 1: test: -eq: unexpected operator\n"
}
]
}
Apparently, the replica set is not initializing.
docker compose exec mongo-1 mongosh --port 27001 --eval 'rs.status()'
Current Mongosh Log ID: 6637d8dcc95d6018bad31619
Connecting to: mongodb://127.0.0.1:27001/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.0.1
Using MongoDB: 7.0.2
Using Mongosh: 2.0.1
For mongosh info see: https://docs.mongodb.com/mongodb-shell/
------
The server generated these startup warnings when booting
2024-05-05T19:03:36.009+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
2024-05-05T19:03:36.009+00:00: vm.max_map_count is too low
------
MongoServerError: no replset config has been received
Thanks for testing! I will try to fix it and come back with the results
On some systems (using mongo 6.0, but I guess 7.0 will have the same behaviour) current healthcheck command output looks like this:
which leads to broken healthcheck
Proposed changes:
grep -v asio.system
)rs.status().ok
first and only then try to runrs.initiate()
.ok
field fromrs.initiate()
output jsonDescription
What type of PR is this? (check all applicable)
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?