Expand my Community achievements bar.

SOLVED

Socke error : AEM with MongoDB

Avatar

Level 3

I have setup MongoDB with AEM. I am able to start MongoDB successfully and can access at web console. After that I have started AEM, but immediately after starting I get below error. 

MongoDB Logs:

2015-04-28T09:58:14.933+0530 I NETWORK  [websvr] Socket recv() errno:10060 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. 127.0.0.1:49806

AEM last Logs:

28.04.2015 09:58:20.056 *INFO* [qtp709277531-34] org.apache.sling.startupfilter.impl.StartupFilterImpl Reloaded list of StartupInfoProvider: []

I have used below link for setup. 

http://cq-ops.tumblr.com/post/86895378084/how-to-run-aem-6-0-with-mongodb-2-6

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

port 28017 (+1000 to run port) was for the admin UI and existed prior to version 3.0 of MongoDB.

Try setting your run command to:

java -XX:MaxPermSize=1024M -mx4g -jar AEM_6.0_Quickstart.jar -r crx3,crx3mongo -Doak.mongo.uri=mongodb://localhost:27017

then your CQ5 will at least connect to 27017 rather then 28017. This port is set according to your own settings.

View solution in original post

5 Replies

Avatar

Community Advisor

CQ5 system console always works even when you can't connect to MongoDB.

This error indicates that CQ5 was unable to connect to MongoDB.

During successful connection attempt tween CQ5 and MongoDB in your log you will see:

*INFO* [FelixStartLevel] org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService Connected to database "your-database-name".

To find out which port your MongoDB is running do :

sudo lsof -iTCP -sTCP:LISTEN | grep mongo

Avatar

Level 2

What port is your Mongo instance on?  Looks like AEM is trying port 49806  Default Mongo port is 27017

 

Zyg

Avatar

Level 3

My MongoDB is running fine on http://localhost:28017/

 

To Start AEM I am using below command:

java -XX:MaxPermSize=1024M -mx4g -jar AEM_6.0_Quickstart.jar -r crx3,crx3mongo -Doak.mongo.uri=mongodb://localhost:28017

To Start MongoDB I am using below command:

mongod.exe --config "C:\Program Files\MongoDB\Server\3.0\mongod.cfg"

My MongoDB config is as below:

port = 27017
quiet = false
dbpath = C:\Program Files\MongoDB\Server\3.0\data
logpath = C:\Program Files\MongoDB\Server\3.0\log\mongod.log
logappend = true
journal = true
directoryperdb = true
rest=true
httpinterface=true
profile=2

Avatar

Correct answer by
Community Advisor

port 28017 (+1000 to run port) was for the admin UI and existed prior to version 3.0 of MongoDB.

Try setting your run command to:

java -XX:MaxPermSize=1024M -mx4g -jar AEM_6.0_Quickstart.jar -r crx3,crx3mongo -Doak.mongo.uri=mongodb://localhost:27017

then your CQ5 will at least connect to 27017 rather then 28017. This port is set according to your own settings.

Avatar

Level 3

Thanks. This worked for me :)