High demand on Azure Cosmos DB Emulator when adding a new collection

痴心易碎 提交于 2021-01-27 04:06:03

问题


When I'm trying to add a new collection to database I'm getting this error :

Failed to create collection 'Products'.

Error:
Sorry, we are currently experiencing high demand in this region, and cannot 
fulfill your request at this time. We work continuously to bring more and 
more capacity online, and encourage you to try again. Please do not hesitate 
to email docdbswat@microsoft.com at any time or for any reason.
ActivityId: bad1a40a-0000-0000-0000-000000000000, 
Microsoft.Azure.Documents.Common/1.22.0.0

It's a local emulator, what kind of high demmand in this region ?


回答1:


According to the official documentation.

By default, you can create up to 25 single partition collections, or 1 partitioned collection using the Azure Cosmos DB Emulator. By modifying the PartitionCount value, you can create up to 250 single partition collections or 10 partitioned collections, or any combination of the two that does not exceed 250 single partitions (where one partitioned collection = 25 single partition collection).

So basically, if you want to create more partitioned collections or more single-partition collections, just increase the PartitionCount when starting from the command-line:

CosmosDB.Emulator.exe /PartitionCount=100



回答2:


The CosmosDB emulator has some limitations and this is the generic message that it will throw if you exceed those limitations.

The reason you got that is because you tried to make more than 10 collections in a database, but there are other reasons you might get the same error as well.

You can read more about the differences between the Emulator and the service here.




回答3:


Someone else on my team could get this working without the need for CosmosDB.Emulator.exe /PartitionCount=100. We could see that the containers where not being created.

Microsoft explains how to resolve this issue: https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator#set-partitioncount

  1. Reset Data
  2. Exit CosmosDb
  3. Go to %LOCALAPPDATA%\CosmosDBEmulator and delete all content
  4. Restart your machine for good measure

You should now be able to retry and all should work.



来源:https://stackoverflow.com/questions/51614989/high-demand-on-azure-cosmos-db-emulator-when-adding-a-new-collection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!