我在mongodb创建索引,有1000万条记录但是跟着错误
db.logcollection.ensureIndex({"Module":1})
{
"createdCollectionAutomatically" : false,
"numIndexesBefore" : 3,
"ok" : 0,
"errmsg" : "Btree::insert: key too large to index, failing play.logcollection.$Module_1 1100 { : \"RezGainUISystem.Net.WebException: The request was aborted: The request was canceled.\r\n at System.Net.ConnectStream.InternalWrite(Boolean async, Byte...\" }",
"code" : 17282
}
Run Code Online (Sandbox Code Playgroud)
请帮我看看如何在mongodb中创建索引,
我正在通过以下步骤在Windows环境中的本地系统上创建副本集
mkdir -p \srv\mongodb\rs0-0 \srv\mongodb\rs0-1 \srv\mongodb\rs0-2
mongod --port 27017 --dbpath \srv\mongodb\rs0-0 --replSet rs0 --smallfiles --oplogSize 128
mongod --port 27018 --dbpath \srv\mongodb\rs0-1 --replSet rs0 --smallfiles --oplogSize 128
mongod --port 27019 --dbpath \srv\mongodb\rs0-2 --replSet rs0 --smallfiles --oplogSize 128
Run Code Online (Sandbox Code Playgroud)
然后
mongo shell type mongo --port 27017
rs.initiate()
Run Code Online (Sandbox Code Playgroud)
但我得到了错误
"{ "ok" : 0, "errmsg" : "server is not running with --replSet" }"
Run Code Online (Sandbox Code Playgroud)
提前致谢