How to Create Master & Slave Setup on Mongodb by Two Different Servers?

Hi Team,

We have set up two Rocky LinuxServers for Our Application through MongoDB

By the Way of Master & Slave Setup

I Need the Process for Sync the DB Files between two Servers
Then I Need a Primary & Secondary Process too.

Please Support & Answer as Soon as Possible

The terms master and slave are not appropriate anymore.

You need to setup a replica set with 3 servers. Look at the following for well written information

1 Like

After the Replication Setup, I have Facing a DB Destroy Issue
Please Check the Screenshot and Support Immediately


It is a bit frustrating that you wait for 2 months before any follow up on a reply to your OP to ask for

It looks you have been hacked by lack of security on your installation. You will probably get more help by reading READ__ME_TO_RECOVER_YOUR_DATA.

If you had important data and no recent backup, no one knows except the creator of the READ__ME_TO_RECOVER_YOUR_DATA. This is irresponsible to have important data and no recent backup. The solution is to secure your installation and define a backup strategy.

If you had important data and a recent backup, the obvious solution is to secure your installation and restore from your backup.

If you did not have important data, no harm has been done. But secure your installation and define a backup strategy.

The important things to remember are:

1- secure your installation
2- define a backup strategy

Hi Steeve
While Secure My Installation I am Using Security as a Key File Authentication Process
While Setup I am Facing Some Error Below I Will Include the Error Log for Your Reference

{“t”:{“$date”:“2024-05-20T22:14:49.812-05:00”},“s”:“I”, “c”:“NETWORK”, “id”:4915701, “ctx”:“main”,“msg”:“Initialized wire specification”,“attr”:{“spec”:{“incomingExternalClient”:{“minWireVersion”:0,“maxWireVersion”:21},“incomingInternalClient”:{“minWireVersion”:0,“maxWireVersion”:21},“outgoing”:{“minWireVersion”:6,“maxWireVersion”:21},“isInternalClient”:true}}}
{“t”:{“$date”:“2024-05-20T22:14:49.816-05:00”},“s”:“I”, “c”:“CONTROL”, “id”:23285, “ctx”:“main”,“msg”:“Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols ‘none’”}
{“t”:{“$date”:“2024-05-20T22:14:49.817-05:00”},“s”:“I”, “c”:“NETWORK”, “id”:4648601, “ctx”:“main”,“msg”:“Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize.”}
{“t”:{“$date”:“2024-05-20T22:14:49.837-05:00”},“s”:“I”, “c”:“ACCESS”, “id”:20254, “ctx”:“main”,“msg”:“Read security file failed”,“attr”:{“error”:{“code”:30,“codeName”:“InvalidPath”,“errmsg”:“Error reading file /home/saravanan/mongo-security/keyfile.txt: Permission denied”}}}
{“t”:{“$date”:“2024-05-20T22:14:49.838-05:00”},“s”:“I”, “c”:“ASIO”, “id”:6529201, “ctx”:“main”,“msg”:“Network interface redundant shutdown”,“attr”:{“state”:“Stopped”}}
{“t”:{“$date”:“2024-05-20T22:14:49.838-05:00”},“s”:“I”, “c”:“ASIO”, “id”:22582, “ctx”:“main”,“msg”:“Killing all outstanding egress activity.”}
{“t”:{“$date”:“2024-05-20T22:14:49.838-05:00”},“s”:“I”, “c”:“SHARDING”, “id”:5847201, “ctx”:“main”,“msg”:“Balancer command scheduler stop requested”}
{“t”:{“$date”:“2024-05-20T22:14:49.838-05:00”},“s”:“I”, “c”:“ASIO”, “id”:6529201, “ctx”:“main”,“msg”:“Network interface redundant shutdown”,“attr”:{“state”:“Stopped”}}
{“t”:{“$date”:“2024-05-20T22:14:49.838-05:00”},“s”:“I”, “c”:“ASIO”, “id”:22582, “ctx”:“main”,“msg”:“Killing all outstanding egress activity.”}
{“t”:{“$date”:“2024-05-20T22:14:49.838-05:00”},“s”:“F”, “c”:“CONTROL”, “id”:20575, “ctx”:“main”,“msg”:“Error creating service context”,“attr”:{“error”:“Location5579201: Unable to acquire security key[s]”}}

But I have Given Folder Permission and File Permission too

The error message

does not lie and what ever you did when your did

is not appropriate. More details about the ownership and permissions you gave to the file are needed. The command you use to start mongodb is also important to share.

@Saravanaprasad_k, after

and then you leave the last reply without followup for a week. Do not wonder why if you feel ghosted next time.

I am working with the security key authentication installation method, but I am still facing the same error

Please read what we write. Because we wrote, a week ago,

And you have not supplied any other information.