mongodb - Can i use replica set name to connect via mongo-connector -
i know, there way can replicate 1 mongo replica set via mongo-connector? per mongo documentation can connect 2 mongo instances via mongo-connector using command in example below, pass replica set name or use configuration file instead of passing server:port name in command line.
mongo connector can replicate 1 mongodb replica set or sharded cluster using mongo docmanager. basic usage following:
mongo-connector -m localhost:27017 -t localhost:37017 -d mongo_doc_manager
i tried config.json option creating below config.json file has failed.
{ "__comment__": "configuration options starting '__' disabled", "__comment__": "to enable them, remove preceding '__'", "mainaddress": "localhost:27017", "oplogfile": "c:\dev\mongodb\mongo-connector\oplog.timestamp", "verbosity": 2, "continueonerror": false, "logging": { "type": "file", "filename": "c:\dev\mongodb\mongo-connector\mongo-connector.log", "__rotationwhen": "d", "__rotationinterval": 1, "__rotationbackups": 10, "__type": "syslog" }, "docmanagers": [ { "docmanager": "mongo_doc_manager", "targeturl": "localhost:37010", "__autocommitinterval": null } ] }
yes possible connect replica set or shard server using mongo connector.
{ mongo-connector -m <mongodb server hostname>:<replica set port> \ -t <replication endpoint url, e.g. http://localhost:8983/solr> \ -d <name of doc manager, e.g., solr_doc_manager> }
you can also pass connection string mongo-connector such as
{ mongo connector -m mongodb://db1.example.net,db2.example.net:2500/?replicaset=test&connecttimeoutms=300000 }
to specify specifc config files can use
{ mongo-connector -c config.json }
where config.json config file.
Comments
Post a Comment