infinispan / infinispan-helm-charts

Apache License 2.0
14 stars 29 forks source link

Cannot create more that one cache at startup #42

Open Alexis01 opened 2 years ago

Alexis01 commented 2 years ago

Hi,

I tried to create more than one cache at startup but i have recived the following error

Red Hat Data Grid Server failed to start org.infinispan.commons.configuration.io.ConfigurationReaderException: Missing required attribute(s): name[86,1]

My helm yml is the following

deploy:
  infinispan:
    cacheContainer:
      distributedCache:
          - name: "mycache"
            mode: "SYNC"
            owners: "2"
            segments: "256"
            capacityFactor: "1.0"
            statistics: "false"
            encoding:
              mediaType: "application/x-protostream"
            expiration:
              lifespan: "3000"
              maxIdle: "1001"
            memory:
              maxCount: "1000000"
              whenFull: "REMOVE"
            partitionHandling:
              whenSplit: "ALLOW_READ_WRITES"
              mergePolicy: "PREFERRED_NON_NULL"
          - name: "mycache1"
            mode: "SYNC"
            owners: "2"
            segments: "256"
            capacityFactor: "1.0"
            statistics: "false"
            encoding:
              mediaType: "application/x-protostream"
            expiration:
              lifespan: "3000"
              maxIdle: "1001"
            memory:
              maxCount: "1000000"
              whenFull: "REMOVE"
            partitionHandling:
              whenSplit: "ALLOW_READ_WRITES"
              mergePolicy: "PREFERRED_NON_NULL"

Is possible to create more than one chache?

Thank you for your help.

statkashaman commented 2 years ago

Hello, you need use this syntax, field name move to top of distributedCache.:


  cacheContainer:
    name: "default"
    statistics: "true"
    caches:
      mycacheone:
       distributedCache:
          mode: "ASYNC"
          statistics: "true"
          encoding:
            mediaType: "application/x-protostream"
          expiration:
            lifespan: "300000"
          memory:
            maxSize: "400MB"
            whenFull: "REMOVE"
      mycachetwo:
        distributedCache:
          mode: "SYNC"
          statistics: "true"
          encoding:
            mediaType: "application/x-protostream"
          expiration:
            lifespan: "300000"
          memory:
            maxSize: "400MB"
            whenFull: "REMOVE"```