mongodb-sharded 副本集部署

root@test-192:~# helm search repo mongodb        
NAME                   	CHART VERSION	APP VERSION	DESCRIPTION                                       
bitnami/mongodb        	14.0.12      	7.0.2      	MongoDB(R) is a relational open source NoSQL da...
bitnami/mongodb-sharded	7.0.5        	7.0.2      	MongoDB(R) is an open source NoSQL database tha...

#修改后存储和副本直接运行
helm install mongodb bitnami/mongodb-sharded --values values.yaml
#将分片的数量设置为 5

mongodb-sharded 副本集部署_第1张图片

操作

mongosh mongodb://root:123000@sport-mongodb-sharded:27017/admin

# 创建数据库 
use sport_sit; 


# 创建sport数据库下的用户

db.createUser(
   {
     user: "sport00",
     pwd: "12300",
     roles: [ "readWrite" ]
   }
);

mongosh mongodb://sport-mongodb-sharded:27017/admin
 mongosh 工具,则可以使用以下命令来验证用户身份:
 use admin

db.auth("myuser", "mypassword")
db.createUser({user:"sport01",pwd:"123000",roles:["readWrite"]})
db.createCollection('sport');

你可能感兴趣的:(22,33,mongodb)