mongodb-sharded 副本集部署

js 复制代码
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

操作

js 复制代码
mongosh mongodb://root:123000@sport-mongodb-sharded:27017/admin

# 创建数据库 
use sport_sit; 


# 创建sport数据库下的用户

db.createUser(
   {
     user: "sport00",
     pwd: "12300",
     roles: [ "readWrite" ]
   }
);
js 复制代码
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');
相关推荐
一点晖光6 小时前
MongoDB数据迁移方案整理
数据库·mongodb·数据迁移
lhrimperial9 小时前
MongoDB核心技术深度解析题
数据库·mongodb
bing.shao1 天前
FerretDB 替换MongoDB符合信创要求
数据库·mongodb
bing.shao1 天前
FerretDB 完美对接 MongoDB
数据库·mongodb
坚定信念,勇往无前4 天前
docker安装mongodb
mongodb·docker·容器
云和数据.ChenGuang6 天前
openEuler系统下安装MongoDB的技术教程
运维·数据库·mongodb·压力测试·运维工程师·运维技术
ChristXlx6 天前
Linux安装MongoDB(虚拟机适用)
linux·mongodb·postgresql
2301_796512526 天前
React Native鸿蒙跨平台开发如何使用MongoDB或Firebase作为后端数据库来存储车辆信息、保养记录和预约信息
数据库·mongodb·react native
数据与人7 天前
mongodb报错Sort exceeded memory limit of 104857600 bytes
数据库·mongodb
赵渝强老师7 天前
【赵渝强老师】MongoDB的数据类型
数据库·mongodb·nosql