A valid config file

Hi: I,m weak, aware of it. Would like positive suggestions and ideas.

The configuration file is:

storage:
dbPath: “/data/db”
systemLog:
destination: file
path: “/data/logs”
replication:
replSetName: “M103”
net:
bind_ip: “127.0.0.1,192.168.0.100”
security:
keyFile: “/data/keyfile”
processManagement:
fork: true

The proper Mongod configuration:
mongod --port 27000 --dbpath /data/db --auth --bind_ip 192.168.103.100,127.0.0.1

Mongo is the shell, another entrance to MongoDB instead of using Compass
mongo --port 27000 ( 127.0.0.1 applied in bind_ip is the localhost)

I create the first user:
rs,initiate()
use admin
db.createUser({
user: “m103-admin”,
pwd: “m103-pass”,
roles: [
{role: “root”, db: “admin”}
]
})

The following piece of code I copied to create the first user from which, I understand, the other 2 nodes will be created. Now, the set has 1 configured user and will be used to create the other 2 nodes : rs.add192.168.103.100,127.0.0.2, then rs.rs.add192.168.103.100,127.0.0.3

I would like to know where to write this. I would appreciate your suggestions.
Thank you to have fun with me
Paul

I would check the following:

https://docs.mongodb.com/manual/reference/configuration-file-settings-command-line-options-mapping/

and concentrate on the bind_ip. I don’t remember the need to have 127.0.0.2 nor 127.0.0.3 for other nodes. The IP stays the same for all instances of mongod. Only the port is changed.

1 Like

Thank you, Steeve.
I,m boosted to move forward.
Will look at https://docs
Very pleased of your suggestion.
Paul

One important distinction: the RS commands have nothing to do with user management. RS stands for ReplicaSet. That is also why this sentence of yours does not compute:

The following piece of code I copied to create the first user from which, I understand, the other 2 nodes will be created.

The rs.add() commands do in fact add the second and third nodes into the replica set. Like the other commands, these are entered into the Mongo shell.

The only command that involves user management is the db.createUser() command which you entered.

Good job so far! Did you already follow M001? That’s the intro course to Python. EDIT: DOH! I meant Mongo

Yes, I have done M001. It was fun and instructive.
I didn,t know it introduced Python. Good course!

Python? Nothing in this thread is Python…

Oh! I didn,t quite understand your comment.
It is I who misunderstood your allusion to Python, that I don,t know.

But keep writing. I did sell to the city of NY and to important corporations with an object-oriented front-end BI tool. My objective is to consult on MongoDB and a front-end tool, probably Power BI from Microsoft.

Thank you for your generous attention,
Cheers!!
Paul

DOH! I totally had a brain fart there! I meant MongoDB :frowning: