[SERVER-4865] create two mongod services on windows 2008 server possible? Created: 03/Feb/12 Updated: 29/Feb/12 Resolved: 06/Feb/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin |
| Affects Version/s: | 2.0.2 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Stefan Rauchegger | Assignee: | Tad Marshall |
| Resolution: | Done | Votes: | 0 |
| Labels: | Windows, arbiter, replicaset, replication, server | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
windows 2008 r2 64bit |
||
| Participants: |
| Description |
|
would like to run two processes of mongo as service. 1) 2) second service constantly restarts, whereas first one is working fine and also has secondary replication set on another machine working. I read something, that mongod checks on startup, if another process with the same name is already running. I don't know whether this is a bug or just my stupidity - so it's "just" a question ... YHIA Stefan |
| Comments |
| Comment by Tad Marshall [ 06/Feb/12 ] | ||||||||||||||||||||
|
I'm glad we could help, thanks for updating us! | ||||||||||||||||||||
| Comment by Stefan Rauchegger [ 06/Feb/12 ] | ||||||||||||||||||||
|
Thanks Tad, Seems to be working fine now! So. first my db subfolder was missing, after creating that the log reads like that ...
then I added Arbiter from Primary ... Ok, some things I changed/did different this time! 1) used parameter --smallfiles as journal was taking much space for both instances, might have run out of disk space with my first tries creating multiple nodes on same machine with large journal files!
2) used a complete separate data-directory e:\data_arb for arbiter-service and not a subfolder of e:\data, which is used by Primary as I found following log entry
3) and I forgot to specify --directoryperdb on arbiter, unlike I specified it on regular node. Thanks for your prompt help! Issue closed Stefan | ||||||||||||||||||||
| Comment by Tad Marshall [ 03/Feb/12 ] | ||||||||||||||||||||
|
This should work. and with some initial setup it works for me in Windows 7 (which should behave the same as Windows Server 2008 R2). But I stumbled a bit getting my initial setup right and saw symptoms similar to what you are describing. There is no problem with running multiple copies of mongod.exe simultaneously provided that each one has a distinct dbpath, logpath and port (which you have done). You do not need to run the executable from different directories: several instances started from the same disk file will work fine. Note that despite the name, "logpath" needs to be a file specification, not a directory. Also, --logappend should be added any time --logpath is used to prevent logs from overwriting each other, so your arbiter command should include it. Can you look at your "e:\data\arb\logs" log file and see if it it contains an error message explaining the problem? For example, mine said
when I had neglected to create the keyfile before starting the arbiter. I had the same problem (with a different error message) when I put an invalid character in the keyfile. In version 2.0.2, if mongod.exe is successfully installed as a service, it sets itself up to automatically restart on any failure. This includes failures such as the above "error getting file", so I saw the same infinite restart problem you saw. Once I had created the keyfile and the two data directories, both services worked, with no restarts. We have made some improvements to service setup for version 2.1.0 (unstable, coming soon), including turning off the infinite restarts and correctly quoting keyfiles with spaces in their filenames, but with the right initial setup (files and directories) your example should work with 2.0.2. Look at your log file and let us know, thanks. |