千家信息网

mongodump 报错:errmsg: "Auth mechanism not specified

发表于:2025-02-04 作者:千家信息网编辑
千家信息网最后更新 2025年02月04日,mongodump 报错assertion: 2 { ok: 0.0, errmsg: "Auth mechanism not specified", code: 2, codeName: "BadV
千家信息网最后更新 2025年02月04日mongodump 报错:errmsg: "Auth mechanism not specified

mongodump 报错

assertion: 2 { ok: 0.0, errmsg: "Auth mechanism not specified", code: 2, codeName: "BadValue", operationTime: Timestamp 1573815888000|1, $clusterTime: { clusterTime: Timestamp 1573815888000|1,

原因

mongodump 版本较低导致的,需要卸默认yum源安装版本版本,重新安装新版本。

系统默认安装版本:2.x
需求版本(支持集群版本):4.x

解决办法:

创建文件
/etc/yum.repos.d/mongodb-org-4.0.repo[mongodb-org-4.0]name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
安装配置
yum install -y mongodb-org
0