0
votes

I have created mongoDB replication set using this command:

F:\data>mongod --replSet set1 --dbpath 1 --port 27101 --oplogSize 50 --logpath log.1 --logappend --fork

It does not recognize --fork and it is not there in --help as well (I guess) so I have excluded it and got following output. I think there is nothing wrong so far.

all output going to: log.1

Then when I try to use mongo console using this command

F:\data>mongo --port 27101

It returns

MongoDB shell version: 2.2.2
connecting to: 127.0.0.1:27101/test
Thu Feb 14 01:36:33 Error: couldn't connect to server 127.0.0.1:27101 src/mongo/
shell/mongo.js:93
exception: connect failed

Now what can be done to make it work?

1
And what is in log.1? - Vasiliy Faronov
What Vasiliy said, and what does ps ax | grep mongod give you? Also, try changing the position of --fork option like so: mongod --fork --replSet set1 offset --dbpath 1 --port 27101 --oplogSize 50 --logpath log.1 --logappend - Alptigin Jalayr
It will keep a log file in data directory @VasiliyFaronov - sadaf2605
Can you post the contents of this log file? - Alptigin Jalayr
we checked to see if the Mongo Daemon was executing. Now, what are the contents of that log? - Alptigin Jalayr

1 Answers

0
votes

Actually I in the parameter I had this data path --dbpath 1 so I need to have a directory named '1' in my current directory but I had created it in data directory by misunderstanding.

Thankyou @Alptigin Jalayr and others who has lead me to the correct direction.