Node Memcached Error : Connect did not give a server

I am using Node-Memcached npm for my new app in node js server. In this some time only i'm getting the error when i conncet and get the data from memcache. please help me out this..

Error : Connect did not give a server at get the chat data

My memcache connection and get syntax is :

chatmemcached   = require('memcached'); 
memcache = new chatmemcached(dbconfig['memcachehost'][server]+":"+dbconfig['memcacheport']);
memcache.get("chat_"+userid, function (err,result) {
     if(err) {
         console.log("Error : "+err+" at get the chat data"); 
     } else {
         process the result;
     }
     memcache.end();
});

Thanks in advance.

Selva

Do you configure the installed memcached. If not, you need to edit /etc/memcached.conf in order to set the '-l' parameter to the correct IP address of your server. Same to be done for the '-p' parameter for port.