I have a problem. I used MongoDB Enterprise Kubernetes Operator to deploy mongodb Sharded Cluster. I want have 2 shard with 3 mongodsPerShardCount. On each of 3 mongodsPerShardCount have 1 memory (primary) and 2 wiredtiger (secondary) storage engine. So How i can achieve that? If can, please give me a example or link to documentation to refer. Thank you so much!
I used MongoDB Enterprise Kubernetes Operator to deploy mongodb Sharded Cluster with specific type of storage engine (memory or wiredtiger) so that work this is my yaml file.
apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
name: my-sharded-cluster
spec:
version: "4.2.2-ent"
type: ShardedCluster
opsManager:
configMapRef:
name: my-project
credentials: organization-secret
backup:
mode: enabled
persistent: false
shardCount: 2
mongodsPerShardCount: 3
mongosCount: 1
configServerCount: 1
configSrv:
additionalMongodConfig:
storage:
engine: wiredTiger
shard:
additionalMongodConfig:
storage:
engine: wiredTiger
But I don’t know how to deploy mixing Sharder Cluster that combine two storage engine? Please give me a solution.
To deploy a MongoDB mixing storage sharded cluster with the MongoDB Enterprise Kubernetes Operator, you can use the following YAML file:
apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
name: my-sharded-cluster
spec:
version: “4.2.2-ent”
type: ShardedCluster
opsManager:
configMapRef:
name: my-project
credentials: organization-secret
backup:
mode: enabled
persistent: false
shardCount: 2
mongodsPerShardCount: 3
mongosCount: 1
configServerCount: 1
configSrv:
additionalMongodConfig:
storage:
engine: wiredTiger
shard:
additionalMongodConfig:
storage:
engine:
- wiredTiger
- memory
This YAML file will create a sharded cluster with two shards, each with three mongods. On each mongod, one of the storage engines will be wiredTiger and the other will be memory.
To deploy this cluster, you can use the following command:
kubectl apply -f my-sharded-cluster.yaml
Once the cluster is deployed, you can connect to it using the following command:
mongos --host my-mongos
This will connect you to the mongos instance, which will allow you to access the shards in the cluster.
For more information, you can refer to the following documentation:
1- MongoDB Enterprise Kubernetes Operator documentation: MongoDB Enterprise Kubernetes Operator — MongoDB Kubernetes Operator upcoming
2- MongoDB Sharding documentation: https://docs.mongodb.com/manual/sharding/
Hello, thank for suport me.
But when i try your solution, iam get this error.
Status: 400 (Bad Request), ErrorCode: INVALID_JSON_ATTRIBUTE, Detail: Received JSON for the processes.java.util.ArrayList[0].args2_6.storage.engine attribute does not match expected format."