I have this problem that I cannot solve. Partly because I cannot explain this with the right conditions. I'm new to this, so sorry for this awkward question.
Below you can see an overview of my goal.
I want to configure replication set in MongoDB so that I tried like this
use local db.dropDatabase() config = { _id: "rs0", members:[ {_id: 0, host: 'localhost:27017'}] } rs.initiate(config)
I hope everything is correct only, but the following error message is displayed here
{ "errmsg" : "server is not running with --replSet", "ok" : 0 }
Is there something wrong I did here?
Any ideas?
In fact, you can follow the MongoDB Handbook to set up a replica set. This is pretty clear. Below are some critical steps described below:
. master/slave, master/slave. , , master/slave, .
replSet = [set name]
mongod:
systemctl restart mongodb // or service mongod restart
. initiate, mongodb . , , , , . , , .
use local rs.initiate()
. . , , 1/2 :
rs.add("hostname:port")
, :
var conf = rs.conf(); // change your conf here rs.reconfig(conf);
, . , .
MongoDB.
MongoDB
? , node , . , - , , , . , , .
mongod mongo, , . , - . . , , . . , , , . , . , 3, 2, , . , - , - . . .
mongod
mongo
, , . 3 - , 3, , , . , . , , , .
Source: https://habr.com/ru/post/1537454/More articles:Canonical way to load checksum in Dockerfile? - dockerCan development be canceled to get the source code from the .ipa file? - iosCustom font is not displayed when clicking on the selection menu (drop-down menu) - cssумножая строку на целое число, возвращает целые числа? - stringHow to use dos2unix? - linuxTwo functions with the same name in Matlab - matlabDrag and rename Bootstrap tree component - twitter-bootstrapfile length calculation does not work - cDecimal point on the numeric keypad on iphone in Phonegap / Cordova - jquery-mobileEvents are not displayed in fullcalendar js - jqueryAll Articles