"path" : "C:\\mongodb\\logs\\mongodb.log"Ĭongratulation! You have learned how to start the MongoDB server using configuration file on Windows. ![]() The output will look something like: C:\Users\chankok>mongo -port 27018 Execute the following command in MongoDB shell: > use admin This is an optional step for you to check what configuration options have been used to start the MongoDB server. Open another Command Prompt window and execute the following command: mongo -port 27018 4. Connect MongoDBĬonnect to MongoDB via MongoDB shell. Start the MongoDB server using configuration file with the -config option or -f option. And after a successful server start, we will be able to perform database operations through the mongo shell. Note: MongoDB configuration file is written in YAML format, you have to use SPACE characters instead of TAB characters for indentation in configuration file because YAML doen’t support TAB characters. Normally, MongoDBs default directory for the database is /data/db. For Windows it will look like this: The command line will show us some service information, for example, that the server is running on localhost on port 27017. # Reduce data files size and journal files size Edit the file and specify the configuration options that you required in the configuration file for MongoDB server startup. In this guide, we create the configuration file at C:\mongodb\conf\nf. ![]() What We UsedĬreate a text file and name it as nf. In this tutorial, we will show you how to start the MongoDB server with configuration file on Windows.
0 Comments
Leave a Reply. |