azure-cosmos-db-emulator-docker icon indicating copy to clipboard operation
azure-cosmos-db-emulator-docker copied to clipboard

AZURE_COSMOS_EMULATOR_PARTITION_COUNT is ignored

Open hades200082 opened this issue 7 months ago • 1 comments

Describe the bug When starting the container, it seems to "sort of" ignore the AZURE_COSMOS_EMULATOR_PARTITION_COUNT environment variable and always tries to start 11 partitions.

I set AZURE_COSMOS_EMULATOR_PARTITION_COUNT=4 and this was the log output in docker:

image

My compose file:

version: "3.9"
volumes:
  cosmos-db-volume:

networks:
  customnet:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 192.168.55.0/24
          gateway: 192.168.55.1

services:
  cosmosdb:
    image: "mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest"
    restart: unless-stopped
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 3G
    environment:
      - AZURE_COSMOS_EMULATOR_PARTITION_COUNT=4
      - AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=true
      - AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE=127.0.1.1
    ports:
      - "8081:8081"
      - "8900:8900"
      - "8901:8901"
      - "8979:8979"
      - "10250-10256:10250-10256"
      - "10350:10350"
    networks:
      customnet:
        ipv4_address: 192.168.55.20
    volumes:
      - cosmos-db-volume:/tmp/cosmos/appdata

Expected behavior It should only start the number of partitions specified.

Desktop (please complete the following information):

  • OS: Windows 11

**Docker Images Used: **

  • Linux <--

**Arguments && Environment variables to start Docker:

Docker Environment

  • Docker compose   Additional context Add any other context about the problem here.

hades200082 avatar Jan 09 '24 20:01 hades200082

Hi @hades200082, Emulator is picking up number of partitions that were created for the initially (first time when partitions were created) in the volume. We are looking into this. For now, you could try creating a new volume if you want to change the partition count or remove the volume if you don't want data persistence.

amanrao23 avatar Jan 11 '24 06:01 amanrao23