Closed samgladstone closed 4 years ago
@samgladstone We are checking this and we will get back to you.
Hi @samgladstone
For this issue for creating a docker emulator for MongoDB 3.6 please open the Data Explorer in the emulator and submit this feedback there. The team that does this work tracks their work items from the feedback link in the Data Explorer there.
Thanks.
Please add the below to the documentation when using docker image. This wasn't obvious to me as all the port mappings seem to imply that all apis are by default enabled. Also, enabling MongoDB API is undocumented - even in https://hub.docker.com/r/microsoft/azure-cosmosdb-emulator/
When creating docker image, to enable support for other API endpoints, you need to include these parameters (not sure if you can enable multiple) a) For Gremlin: -e AZURE_COSMOS_EMULATOR_GREMLIN_ENDPOINT=true b) For Cassandra -e AZURE_COSMOS_EMULATOR_CASSANDRA_ENDPOINT=true c) For MongoDB -e AZURE_COSMOS_EMULATOR_MONGODB_ENDPOINT=true
In case anyone else comes across this issue and to add to the above, the MongoDB 3.6 Endpoint can be enabled with this param:
-e AZURE_COSMOS_EMULATOR_MONGODB_COMPUTE_ENDPOINT=true
A couple of extra things to note on it;
The person I spoke to when submitting my feedback said:
Previously when MongoDB 3.6 was enabled, it will use the 10250 as the default port; this can be particularly confusing since the connection strings points to port 10255. In the latest version of the emulator (2.9.2) we made this setting consistent and the default port is now 10255.
You can't enable both the 3.2 & 3.6 endpoints at the same time (I'm not sure about other endpoints)
When enabling the 3.6 protocol, you can't use the UI to carry out tasks such as creating containers etc, this needs to be done via commands.
Sadly it seems that using AZURE_COSMOS_EMULATOR_MONGODB_COMPUTE_ENDPOINT
no longer works to get the 3.6 endpoint. By now we have the 4.0 endpoint, so getting that to work would be great. Any ideas?
@ondrejpialek i am facing the same problem. The linux documentation does not publish port 10255. port 10255 is part of the mongoDB connection string
the emulator mongo db connection string is specified as mongodb://localhost:C2y6yDjf5...Jw==@localhost:10255/admin?ssl=true
docker run \
--publish 8081:8081 \
--publish 10251-10254:10251-10254 \ // <--- port 10255 is missing
--memory 3g --cpus=2.0 \
--name=test-linux-emulator \
I'm finding it really hard to understand how to use the emulator with the MongoDB API. The documentation is quite limited and I have not been able to make much progress.
MongoDB wire protocol version 3.2
Enabling the 3.2 MongoDB protocol is documented OK and I'm able to get this working. However, I need the 3.6 version for some extra features that are supported.
MongoDB wire protocol version 3.6
Following the documentation, I was able to start the emulator with:
However, port 10250 isn't being used (as per the documentation).
I found this comment (from 2017), which suggests that the MongoDB API is on port 10250. I tried using that without much luck.
I also tried using:
With this, I am able to connect but get the following error when trying to create new documents.
However, I don't get this problem when trying the exact same set of commands with an actual Cosmos DB, which works fine. I am unsure where to go from here.
Docker
The documentation on docker hub does not reference the MongoDB API at all. I figured out that you can enable the MongoDB Endpoint by setting the
-e AZURE_COSMOS_EMULATOR_MONGODB_ENDPOINT=true
. But I cannot figure out how to use protocol version 3.6.For now, I will develop locally using a mongo server and hope that everything works when it comes to production. However, I would prefer to keep my develop and production environments as similar as possible, so any help would be much appreciated.
Document details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.