mongodb server not running as a background process - database

I recently downloaded mongodb and robo 3T. now im new to using mongodb on my system as i normally only use it online. well ever since i installed mongodb, it is meant to run as a background process forever but it never does. for it to even show on my task manager i have to start the service by myself and whenever i restart my laptop its stopped again. my point is, because of this problem, robo 3T hasnt been able to connect to mongodb even though i start the service by myself. did i do anything wrong when installing mongodb and how do i fix this problem?

I don't like the .msi installer to create the MongoD service. Usually I prefer the manual way of doing it. It gives more control and you know what actually happens.
Install MongoDB with MSI installer, disable option "Install MongoD as a Service"
Create mongod.cfg file according to your preferences.
You may use <Installation Path>\Server\5.0\bin\mongod.cfg as template. Pay attention to Windows Service Options.
Install the service by running mongod.exe --config "<full path of mongod.cfg file>" --install
Note, you need to run mongod.exe --install with Administrator privileges. See https://docs.mongodb.com/manual/reference/program/mongod.exe/
Check your Service Manager services.msc for any already existing Mongo services. You can remove them with mongod.exe --config "<mongod.cfg file>" --remove or sc.exe delete <service name>

Related

i cant run mongo.exe from cmd

every time I run mongod.exe from cmd I get the following message on my screen
I'm a beginner in this so I really don't know what it means
I haven't seen anything on the web describing this
You have three questions.
Cannot run mongo.exe - See mongo.exe not installed in Version 6.0.0
Excessive output when you run mongod.exe
Install MongoDB as service. Create a configuration file (a default file should be created at C:\Program Files\MongoDB\Server\6.0\bin\mongod.cfg while installation) and create the service with
mongod.exe --install "C:\Program Files\MongoDB\Server\6.0\bin\mongod.cfg"
Then your MongoDB starts automatically at boot time.
I haven't seen anything describing the log format - See Log Messages

Can't use mongo shell on Windows and interact with MongoDB from command line [duplicate]

