I had a hell of a time trying to figure out how to install MongoDB silently via the command line in Windows server. Although the Mongo documentation is thorough, the exact commands listed didn’t work for me out of the box.
Keep in mind that these commands work best using the standard cmd shell, and not Powershell.
After downloading MongoDB, place the msi installer on the root C: drive, and then run the following:
msiexec.exe /q /i C:\mongodb-win32-x86_64-2008plus-ssl-3.6.5-signed.msi SHOULD_INSTALL_COMPASS="0"
The key here was the SHOULD_INSTALL_COMPASS="0" snippet. Without this, the installer would get halfway through, fail, and then rollback all changes.
Before moving on to install the Windows Service, you’ll need to complete a couple preliminary steps. Create two directories using the command below:
md "\data\db" "\data\log"
Next, create a mongod.cfg file and place it in C:\Program Files\MongoDB\Server\3.6\. This file should contain the following:
systemLog: destination: "file" path: "c:\\data\\log\\mongod.log" storage: dbPath: "c:\\data\\db"
If you’ve completed everything up to this point, you’re ready to create a Windows service. The command listed in the documentation didn’t work for me, either. After some finagling, the below code worked for me as well:
sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB\Server\3.6\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB\Server\3.6\mongod.cfg\"" DisplayName= "MongoDB" start= "auto"
That’s it! If you notice, the steps above are very similar to that listed in the official documentation, but these steps worked better for me. I hope this helps in some way.
출처: www.brycematheson.io/how-to-install-mongodb-silently-on-windows-server-2016/
'언어 > Database' 카테고리의 다른 글
Firebird-3.0.7.33374-1_Win32 (0) | 2021.01.23 |
---|---|
dbeaver-ce-7.3.2-win32.win32.x86_64 (0) | 2021.01.23 |
firebird 2.5.9.27139 (0) | 2019.11.19 |
sqlserver 2017 express x64 (0) | 2018.11.09 |
[sqlite3] create table (0) | 2018.04.01 |