error occured installing mongo db - mongodb

D:\mongodb-win32-x86_64-2008plus-2.4.9\bin>m
ongod.exe --dbpath=D:\mongodb --logpath=D:\mongodb\log.txt --install
Mon Feb 24 13:08:02.680 Trying to install Windows service 'MongoDB'
Mon Feb 24 13:08:02.681 Error connecting to the Service Control Manager: Access
is denied. (5)

The access denied does indicate that you lack the permissions to install a windows service. Try to run as administrator (right mouse-> run as administrator).
If you are running from a shell, start an admin shell by clicking right on the shell in the startmenu and then start as administrator

Related

MongoDB (ServerService) not installing on windows10

I am trying to install mongodb on my windows10 computer, but keep getting error that I don't have the privileges, even though I am the admin user.
I tried running the msi installer getting the error. So I tried the commands shown in the docs https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#procedure using the terminal running as admin, but getting the same error as seen below.
I am trying to install it on my D:/ Drive. But I also tried installing it in the default C:/Program Files/MongoDB/Server/4.4/ but it didn't work as well.
cmd: msiexec.exe /l*v mdbinstall.log /qb /i mongodb-windows-x86_64-4.4.3-signed.msi INSTALLLOCATION="D:\Program_Files\MongoDB\Server\4.4\" ADDLOCAL="ServerService,Client,Router,MiscellaneousTools" SHOULD_INSTALL_COMPASS="0"
The log on as a service user right allows accounts to start or run services on a Windows machine. By default, and due to security reasons, services can only be configured to run under the Local System, Local Service or Network Service accounts which have a built-in right to log on as a service. Any other user account that requires to run a service must be assigned this right.
Run gpedit.msc.
Navigate to Computer Configuration > Windows Settings > Security Settings > Local Policies >User Rights Assignment.
In the details pane, double-click Log on as a service.
Click Add User or Group and add the account to the list of accounts that have the Log on as a service right. Once you have selected the user, click OK.
Click OK and close the policy editor.
References :
https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/log-on-as-a-service
No matter what I tried, I just couldn't get the Server Service to install on my system through the msi, using either the gui or command line.
So finally I installed it without checking the "Install MongoD as a Service" option.
It successfully installed the mongodb including the mongod.exe in the bin (finally).
Then ->
Set the environment variables PATH to my bin folder
Create the /data/db and /log/mongo.log in the directory you want
Type the command mongod --directoryperdb --dbpath <your_dir_path>\data\db --logpath <your_dir_path>\log\mongo.log --install
Type the command net start MongoDB
And you will have the mongodb service running as I did.

How do I resolve a failure to start service to run private build agent on Azure running Linux VM

I have installed and run interactively a private build agent for Azure DevOps on Linux.
However, when attempting to follow documentation to setup as a service it's failing to run. It usually completes the install successfully. But, starting the service always returns an error.
Configuration: New VM running Ubuntu 18.04LTS, secured with AAD and JIT, logged in with VM Admin permissions.
Error:
$ sudo ./svc.sh install
Creating launch agent in /etc/systemd/system/vsts.agent.xxx.linux-agent-01.service
Run as user: xxx#microsoft.com
Run as uid: 1613914
gid: 1613914
$ sudo ./svc.sh start
Failed to start vsts.agent.xxx.linux-agent-01.service: Unit vsts.agent.xxx.linux-agent-01.service is not loaded properly: Exec format error.
See system logs and 'systemctl status vsts.agent.xxx.linux-agent-01.service' for details.
Failed: failed to start vsts.agent.xxx.linux-agent-01.service
$
When attempting to run I get this:
3$ sudo ./svc.sh status
/etc/systemd/system/vsts.agent.edgewebui.LinuxAgent03.service
● vsts.agent.edgewebui.LinuxAgent03.service - VSTS Agent (edgewebui.LinuxAgent03)
Loaded: error (Reason: Exec format error)
Active: inactive (dead)
Feb 28 18:59:18 build-agent-linux systemd[1]: /etc/systemd/system/vsts.agent.edgewebui.LinuxAgent03.service:7: Invalid user/group…osoft.com
Hint: Some lines were ellipsized, use -l to show in full.
Any suggestions on why this isn't working.

Kill MongoDB Server - Windows 7