I installed MongoDB community Server from this link. But when I look into C:\Program Files\MongoDB\Server\6.0\bin
, I am not able to locate mongo.exe file. I am able to see mongod.exe and mongos.exe.
Can someone help. Thank you.
legacy mongo shell (mongo) no longer ships with server binaries (for servers >= 6.0). You can download a new shell version (mongosh) from here
Answer from dododo worked for me.
Download Mongo Shell - mongosh from MongoDB Download Center
Extract the contents of the bin from the downloaded zip file to the bin file of your MongoDB folder and run mongosh instead of mongo.
To run the Mongo Shell , Download msi package from the MongoDB Community Download - https://www.mongodb.com/try/download/community
The version 6.0 do not ships with server binaries so mongo.exe file wouldn't be shown. So instead download mongo shell - https://www.mongodb.com/try/download/shell
After downloading unzip the bin directory in your Original bin directory
(You would also need to create a new directory in C: drive named data/db)
Now open the bin directory from Mongodb folder, and run mongod.exe
After that keeping Mongod.exe running in background open mongosh.exe ,
Your mongo Shell will be started.
After version 6.0.0 mongo.exe does not get installed to your bin folder so you have to manually install the new MongoDB shell which is called mongosh then you have to add its path to your system variables and then run mongosh --version to see if it got installed. Afterwards if you want to create your own databases and preform operations run "mongosh" in your terminal to connect to a MongoDB instance running on your localhost with default port 27017.
Read the mongoDB documentation for more information:
install mongosh:
https://www.mongodb.com/docs/mongodb-shell/install/
The mongosh shell vs the old mongo shell:
https://www.mongodb.com/docs/mongodb-shell/
Connect to a Deployment:
https://www.mongodb.com/docs/mongodb-shell/connect/
It should be noted, that in MongoDB version 6.0 there are two items:
The legacy mongo shell is removed from MongoDB 6.0
The MongoDB Shell (mongosh) is not installed with MongoDB Server. You need to follow the mongosh installation instructions to download and install mongosh separately. This was already announced in MongoDB version 5.0
The legacy mongo shell does not exist anymore on MongoDB version 6.0. If you desire the old mongo.exe, then you can install if from an earlier MongoDB version.
You also need to add a path variable of the bin folder where mongosh application is present (after downloading from the below link:
https://www.mongodb.com/try/download/shell ).
Then you can use mongosh command from anywhere using CMD:
STEPS TO FOLLOW AFTER DOWNLOADING SHELL FROM https://www.mongodb.com/try/download/shell
Include both your mongosh shell and mongod in environment variables.
go to your c drive and create db folder inside data folder
then run your mongosh and mongod in two different cmd windows
separately
..first run mongod
..then run mongosh
if you have check-marked run as a service at the time of download
then next time you are not required to start mongosh , it will
automatically get started.

How to install MongoDB version 6.0 into your windows 11 laptop? [duplicate]

I installed MongoDB community Server from this link. But when I look into C:\Program Files\MongoDB\Server\6.0\bin
, I am not able to locate mongo.exe file. I am able to see mongod.exe and mongos.exe.
Can someone help. Thank you.
legacy mongo shell (mongo) no longer ships with server binaries (for servers >= 6.0). You can download a new shell version (mongosh) from here
Answer from dododo worked for me.
Download Mongo Shell - mongosh from MongoDB Download Center
Extract the contents of the bin from the downloaded zip file to the bin file of your MongoDB folder and run mongosh instead of mongo.
To run the Mongo Shell , Download msi package from the MongoDB Community Download - https://www.mongodb.com/try/download/community
The version 6.0 do not ships with server binaries so mongo.exe file wouldn't be shown. So instead download mongo shell - https://www.mongodb.com/try/download/shell
After downloading unzip the bin directory in your Original bin directory
(You would also need to create a new directory in C: drive named data/db)
Now open the bin directory from Mongodb folder, and run mongod.exe
After that keeping Mongod.exe running in background open mongosh.exe ,
Your mongo Shell will be started.
After version 6.0.0 mongo.exe does not get installed to your bin folder so you have to manually install the new MongoDB shell which is called mongosh then you have to add its path to your system variables and then run mongosh --version to see if it got installed. Afterwards if you want to create your own databases and preform operations run "mongosh" in your terminal to connect to a MongoDB instance running on your localhost with default port 27017.
Read the mongoDB documentation for more information:
install mongosh:
https://www.mongodb.com/docs/mongodb-shell/install/
The mongosh shell vs the old mongo shell:
https://www.mongodb.com/docs/mongodb-shell/
Connect to a Deployment:
https://www.mongodb.com/docs/mongodb-shell/connect/
It should be noted, that in MongoDB version 6.0 there are two items:
The legacy mongo shell is removed from MongoDB 6.0
The MongoDB Shell (mongosh) is not installed with MongoDB Server. You need to follow the mongosh installation instructions to download and install mongosh separately. This was already announced in MongoDB version 5.0
The legacy mongo shell does not exist anymore on MongoDB version 6.0. If you desire the old mongo.exe, then you can install if from an earlier MongoDB version.
You also need to add a path variable of the bin folder where mongosh application is present (after downloading from the below link:
https://www.mongodb.com/try/download/shell ).
Then you can use mongosh command from anywhere using CMD:
STEPS TO FOLLOW AFTER DOWNLOADING SHELL FROM https://www.mongodb.com/try/download/shell
Include both your mongosh shell and mongod in environment variables.
go to your c drive and create db folder inside data folder
then run your mongosh and mongod in two different cmd windows
separately
..first run mongod
..then run mongosh
if you have check-marked run as a service at the time of download
then next time you are not required to start mongosh , it will
automatically get started.

Why does this jenkins job never complete?

I have a windows 8 jenkins slave (really more than one) and I want to have a task which clones a mirror of a git repository if it doesn't exist and always fetches latest.
I've got this 'execute windows batch' step:
if not exist "server-reference" (
git clone --mirror git#ssh.com:something/somewhere.git server-reference
)
pushd server-reference
git fetch --all
popd
exit /B %ERRORLEVEL%
The console output for the job gets to this point
c:\jenkins\workspace\thing\server-reference>git fetch --all
Fetching origin
and never finishes
If I switch an exit above the fetch then I get the expected exit.
And if I run the batch file commands as the jenkins user on the windows box everything works as expected. So I (think I) know that the git fetch --all runs on the slave without prompting for input
How do I amend this script so that it completes when Jenkins runs it?
A number of things can cause this problem. Here are things that have worked for me in the past.
I know you stated this above, but just to double-check: Confirm that when you run git fetch --all manually on the slave machine, it doesn't prompt you for a password. If it does, Jenkins would get stuck on that step, so you'll need to set up an SSH keypair.
Make sure that you are calling C:\Program Files (x86)\Git\cmd\git.exe and not C:\Program Files (x86)\Git\bin\git.exe in Jenkins. The second one can cause this problem in certain versions of git.
On the slave machine, set the environment variable HOME to C:\users\[username], filling in your user's username. (For older OS's it was C:\Documents and Settings\[username].) Then recycle the Jenkins service and try again.
Double check that in Administrative Tools > Services, the Jenkins slave service "Log On As" is set to your user and the password is correct. If not, set those values, recycle the Jenkins service and try again.
If none of the above worked, try uninstalling and reinstalling git. And if you aren't using it, try installing the newest version of git.

SQL Server Adapter for Rails

Trying to find the sqlserver adapter for rails on windows.
I have tried getting it from (without luck):
gem install activerecord-sqlserver-adapter --source=http://gems.rubyonrails.org
Where else can I get this gem?
UPDATE:
Make sure to run the command prompt as the administrator. Right click on the command prompt and click "Run as administrator".
I just ran the exact command line you did, and the gem installs fine.
Questions:
Are you running Vista?
If so, make sure you run your command prompt with administrative access, so it can write to the gems folder
Do you have the latest version of gems?
Run gem --version to find out what you have, if it's not 1.2.0, then run gem update --system to get the latest

Resources