Neo4j的Azure的中移动服务 [英] Neo4j in Azure mobile services

查看:149
本文介绍了Neo4j的Azure的中移动服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图用一个Neo4j的数据库,我在一个蓝色的移动服务数据库。我在下面的本教程,我似乎无法得到它的工作。基本上,本教程做的是:

I have been trying to use a Neo4j database as my database in an Azure Mobile service. I was following this tutorial and I cant seem to get it to work. Basically what the tutorial does is:


  • 创建由天青举办一个虚拟机,运行Ubuntu和Neo4j的。

  • 创建有一个SQL表中的Azure移动服务。

  • 写入一个插入脚本,它使用的node.js连接到的Neo4j VM和过去的数据出现在SQL表

不幸的是我的似乎不工作。这些数据被发布到移动服务SQL表,但剧本张贴到虚拟机上的Neo4j的服务器似乎并没有工作。我也知道,虚拟机是否设置正确,因为我可以连接到它在Neo4j的Web管理页面。

Unfortunately mine does not seem to work. The data gets posted to the mobile services SQL table but the script to post to the Neo4j server on the VM does not seem to work. I also know that the VM is setup correctly because I can connect to it in the Neo4j web admin page.

下面是code的脚本:

Here is the code for the script:

    function insert(item, user, request) {
    //comment to trigger .js creation
    var neo4j = require('neo4j');
    var db = new neo4j.GraphDatabase('http://<username>:<password>@http://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();

}

没有任何一个有这种经验吗?是不是有什么毛病我的脚本?随着教程的方法呢?任何帮助将是AP preciated。

Does any one have any experience with this? Is there something wrong with my script? With the tutorials approach? Any help would be appreciated.

编辑:有与行的问题: console.err('错误保存新节点的数据库:',ERR); 这必须与<被替换code> console.err('错误保存新节点的数据库:',ERR); 。不过我现在收到此错误信息:

There was a problem with the line: console.err('Error saving new node to database:', err); which had to be replace with console.err('Error saving new node to database:', err);. However I am now getting this error message:

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] }

再次,任何帮助将是AP preciated!

Once again, any help would be appreciated!

推荐答案

好吧,我设法弄明白。问题是,该教程(和Neo4j的于Node.js文档)有一个错字。在code应该是 console.error(),而不是 console.err()

Ok I managed to figure it out. The problem was that the tutorial (and documentation for neo4j for node.js) had a typo. The code should have been console.error() rather than console.err().

这篇关于Neo4j的Azure的中移动服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