How i can used In-Memory Storage Engine in MongoDB Enterprise Kubernetes Operator

Hello everyone, i have a problem. I used MongoDB Enterprise Kubernetes Operator to deploy mongodb Sharded Cluster. So, can i used In Memory Storage Engine with MongoDB Enterprise Kubernetes Operator?
If can, how to used it, please give me a example or link to documentation to refer.
Thank you so much!

Hi @Nguy_n_Xuan_D_ng

In the spec file under additionalMongodConfig you can add storage.engine: inMemory or you can change this in Ops Manager.

kubectl edit mdb

spec:
  additionalMongodConfig:
    storage:
      engine: inMemory
2 Likes

Thank you so much! I will try this.

Hi @chris
When i update storage engine in ops manager, I got this error: “Field storage.engine in deployment args2_6 can only be modified by the mongodb-enterprise-operator, Version: 1.20.1”.

So i’am using kubectl edit mdb to change storage engine:

spec:
  additionalMongodConfig:
    storage:
      engine: inMemory

Unfortunately, i am facing this error:

Please tell me where I’m wrong.
Thank you so much!

I want to explain more detail about my problem. I deploy mongodb Sharded Cluster with MongoDB Enterprise Kubernetes Operator. I have 2 shard with 3 mongodsPerShardCount. I want in 3 mongodsPerShardCount have 1 memory (primary) and 2 wiredtiger (secondary) storage engine. So i deploy all in one storage engine (inmemory) and then change manually in ops manager. But I’am facing above issue.
Can you give me a solution to solve this problem.
Thank you so much!

One of the errors is due to the permissions. It seems you may have selected /data as the dbpath rather than a directory under it.

The second error could have a few causes and full output from the agent would be needed to diagnose more.

I would suggest you open a support ticket with MongoDB for them to assist you further.