Homebrew安装MongoDB 3.6启动失败(错误码62)求助
Hey there, that error code 62 you're hitting is directly tied to the feature compatibility version (FCV) mismatch called out in your log. MongoDB 3.6 requires your data files to be fully upgraded to the 3.4 compatibility level first before you can use the 3.6 feature set. Let's walk through fixing this step by step:
Step 1: Start MongoDB in 3.4 Compatibility Mode
First, launch your mongod instance with the 3.4 feature compatibility flag to bypass the startup error:
mongod --dbpath /data/db --featureCompatibilityVersion 3.4
Step 2: Finalize 3.4 Compatibility in the Shell
Once the server starts successfully, open a new terminal and connect to the mongo shell:
mongo
Run this admin command to ensure your data is fully upgraded to the 3.4 standard:
db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )
You’ll get an { "ok" : 1 } response if this works.
Step 3: Shutdown the Server Gracefully
Still in the mongo shell, switch to the admin database and shut down the server cleanly:
use admin db.shutdownServer()
Step 4: Upgrade to 3.6 Feature Compatibility
Now start mongod normally (without the compatibility flag):
mongod --dbpath /data/db
Connect to the shell again and run the command to enable 3.6's full feature set:
db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )
Bonus: Addressing the Log Warnings
The other warnings in your log are just security best practices, not the cause of your startup failure:
- Access Control Warning: You can enable authentication later by creating admin users and restarting mongod with the
--authflag. - Bind IP Warning: If you need remote connections, start mongod with
--bind_ip 0.0.0.0(or specific trusted IPs) instead of the default localhost-only binding.
内容的提问来源于stack exchange,提问作者be-codified

