Me pregunto cómo se podría hacer que neo4j funcione con Google Compute Engine. ¿Alguien ha hecho esto? ¿Qué problemas has encontrado?
Aqui tienes,
gcloud
gcloud compute ssh INSTANCE_NAME --zone AVAILABLE_ZONES
-> AVAILABLE_ZONES neo4j
en GCE: puede que necesite instalar java ( Fix ) y lsof (Fix: apt-get install lsof
). Añadir nombre de usuario de seguridad : contraseña de github
gcloud compute firewall-rules create neo4j --network default --allow tcp:7474
./bin/neo4j start
http://IP_ADDRESS:7474/
py2neo
y se inició el servidor, pruebe algunos códigos de código para probar >> 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()
Por encima de la configuración / código de python, también puede usarlo en GAE.
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)
La forma más fácil y segura es usar la imagen docker neo4j
y esta es la documentación de la ventana acoplable , para instalar e implementar en el motor de cómputo de Google