Technical support on replication

HI, I have created 2 oracle VM machines and want to exercise replication mechanism before we do it at the production level. I have completed up to a certain level of configuration as per this, (https://hevodata.com/learn/mongodb-replica-set-config/) and would like to have some technical assistance remotely. Are there any one who can support to complete this successfully?

Hi,

You should have at least 3 VM’s for the production use case. - Replica sets should always have an odd number of members. This ensures that elections will proceed smoothly. There is a good MongoDB tutorial that describes how to create a three-member replica set with access control.
You can also think about x.509 Certificates

3 Likes

if you haven’t done so, you may also consider taking this course:

2 Likes

hi,
When I do this,
uncomment replication line 36, and set the replication name to,
replication:
replSetName: myreplica01
therafter, mongod service is unable to start.
i am referring to this,

it is possible you have removed too many spaces there. mongodb config files are YAML in essence and indentation matters. please check this first.

if that does not solve, try sudo systemctl status mongod to see if error is written there and check /var/log/mongodb/mongod.log (or the file set systemLog.path in config file) to see you can see the error.

its perfectly working in one node. then I copied the same to other replicate 2 nodes. (bindIP is set to 0.0.0.0).
when i comment replcation mongod service is working. when uncomment its not working??
replication:
replSetName: myreplica01

that does not seem an issue from database server, but rather you missed some settings while creating other servers.

from that link you gave, please make sure you followed every step from 1 through 4. as your edit on /etc/mongo.conf file requires an edit only on 2 lines, you could do that without copying. when all servers are identical, they should all work fine without a problem.

also make sure that lines has correct indentation (2 spaces it seems):

replication:
  replSetName: myreplica01

and instead of using 0.0.0.0, just comment out that line with a hash sign # bindIP: 127.0.0.1

This is insufficient for us to help you.

You have to share the error message you when starting the service and you also need to share the errors you get in the logs.

hi,
Any particular reason for mongod service is running but when type mongo, generate an error as below,

anytime you forgot to “run a server” to “listen at a port” on a specific IP, then the connection will be refused by that IP’s system, or you have the wrong connection string.

i am working on oracle linux v8.5, not on windows.
mongod service is running but cant get in to mongo shell?

look, you are not helping us to help you. you are not giving us any configuration details nor any error logs we pointed out.

any operating system will refuse you if you try to connect to a port that is not open for listening. and you are trying to connect to such a port. not to mention the IP you are trying to connect might be wrong.

why it happens? clearly, you are doing it wrong in one of the steps. is your mongod really running on all servers? are you using the correct port numbers to connect? did you set all firewall rules so OS allows you to connect? are you using the correct IP of your servers to connect? are those IP addresses set to allow remote connections by the router they are on.

so far, you haven’t tell any of these details. All I have is a link to a blog post you say you followed, and its content seems to work when followed correctly.

more on that, “connection refused” is not somehing related to “mongod” processes.

Now please, take a breathe first and kindly check all the steps you are supposed to do, make sure all are good, then show us error logs other than “connection refused” error.

1 Like

mongod.log (499.3 KB)
hi , thanks for supporting. herewith I have attached the mongod.log file

I am having a CloudFront 403 error on the file. It might be a temporary thing or something else. can you check if it uploaded correctly?

yes. theres an CloudFront error. Any other way that i can share this with you?

google drive is a good idea, but you need to change that document’s sharing options to public read so other forum users can see and try helping.
I send an access request, so please check your e-mail and/or drive for a notification.

access is granted for the doc

before moving on, I have created a cluster of “vagrant” servers, with an oracle 8 image. Followed all steps in the blog, and other than “sudo” issues and few typos I had, all the steps are working perfectly fine.

Now, you seem to have changed many things from that blog post.

mongodb buildInfo.version:4.4.15
system  os.name:Oracle Linux Server release 8.5
config  net.bindIp:192.168.56.106

the first two should not affect, but changing IP may need many other changes outside the database server.

  • you need to edit /etc/hosts files to reflect IP:name pairs.
  • you may need to edit firewall rules.

servers do not seem to crash from the log. I cannot see (or failed to see) any clear reason other than the above two for not being able to connect to the server.

and again, because I had no problem at the end with the steps of that blog post, I suggest you to backtrack your steps carefuly. If your servers are VMs in some cloud provider (and since you had problems starting them ever I assume you have no product data) you can delete them and start fresh. sometimes starting over is better than trying to fix it.

PS: In case you know how to work with Vagrant, here is my settings to start 3 VMs.
Vagrantfile.txt (1.8 KB)

1 Like

"thank you doing it for me. I am redoing whole thing again. Can you share the mongod.conf file if you dont mind?
So that I can follow the correct syntax

HI Durmaz,’
I did everything again and moment i enter,
replication:
replSetName: myreplica01
save and restart the mongod service, it does not start?? :frowning: