Can not start Mongodb 2.6.3 on Windows as service - windows

Trying to install and start mongodb service on widnows 7 x64
mongod.cfg:
systemLog:
destination: file
path: "c:\\mongo\\logs\\mongo.log"
quiet: true
logAppend: true
storage:
dbPath: "C:\\mongo\\data"
directoryPerDB: true
This works fine (mongodb starts, wrhites to logs/mongo.log):
bin\mongod.exe --config mongod.cfg
I install service:
bin\mongod.exe --config mongod.cfg --install
But on service start I've got an alert:
Windows could not start the MongoDB service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.
nothing in log file
tried config in plain format:
logpath=c:\mongo\logs\mongo.log
logappend=true
dbpath=C:\mongo\data
directoryperdb=true
the same result

You must use the full path of the configuration file when you install the windows service, for example:
bin\mongod.exe --config c:\mongo\mongod.cfg --install

Related

RabbitMq Installation issue

I am trying download and create a queque but I have problem. This is my list what I am doing:
I download erlang http://www.erlang.org/downloads (for windows x64)
I download rabbitmq https://www.rabbitmq.com/install-windows.html (for windows )
I install erlang and next install rabbimq
I write rabbitmq-plugins.bat enable rabbitmq_management in console and I have:
C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.0\sbin>rabbitmq-plugins.bat enable rabbitmq_management Plugin configuration unchanged.
Applying plugin configuration to rabbit#----... failed.
- Could not contact node rabbit#----. Changes will take effect at broker restart.
- Options: --online - fail if broker cannot be contacted.
--offline - do not try to contact broker.
So i write in consol "sc query rabbitmq" and I have :
[SC] EnumQueryServicesStatus:OpenService FAILED 1060:
The specified service does not exist as an installed service.
I know that rabbit is started by the process C:\Program Files\erl7.0\erts-7.0\bin\erlsrv.exe but I have this process so erlang was install correctly. I find people who have similar problem but they only "restart the RabbitMQ service and then try again" but I can't do this because my service does not exist.
Please give me some advice.
Ok I know. In console I am writing:
rabbitmq-plugins.bat enable rabbitmq_management
rabbitmq-server start
and RabbitMQ work.

How to install Redis Sentinel as a Windows service?

I am trying to set up a redis sentinel as a windows service on a Azure VM (IaaS).
I am using the MS OpenTech port of Redis for Windows and running the following command...
redis-server --service-install --service-name rdsent redis.sentinel.conf --sentinel
This command installs the service on my system but when I try to start this service either through the services control panel or through the following command...
redis-server --service-run --service-name rdsent redis.sentinel.conf --sentinel
Then the service fails to start with the following error...
HandleServiceCommands: system error caught. error code=1063, message = StartServiceCtrlDispatcherA failed: unknown error
Am I missing something here?
Please someone help me start this service make it work properly.
I had the same problem, and mine was related to my sentinel config. A number of articles I have found have some incorrect examples, so my service install would not work until the configuration was correct. Anyway, here is what you need at a minimum for your sentinel config (for Windows Redis 2.8.17):
sentinel monitor <name of redis cache> <server IP> <port> 2
sentinel down-after-milliseconds <name of redis cache> 4000
sentinel failover-timeout <name of redis cache> 180000
sentinel parallel-syncs <name of redis cache> 1
Once you have that setup, the original Redis service command above will work.
According to MSOpenTech, the following command should install Redis Sentinel as a service:
redis-server --service-install --service-name Sentinel1 sentinel.1.conf --sentinel
But when I used that command the installed service wouldn't start: it would immediately fail with error 1067, "The process terminated unexpectedly." Looking at service entry I'm guessing the problem is that the --service-name parameter isn't being filtered and ends up as part of the service executable path.
What I did find to work is installing the service manually with the SC command:
SC CREATE Sentinel1 binpath= "\"C:\Program Files\Redis\redis-server.exe\" --service-run sentinel.1.conf --sentinel"
Don't forget the required space after "binpath=", and obviously that path will have to reflect where you've installed redis-server.exe. Also after the service installed I edited the service entry so Redis Sentinel would run under the Network Service account.
I am using v3.0.501 and ran into the two issues below. While present it caused the service to fail on start without an error written to either the file log or the Event Log.
The configuration file must be the last parameter of the command line. If another parameter was last, such as --service-name, it would run fine when invoked the command line but would consistently fail went started as a service.
Since the service installs a Network Service by default, ensure that it has access to the directory where the log file will be written.
Once these two items were accounted for the redis as a service run smooth as silk.
Recently, I have found a way how to setup windows service for Redis and Sentinel.
During my setup, I encountered similar problem. I finally figured it out: it was caused by the configuration file path.
I have put all my configuration into my github project: https://github.com/dingyuliang/Windows-Redis-Sentinel-Config

