2

I'm wondering how one would get neo4j to work with Google Compute Engine. Has anybody done this? What problems did you encounter?

2 Answers 2

12
+100

Here you go,

Basic Setup

Configuration for GCE

Play around

  • Start neo4j server ./bin/neo4j start
  • Check your running instances @ http://IP_ADDRESS:7474/

Once py2neo Installed and server started, try some pycode to test it

>> from py2neo.neo4j import GraphDatabaseService, CypherQuery
>> # Set up a link to the local graph database.
>> # When () left blank defaults to http://localhost:7474/db/data/
>> graph = GraphDatabaseService('http://IP_ADDRESS:7474/db/data/')
>> CypherQuery(graph, "CREATE (n {name:'Example'}) RETURN n;").execute()

Above python setup / code, you can use it in GAE as well.

References

Edit: Appengine + Neo4j

from py2neo import neo4j
GRAPH_DB = neo4j.GraphDatabaseService(
        'http://uname:psswd@localhost:7474/db/data/')
if IS_PROD:
    GRAPH_DB = neo4j.GraphDatabaseService(
        'http://uname:psswd@host:port/db/data/')

def _execute(query):
    """Execute all neo4j queries and return list of Record objects.

    Returns:
      Returns list of Record objects.
    """
    try:
        result = neo4j.CypherQuery(GRAPH_DB, query).execute()
        # logging.info(result.data)
        return result
    except neo4j.CypherError as error:
        logging.error(error.exception)
    except DeadlineExceededError as dead:
        logging.warn(dead)
    except urlfetch_errors.InternalTransientError as tra_error:
        logging.warn(tra_error)
    except httplib.HTTPException as exp:
        logging.warn(exp)
    except neo4j.http.SocketError as soc:
        logging.warn(soc)
3
  • How would this compare to using Graph Story? Commented Jun 9, 2015 at 16:32
  • Is there a way to run app engine and neo4j in one application locally? What I want to do is fetch app engine datastore entities and create my neo4j graph database using it. I checked app engine documentation where they have specified what all external libraries it supports. Right now, I am running into an issue where my csv stream response is more than 32 MB. Also. can't use Compute Engine. pricing is the issue. I am making too many requests! Commented May 10, 2016 at 10:09
  • Yes, I am using it with appengine only. I have updated my answer including appengine + neo4j + localhost. Please have a look. Hope that answers your query. Commented May 11, 2016 at 9:26
4

the easiest and the safest way is to use docker neo4j image

and this is docker docs, to install and deploy on google compute engine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.