mongodbroot用户创建数据库提示notmaster的解决

2023年 8月 12日 31.1k 0

[yukw@mongodb4 data]$ ./mongo -port 20000MongoDB shell version v3.4.4connecting to: mongodb://127.0.0.1:20000/MongoDB server version: 3.4.4Server has startup warnings:2019-07-31T17:06:43.397+0800 I CONTROL  [initandlisten]2019-07-31T17:06:43.397+0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.2019-07-31T17:06:43.398+0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.2019-07-31T17:06:43.398+0800 I CONTROL  [initandlisten]2019-07-31T17:06:43.398+0800 I CONTROL  [initandlisten]2019-07-31T17:06:43.398+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.2019-07-31T17:06:43.398+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'2019-07-31T17:06:43.398+0800 I CONTROL  [initandlisten]2019-07-31T17:06:43.398+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.2019-07-31T17:06:43.398+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'2019-07-31T17:06:43.398+0800 I CONTROL  [initandlisten]

> show users2019-07-31T17:07:33.469+0800 E QUERY    [thread1] Error: not master and slaveOk=false :_getErrorWithCode@src/mongo/shell/utils.js:25:13DB.prototype.getUsers@src/mongo/shell/db.js:1537:1shellHelper.show@src/mongo/shell/utils.js:752:9shellHelper@src/mongo/shell/utils.js:659:15@(shellhelp2):1:1> show dbs2019-07-31T17:07:39.126+0800 E QUERY    [thread1] Error: listDatabases failed:{    "ok" : 0,    "errmsg" : "not master and slaveOk=false",                    ##报错提示    "code" : 13435,    "codeName" : "NotMasterNoSlaveOk"} :_getErrorWithCode@src/mongo/shell/utils.js:25:13Mongo.prototype.getDBs@src/mongo/shell/mongo.js:62:1shellHelper.show@src/mongo/shell/utils.js:769:19shellHelper@src/mongo/shell/utils.js:659:15@(shellhelp2):1:1> rs.slaveOk();                                   ##执行命令    > show dbslocal  0.000GB> show users> 

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论