【发布时间】:2014-01-27 19:23:24
【问题描述】:
免责声明:这与我问的另一个问题 here 有关。有人建议我提出一个新问题,而不是更新那个问题,我希望这是正确的。如果没有,请告诉我并忽略这个问题。
我一直在尝试在 Microsoft Azure 中使用 Neo4j,使用 this tutorial。我创建了一个运行 Linux 和 neo4j 的 VM。我知道他的作品很好,因为我已经能够通过 Web 管理门户访问数据库,在那里我可以创建和删除条目。但是,当我尝试使用 node.js 插入元素时,问题就来了。
这是脚本的代码:
function insert(item, user, request) {
//comment to trigger .js creation
var neo4j = require('neo4j');
var db = new neo4j.GraphDatabase('http://<username>:<password>@neo4jmobile.cloudapp.net:7474');
var node = db.createNode({ name: item.name });
node.save(function (err, node) {
if (err) {
console.error('Error saving new node to database:', err);
}
else {
console.log('Node saved to database with id:', node.id);
}
});
request.execute();
}
我收到此错误消息:
Error saving new node to database: { [Error: connect ETIMEDOUT]
stack: [Getter/Setter],
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
__frame:
{ name: 'GraphDatabase_prototype__getRoot__1',
line: 76,
file: '\\\\10.211.156.195\\volume-0-default\\bf02c8bd8f7589d46ba1\\4906fa4587734dd087df8e641513f602\\site\\wwwroot\\App_Data\\config\\scripts\\node_modules\\neo4j\\lib\\GraphDatabase.js',
prev:
{ name: 'GraphDatabase_prototype_getServices__2',
line: 99,
file: '\\\\10.211.156.195\\volume-0-default\\bf02c8bd8f7589d46ba1\\4906fa4587734dd087df8e641513f602\\site\\wwwroot\\App_Data\\config\\scripts\\node_modules\\neo4j\\lib\\GraphDatabase.js',
prev: [Object],
active: false,
offset: 5,
col: 12 },
active: false,
offset: 5,
col: 12 },
rawStack: [Getter] }
任何帮助将不胜感激!
【问题讨论】:
-
能否访问目标Linux服务器的Neo4j浏览器?这在我看来像是防火墙问题。