datastax - dse graph connection timeout from nodejs driver when trying to execute graph queries -
i'm playing last version of dse enterprise. i'm interested in graph features. have 1 project running on titan open source graph database inspired dse graph, , i'm trying evaluate dse graph replacement database, since titan missing many administration , operation features.
my problem following:
i have strange behavior while trying execute graph queries on datastax cluster using nodejs driver. query working (i can add or delete vertices), on client side (nodejs driver) connection timeout error, after 5 7 seconds, this:
{ "statuscode": 200, "body": { "info": { "queriedhost": "xx.xx.xx.xx:9042", "triedhosts": { "xx.xx.xx.xx:9042": { "message": "connection timeout", "info": "cassandra driver error" } }, "achievedconsistency": 10 }, "length": 1, "pagestate": null } }
when @ datastax studio, queries working though. can see newly added vertices...
here code used call dse graph:
'use strict'; const dse = require('dse-driver'); const dsegraph = require('dse-graph'); const client = new dse.client({ contactpoints: ['xx.xx.xx.xx'] , protocoloptions: {port: 9042}, authprovider: new dse.auth.dseplaintextauthprovider("xxx","xxx"), graphoptions: { name: 'test' } }); module.exports.create = (event, context, callback) => { let response = { statuscode: 200 }; client.executegraph("graph.addvertex(label,'user','email','c@b');").then(function(users) { response.body=users; client.shutdown(); callback(null, response); }).catch(function(err) { response.statuscode=400; response.body=err; client.shutdown(); callback(null, response); }); };
may problem in cluster configuration?
here topology:
- one cluster
- 3 datacenters
- 1 datacenter graph, 2 nodes
- 1 datacenter search, 1 node
- 1 datacenter analytics, 1 node
all settings defaults ones. i've installed cluster through opscenter, , nodes ec2 instances (m4.xlarge).
do have idea why queries working, strange message in success callback?
regards,
toufic zayed
as stated in docs, should not call shutdown after each query executed.
normally should use 1 client
instance per application. should share instance between modules within application.
you should call client.shutdown()
once in application’s lifetime, when shutdown application.
Comments
Post a Comment