In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about how to start flashback using batch files in MongoDB for Windows. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Yesterday, a developer colleague installed a MongoDB database on his computer. It is said that he has made relevant security enhancements to the database and edited a .bat batch.
Start the file, but flicker when you click .bat to start the MongoDB database to help debug MongoDB.
The contents of the .bat batch file (mongodb_start.bat) provided by him:
Cd C:\ Program Files\ MongoDB\ Server\ 3.2\ bin\ mongod-dbpath "C:\ hospital_hangz\ MongoData\ rs0-0"-port 27000-- directoryperdb-- storageEngine wiredTiger-- wiredTigerCacheSizeDG 64-- auth-- logpath C:\ hospital_hangz\ MongoData
The process is as follows:
1. Try to start the database by using the .bat file provided by it in person, and the result is sure enough to flicker.
2. Confirm the MongoDB installation path and data file storage path involved in the script
3. Re-edit test.bat based on your own experience (mainly by using pause to prevent the startup window from exiting automatically, avoid flashback, and make it easy to observe and report errors), as follows:
C:\ Program Files\ MongoDB\ Server\ 3.2\ bin\ mongod-- dbpath "C:\ hospital_hangz\ MongoData\ rs0-0"-- port 27000-- directoryperdb-- storageEngine wiredTiger-- wiredTigerCacheSizeDG 64-- auth-- logpath C:\ hospital_hangz\ MongoData
Pause
4. Start MongoDB with test.bat, and the error is as shown in the figure:
5. From the screenshot of the error reported by 4, we can see that it is the installation path of mongodb database. There is a space in the installation path, that is, the space between Program Files. As a result, the mongod command cannot be found when mongodb starts.
In this case: Program Files in windows can be replaced by Program~1.
Re-edit the test.bat:
C:\ Program Files\ MongoDB\ Server\ 3.2\ bin\ mongod-- dbpath "C:\ hospital_hangz\ MongoData\ rs0-0"-- port 27000-- directoryperdb-- storageEngine wiredTiger-- wiredTigerCacheSizeDG 64-- auth-- logpath C:\ hospital_hangz\ MongoData
Pause
6. Start MongoDB with the re-edited test.bat in 5, and still report an error, but prompt logpath to specify a specific file and re-edit test.bat:
C:\ Program Files\ MongoDB\ Server\ 3.2\ bin\ mongod-- dbpath "C:\ hospital_hangz\ MongoData\ rs0-0"-- port 27000-- directoryperdb-- storageEngine wiredTiger-- wiredTigerCacheSizeDG 64-- auth-- logpath C:\ hospital_hangz\ MongoData\ mymongo.log
Pause
7. Start the MongoDB database using the edited test.bat in 6, and start it successfully:
Until this problem is solved!
After reading the above, do you have any further understanding of how MongoDB for Windows uses batch files to start flashback? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.