[英]Can't set mongo as replica set
Hi I am trying to use mongo-connector for transport data from mongo db to elasticsearch. 嗨,我正在尝试使用mongo-connector将数据从mongo db传输到elasticsearch。 For that I need to set mongodb as replica set.
为此,我需要将mongodb设置为副本集。 So I run the mongodb first by executing
mongod
command and run mongod --replSet "rs0
command after that. But it showed me an error as below. 因此,我首先通过执行
mongod
命令来运行mongodb,然后再运行mongod --replSet "rs0
命令。”但是它向我显示了以下错误。
2017-10-03T21:16:46.571-0700 I CONTROL [initandlisten] MongoDB starting : pid=12180 port=27017 dbpath=C:\data\db\ 64-bit host=ME
2017-10-03T21:16:46.572-0700 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-10-03T21:16:46.572-0700 I CONTROL [initandlisten] db version v3.4.6
2017-10-03T21:16:46.572-0700 I CONTROL [initandlisten] git version: c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5
2017-10-03T21:16:46.573-0700 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2017-10-03T21:16:46.573-0700 I CONTROL [initandlisten] allocator: tcmalloc
2017-10-03T21:16:46.573-0700 I CONTROL [initandlisten] modules: none
2017-10-03T21:16:46.573-0700 I CONTROL [initandlisten] build environment:
2017-10-03T21:16:46.573-0700 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-10-03T21:16:46.574-0700 I CONTROL [initandlisten] distarch: x86_64
2017-10-03T21:16:46.574-0700 I CONTROL [initandlisten] target_arch: x86_64
2017-10-03T21:16:46.574-0700 I CONTROL [initandlisten] options: { replication: { replSet: "rs0" } }
2017-10-03T21:16:46.575-0700 I STORAGE [initandlisten] exception in initAndListen: 98 Unable to create/open lock file: C:\data\db\mongod.lock The process cannot access the file because it is being used by another process.. Is a mongod instance already running?, terminating
2017-10-03T21:16:46.575-0700 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-10-03T21:16:46.575-0700 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-10-03T21:16:46.575-0700 I CONTROL [initandlisten] now exiting
2017-10-03T21:16:46.576-0700 I CONTROL [initandlisten] shutting down with code:100
只需直接运行命令mongod --replSet "rs0"
,不要先使用mongod再使用replSet命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.