Mac OSX - mongod and mongo not working

I'm completely new to databases and am trying to set up mongodb.
I've followed all the steps but neither the mongod or mongo commands work.
This is the output from mongod:
ERROR: could not read from config file
That is followed by all the mongo options (-h, -f, -v, etc.)
This is the output from mongo:
MongoDB shell version: 2.4.6
connecting to: test
Fri Sep 6 22:55:35.889 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
exception: connect failed
Any help is appreciated!
Try starting mongod with --config option specified. Something like /path/to/mongod --config /path/to/mongodb.conf.
In your mongodb.config check the location to the mongodb log. You should find additional details about errors there. Possible problems are: db path does not exist or is not writable, after an unclean shutdown mongod.lock file still exists etc.

Distributed mongo in windows

How to configure distributed mongodb installation in windows?........
You can install mongodb on Windows as service, for example:
download mongodb: http://www.mongodb.org/downloads
Unzip into c:\mongo
create dir c:\mongo\data
create file: c:\mongo\config.txt
dbpath = c:\mongo\data
bind_ip = 127.0.0.1
noauth = true
install as windows service from command prompt
C:> c:\mongo\bin\mongod.exe -f c:\mongo\config.txt --logpath c:\mongo\log.txt --install
start service
C:> net start mongodb
As for distributed installation, there should not be anything Wondows specific. Just follow the documentation (Replication and Sharding) and change your configurations for your needs.

Running mongod as a windows service

i have installed mongodb on win32 and i am trying to run it as a service.
I have followed the instructions posted here: http://www.deltasdevelopers.com/post/Running-MongoDB-as-a-Windows-Service.aspx
but when when windows tries to 'load'/'run' the service there is a problem. I see the service under the services control banner constantly in the 'starting' state.
The result: the service is not started and windows is constantly trying to start it without success.
The instructions i have followed are:
At the command line
C:\mongodb\mongod -install
then
C:\mongodb\mongod -service
Then i modified the Win Registry Entry for the MongoDB Service by setting the ImagePath key to the value of C:\mongodb\mongodb.exe -service
Any advice? What am i doing wrong?
Just for future reference: running mongo as a windows service
Also lots of people seem to be saying: specify the whole path to the mongod.exe:
c:\mongo\mongod.exe --logpath "c:\mongo\logs\mongo.log" --logappend --dbpath "c:\mongo\data" --directoryperdb --install
Also if you're running Windows 7 don't forget to run the command window as an administrator.
I'd do it this way just cause I like to customize/organize things better:
Unzip mongo to where you want.
I like putting all the configuration in a file (my preference, since I didnt like default location of C:/data/db, and didn't like all the options as commandline params)...
Looks something like:
[C:\dev\mongodb\data\mongodb.conf]
dbpath = C:\dev\mongodb\data\db
logpath = C:\dev\mongodb\data\mongodb.log.txt
logappend = false
Then I put C:\dev\mongodb\bin in my Env Variable's PATH (so can call mongo.exe from any dir), but not needed...
Then on command line to install the Windows Service:
$ cd C:\dev\mongodb\bin
$ mongod.exe -f C:\dev\mongodb\data\mongodb.conf --install
It will create a Windows Service which if you want, can start manually via:
$ net start MongoDB
//Use qoutes if changed service name (via -serviceName to mongod --install), like: net start "Mongo DB"
Specifying several parameters at once is a good choice.
mongod
--install
to install as a service
--rest
to enable rest access to mongodb
–master
to set up mongodb instance as master.
–logpath
this is mandatory when you install mongodb as service
--dbpath
this too is mandatory for mongodb to run.
Here is a step by step guide describing the installation of MongoDB Service on Windows 7.
I have been faced similar issue. And i tried above solutions still have not get any result.
finally below code is solved my issue.
-> Command prompt open as administrator.
-> Copy and paste the below code after changing the proper bin and config path.
sc.exe create MongoDB binPath= "\"d:\MongoDB\bin\mongod.exe\" --service --config=\"d:\MongoDB\mongo.cfg\"" DisplayName= "MongoDB" start= "auto"
Happy Coding !!!!!!
Regardless of whether you're running as a service or not, you need to specify the --dbpath argument to mongod.exe.
Also, you shouldn't have to edit the registry. You can just issue the command like this:
C:\mongodb\mongod.exe --dbpath C:\data\db --install

Resources