1

我们有以下 mongodb 配置:(启用日志)在机器 1 上有以下服务器 mongod - 5 配置服务器 - 2 mongos - 1 在机器 2 上有以下服务器 mongod - 5 配置服务器 - 1

我们成功地从 mongos 运行了 dropDatabase 命令。即使在成功删除数据库之后,我们在 show dbs 命令(从 mongos 运行)的输出中也看到了删除的数据库。

我们观察到 show dbs 命令(从每个 mongod 运行)如下: 1. 仅 mongod1 和 mongod4 没有看到删除的数据库。

为什么即使在成功删除数据库之后,在 show dbs 命令的输出中也会看到删除的数据库?

请帮我解决这个问题。

在下面找到 00150812 数据库的日志:

蒙古人日志:

Line 17937: Mon Sep 23 22:47:28 [conn17154] DBConfig unserialize: 00150812 { _id: "00150812", partitioned: true, primary: "shard0000" }
Line 17937: Mon Sep 23 22:47:28 [conn17154] DBConfig unserialize: 00150812 { _id: "00150812", partitioned: true, primary: "shard0000" }
Line 17938: Mon Sep 23 22:47:28 [conn17154] created new distributed lock for 00150812.Database on 192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000 ( lock timeout : 900000, ping interval : 30000, process : 0 )
Line 17939: Mon Sep 23 22:47:28 [conn17154] ChunkManager: time to load chunks for 00150812.Database: 0ms sequenceNumber: 75 version: 28|1
Line 17940: Mon Sep 23 22:47:28 [conn17154] DROP DATABASE: 00150812
Line 17941: Mon Sep 23 22:47:28 [conn17154] DBConfig::dropDatabase: 00150812
Line 17942: Mon Sep 23 22:47:28 [conn17154] about to log metadata event: { _id: "CSS-FU-1-2013-09-23T19:47:28-331", server: "CSS-FU-1", clientAddr: "N/A", time: new Date(1379965648710), what: "dropDatabase.start", ns: "00150812", details: {} }
Line 17943: Mon Sep 23 22:47:28 [conn17154]      removed entry from config server for: 00150812
Line 17944: Mon Sep 23 22:47:28 [conn17154]      dropping sharded collection: 00150812.Database
Line 17945: Mon Sep 23 22:47:28 [conn17154] about to log metadata event: { _id: "CSS-FU-1-2013-09-23T19:47:28-332", server: "CSS-FU-1", clientAddr: "N/A", time: new Date(1379965648862), what: "dropCollection.start", ns: "00150812.Database", details: {} }
Line 17946: Mon Sep 23 22:47:28 [conn17154] about to acquire distributed lock '00150812.Database/CSS-FU-1:35000:1379577748:1804289383:
Line 17953: { "_id" : "00150812.Database",
Line 17956: Mon Sep 23 22:47:29 [conn17154] distributed lock '00150812.Database/CSS-FU-1:35000:1379577748:1804289383' acquired, ts : 52409ad0ed8f24e472bdd5d0
Line 17957: Mon Sep 23 22:47:29 [conn17154] ChunkManager::drop : 00150812.Database
Line 17958: Mon Sep 23 22:47:29 [conn17154] ChunkManager::drop : 00150812.Database   all locked
Line 17991: Mon Sep 23 22:50:50 [conn17154] ChunkManager::drop : 00150812.Database   removed shard data
Line 17992: Mon Sep 23 22:50:50 [conn17154] ChunkManager::drop : 00150812.Database   removed chunk data
Line 17993: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0000 192.168.11.20:10000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0000", shardHost: "192.168.11.20:10000" } 0x235cad0
Line 17993: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0000 192.168.11.20:10000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0000", shardHost: "192.168.11.20:10000" } 0x235cad0
Line 17994: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0001 192.168.11.20:15000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0001", shardHost: "192.168.11.20:15000" } 0x7fc388097290
Line 17994: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0001 192.168.11.20:15000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0001", shardHost: "192.168.11.20:15000" } 0x7fc388097290
Line 17995: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0002 192.168.11.20:20000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0002", shardHost: "192.168.11.20:20000" } 0x7fc388073c70
Line 17995: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0002 192.168.11.20:20000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0002", shardHost: "192.168.11.20:20000" } 0x7fc388073c70
Line 17996: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0003 192.168.11.20:25000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0003", shardHost: "192.168.11.20:25000" } 0x7fc3880709f0
Line 17996: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0003 192.168.11.20:25000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0003", shardHost: "192.168.11.20:25000" } 0x7fc3880709f0
Line 17997: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0004 192.168.11.20:30000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0004", shardHost: "192.168.11.20:30000" } 0x7fc3940313c0
Line 17997: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0004 192.168.11.20:30000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0004", shardHost: "192.168.11.20:30000" } 0x7fc3940313c0
Line 17998: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0005 192.168.11.21:40000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0005", shardHost: "192.168.11.21:40000" } 0x7fc388071760
Line 17998: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0005 192.168.11.21:40000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0005", shardHost: "192.168.11.21:40000" } 0x7fc388071760
Line 17999: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0006 192.168.11.21:45000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0006", shardHost: "192.168.11.21:45000" } 0x7fc3a40396c0
Line 17999: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0006 192.168.11.21:45000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0006", shardHost: "192.168.11.21:45000" } 0x7fc3a40396c0
Line 18000: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0007 192.168.11.21:50000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0007", shardHost: "192.168.11.21:50000" } 0x7fc39c0781a0
Line 18000: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0007 192.168.11.21:50000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0007", shardHost: "192.168.11.21:50000" } 0x7fc39c0781a0
Line 18001: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0008 192.168.11.21:55000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0008", shardHost: "192.168.11.21:55000" } 0x7fc3a81f0ff0
Line 18001: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0008 192.168.11.21:55000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0008", shardHost: "192.168.11.21:55000" } 0x7fc3a81f0ff0
Line 18002: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0009 192.168.11.21:60000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0009", shardHost: "192.168.11.21:60000" } 0x7fc3940300e0
Line 18002: Mon Sep 23 22:50:50 [conn17154]     setShardVersion  shard0009 192.168.11.21:60000  00150812.Database  { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0009", shardHost: "192.168.11.21:60000" } 0x7fc3940300e0
Line 18007: Mon Sep 23 22:50:50 [conn17154] ChunkManager::drop : 00150812.Database   DONE
Line 18008: Mon Sep 23 22:50:50 [conn17154] about to log metadata event: { _id: "CSS-FU-1-2013-09-23T19:50:50-333", server: "CSS-FU-1", clientAddr: "N/A", time: new Date(1379965850345), what: "dropCollection", ns: "00150812.Database", details: {} }
Line 18013: Mon Sep 23 22:50:50 [conn17154] distributed lock '00150812.Database/CSS-FU-1:35000:1379577748:1804289383' unlocked. 
Line 18015: Mon Sep 23 22:50:50 [conn17154]    DBConfig::dropDatabase: 00150812 dropped sharded collections: 1
Line 18016: Mon Sep 23 22:50:50 [conn17154]    DBConfig::dropDatabase: 00150812 dropped sharded collections: 0
Line 18051: Mon Sep 23 22:51:20 [conn17160] couldn't find database [00150812] in config db
Line 18053: Mon Sep 23 22:51:20 [conn17160]      put [00150812] on: shard0005:192.168.11.21:40000
Line 18054: Mon Sep 23 22:51:20 [conn17160] DROP DATABASE: 00150812
Line 18055: Mon Sep 23 22:51:20 [conn17160] DBConfig::dropDatabase: 00150812
Line 18056: Mon Sep 23 22:51:20 [conn17160] about to log metadata event: { _id: "CSS-FU-1-2013-09-23T19:51:20-334", server: "CSS-FU-1", clientAddr: "N/A", time: new Date(1379965880999), what: "dropDatabase.start", ns: "00150812", details: {} }
Line 18057: Mon Sep 23 22:51:21 [conn17160]      removed entry from config server for: 00150812
Line 18058: Mon Sep 23 22:51:21 [conn17160]    DBConfig::dropDatabase: 00150812 dropped sharded collections: 0
Line 18060: Mon Sep 23 22:51:36 [conn17160]      dropped primary db for: 00150812
Line 18061: Mon Sep 23 22:51:36 [conn17160] about to log metadata event: { _id: "CSS-FU-1-2013-09-23T19:51:36-335", server: "CSS-FU-1", clientAddr: "N/A", time: new Date(1379965896464), what: "dropDatabase", ns: "00150812", details: {} }
Line 18062: Mon Sep 23 22:51:36 [conn17160] couldn't find database [00150812] in config db
Line 18064: Mon Sep 23 22:51:36 [conn17160]      put [00150812] on: shard0005:192.168.11.21:40000

MONGOD1 日志:

Line 19629: Mon Sep 23 22:47:29 [conn2603] runQuery called 00150812.$cmd { drop: "Database" }
Line 19630: Mon Sep 23 22:47:29 [conn2603] run command 00150812.$cmd { drop: "Database" }
Line 19681: Mon Sep 23 22:50:43 [conn2603] dropCollection: 00150812.Database
Line 19682: Mon Sep 23 22:50:44 [conn2603] create collection 00150812.$freelist {}
Line 19684: Mon Sep 23 22:50:44 [conn2603] command 00150812.$cmd command: { drop: "Database" } ntoreturn:1 reslen:124 708ms
Line 19719: Mon Sep 23 22:50:50 [conn2603] runQuery called admin.$cmd { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0000", shardHost: "192.168.11.20:10000" }
Line 19720: Mon Sep 23 22:50:50 [conn2603] run command admin.$cmd { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0000", shardHost: "192.168.11.20:10000" }
Line 19721: Mon Sep 23 22:50:50 [conn2603] command: { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0000", shardHost: "192.168.11.20:10000" }
Line 19723: Mon Sep 23 22:50:50 [conn2603] command admin.$cmd command: { setShardVersion: "00150812.Database", configdb: "192.168.11.20:62000,192.168.11.20:65000,192.168.11.21:38000", version: Timestamp 0|0, serverID: ObjectId('523aaf94ed8f24e472bdd592'), authoritative: true, shard: "shard0000", shardHost: "192.168.11.20:10000" } ntoreturn:1 reslen:57 0ms
Line 19804: Mon Sep 23 22:50:50 [conn8756] runQuery called 00150812.$cmd { dropDatabase: 1 }
Line 19805: Mon Sep 23 22:50:50 [conn8756] run command 00150812.$cmd { dropDatabase: 1 }
Line 19806: Mon Sep 23 22:50:50 [conn8756] dropDatabase 00150812
Line 19807: Mon Sep 23 22:50:50 [conn8756] dropDatabase 00150812
Line 19837: Mon Sep 23 22:54:43 [conn8756] remove file /u01/shard1/00150812.ns
Line 19838: Mon Sep 23 22:54:43 [conn8756] command 00150812.$cmd command: { dropDatabase: 1 } ntoreturn:1 reslen:59 232912ms

请帮我解决这个问题。

T&R,JRV

4

0 回答 0