Backing up MongoDB AWS EC2 to S3

Posted September 29, 2020 605 views
MongoDBDigitalOceanBackupsUbuntu 16.04Solutions

Hi Team,
Myself balaji,

I tried to backup the mongodb database to s3 bucket, everything went well and good and the backup file stored in the s3 bucket also(security: disabled). But when i tried to backup the database by enabling the security in the mongod.conf file, am getting an error as mentioned below:

MongoDB server version: 4.2.9
“ok” : 0,
“errmsg” : “command fsync requires authentication”,
“code” : 13,
“codeName” : “Unauthorized”
please let me know where i did the mistake tq.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi Balaji,

To be able to use the fsync command with security enabled, you need to the hostManager role which comes with the admin user

Run the fsync command while logged in as the admin user or another user with the admin role