I just fired up mongod.exe for my first time. However, I accidentally closed the command prompt and now I can't figure out how to kill the DB server process. I tried connecting via mongo.exe but I'm getting following error:
exception: connect failed
How do I stop the server process?
If you started mongod.exe via a command prompt in Windows:
> mongod
And then you closed that command window, the process will automatically be terminated. It is not running any more.
The error you're receiving when running mongo.exe is because MongoDB is not running. You'll need to run mongod.exe again if you need to access the database with the console via mongo.exe
You may want to consider setting MongoDB up as a service on Windows.

Issue with installation of Mongo DB on Windows 8.1

I am trying to install Mongo DB on a windows 8.1 64 bit machine and I a getting the following error.
C:\MongoDB\bin>mongo.exe
MongoDB shell version: 2.4.7
connecting to: test
Tue Nov 19 14:50:02.652 Error: couldn't connect to server 127.0.0.1:27017 at src
/mongo/shell/mongo.js:145
exception: connect failed
Make sure you have the daemon process running. You start it via mongod.exe. You are running the client side and by default connecting to port 27017 - the default mongo instance. Check your running processes for mongod first!
Make sure to unclick the download compass section when you download the shell. As soon as I unclicked it I was able to install the Mongodb shell. Hope this helps - I was stuck with this problem for a long time.

install mongodb on window 8

I try to install mongodb on window 8 .
problem is when i want to install mongodb service
C:\mongodb\bin\mongod.exe --auth --config C:\mongodb\mongod.cfg --install
below error accord
Wed Mar 13 19:13:23 Trying to install Windows service 'MongoDB'
Wed Mar 13 19:13:23 Error connecting to the Service Control Manager: Access is denied. (5)
how Can I Install Mongodb Service?
Open Command with "Run as Administrator",that solved my problem
For anyone that happens to try to create a mongodb service on Windows 8 and follows the instructions on MongoDB's website AND still is unable to create the service successfully - I've written this post that explains how I got it to work after experiencing problems trying to set the mongo service on my Windows 8 laptop. Hope it helps!
Here are the steps that you really need to follow to create a Windows service for MongoDB in Windows 8:
Installing MongoDB on Windows 8
Download and install MongoDB. You can download the 32 or 64-bit version from here.
Make sure you install MongoDB in a folder that you can easily remember, for example: c:\mongodb\
Add directories c:\mongodb\log and c:\mongodb\data
Add log file c:\mongodb\log\mongo.log
Creating a Windows service for MongoDB
Open your command window and type the following:
cd c:\mongodb\bin\mongod.exe --install --rest -master -logpath=c:\mongodb\log\mongo.log
Open the registry settings, press the Windows key and R at the same time and then type regedit in the Run command window.
Go to HKEY_LOCAL_MACHINE >> SYSTEM >> CurrentControlSet >> services
Find out MongoDB directory & edit ImagePath key
Set key value as:
C:\mongodb\bin\mongod --service --rest --master --logpath=C:\mongodb\logs\mongo.log --dbpath=C:\mongodb\data
Save and exit registry editor.
Open Services by pressing the Windows key and R at the same time and then type services.msc in the Run command window and click OK.
Find the MongoDB service and right-click on it, select Properties
Make sure the service is set to start automatically and start the service as shown below.
Open your browser and go to http://localhost:28017/ to see if MongoDB is running correctly, you should see a page full of MongoDB details.
Link to this blog post:
http://ricardodsanchez.com/2014/09/03/install-mongodb-service-on-windows-8/
error message suggest you don't have admin privileges.
"Run all of the following commands in Command Prompt with “Administrative Privileges:”"
Ref: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/#install-and-run-the-mongodb-service
Regards,
Moacy
thanks for answer Moacy Barros but problem was not for this because i run all commands in Command Prompt with “Administrative Privileges:”" problem was for mongod.cfg if mongod.cfg config by manual in editor this problem solve that we didn't need to do this in window 7 or server 2008
Edit::
in older windows when installing MongoDB < 2.2 that i was tested. in Configure directories and files step
echo logpath="C:\Program Files\MongoDB\log\mongo.log" > "C:\Program Files\MongoDB\mongod.cfg"
it make mongod.cfg for your mongodb but it wasn't make for me in window 8 for that i make it by manual like
logpath=C:\mongodb\log\mongo.log
logappend=true
dbpath = E:\data