Closed jahanzaibaslam-vteams closed 9 years ago
Hi,
The error tells you that it can't connect to the couchbase bucket. Maybe the couchbase server is down or the bucket doesn't exist. Same, the adapter configuration could be wrong.
Please check your config/connections.js and have a look at the documentation (how to configure) https://www.npmjs.com/package/sails-cbes#configuration and http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.connections.html
Best regards! Luigi
On Wed, Jun 17, 2015 at 1:15 PM, jahanzaibaslam-vteams < notifications@github.com> wrote:
I am using sails-cbes with sails and getting this error. error: A hook (orm) failed to load! error: Error: Failed to connect to the Couchbase/ElasticSearch clients { [Error: failed to connect to bucket] code: 25 }
— Reply to this email directly or view it on GitHub https://github.com/aronluigi/sails-cbes/issues/2.
Thanks Luigi for the update. I am done once again with all connection configuration guide lines but still facing the same issue. here is my connections.js file
// config/connections.js
cb: {
adapter: 'sails-cbes',
host: '127.0.0.1',
port: 8091,
user: 'Administrator',
pass: 'word2pass',
operationTimeout: 60 * 1000, // 60s
bucket: {
name: 'default',
}
}
and when I use below mentioned code in controller. It's working fine with Bucket. I think there is issue with elastic search and waterline ORM.
var couchbase = require('couchbase');
var cluster = new couchbase.Cluster('couchbase://127.0.0.1');
var bucket = cluster.openBucket('default');
bucket.upsert('testdoc', {name:'Frank'}, function(err, result) {
if (err) throw err;
bucket.get('testdoc', function(err, result) {
if (err) throw err;
console.log(result.value);
// {name: Frank}
});
});
NOTE: It would be great if you share a sample project link where sails-cbes is working fine with sails.
Hi,
Make sure that you have couchbase and elastic search installed and configured on your system/server. Please modify the config below and put it inside your config/connections.js
Have a nice day! Luigi
module.exports.connections = { sailsCbes: { adapter: 'sails-cbes', cb: (function () { if (process.env.NODE_ENV == 'production') { return { host: '127.0.0.1', port: 8091, user: 'cluster admin user', pass: 'password', operationTimeout: 1000 * 60, bucket: { pass: '', name: 'Production BUCKET NAME' } }; } else { return { host: '127.0.0.1', port: 8091, user: 'cluster admin user', pass: 'password', operationTimeout: 1000 * 60, bucket: { pass: 'BUCKET_PASSWORD if not let it empty', name: 'BUCKET_NAME' } }; } })(),
es: (function () {
if (process.env.NODE_ENV == 'production') {
return {
host: ['127.0.0.1:9200'],
log: 'error',
index: 'YourProductionIndex',
numberOfShards: 5,
numberOfReplicas: 1
};
} else {
return {
host: ['127.0.0.1:9200'],
log: 'error',
index: 'YourDevIndex',
numberOfShards: 5,
numberOfReplicas: 1
};
}
})()
}
}
On Wed, Jun 17, 2015 at 3:04 PM, jahanzaibaslam-vteams < notifications@github.com> wrote:
Thanks Luigi for the update. I am done once again with all connection configuration guide lines but still facing the same issue. here is my connections.js file
// config/connections.js cb: { adapter: 'sails-cbes', host: '127.0.0.1', port: 8091, user: 'Administrator', pass: 'word2pass', operationTimeout: 60 * 1000, // 60s bucket: { name: 'default', } }
NOTE: It would be great if you share a sample project link where sails-cbes is working fine with sails.
— Reply to this email directly or view it on GitHub https://github.com/aronluigi/sails-cbes/issues/2#issuecomment-112792462.
I am using sails-cbes with sails and getting this error. error: A hook (
orm
) failed to load! error: Error: Failed to connect to the Couchbase/ElasticSearch clients { [Error: failed to connect to bucket] code: 25 }