Creating a Neo4j instance on GCP vm

To create a single instance of Neo4j in a GC virtual machine, follow the steps below:

Set up Docker in VM

  • SSH into your vm

  • Update apt-get

    sudo apt-get update
  • Download the following

    sudo apt-get install     apt-transport-https     ca-certificates     curl     gnupg-agent     software-properties-common
  • Add docker key

    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
  • Add fingerprint:

    sudo apt-key fingerprint 0EBFCD88
  • Add the following:

    sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
  • Update app-get again

    sudo apt-get update
  • Now install docker

    sudo apt-get install docker-ce docker-ce-cli containerd.io

Create Neo4J image

  • Run commands to create an instance:

    Or Start an existing instance:

  • View Neo4j in browser by navigating to http://<vm external ip>:7474/browser

  • You can change the password from the browser console by running the following command:

Install APOC on Neo4j Docker

Install apoc jar file:

Install/start neo4j with plugins directory enabled:

Full text search on Neo4j

Ref: https://graphaware.com/neo4j/2019/01/11/neo4j-full-text-search-deep-dive.html

  • Create a FTS index on neo4j browser or via lib

  • Search based on constraints. For instance to search for food stamps in and only in zip_code 76104 do the following:

  • Add LIMIT, SKIP and ORDER BY params:

Uses HERE https://developer.here.com/projects/PROD-9ad03b9a-5f17-41a1-89f6-8e337f469983/usage

Middleware: https://expressjs.com/en/guide/using-middleware.html#middleware.router

Remove duplicate nodes in Neo4j: https://gist.github.com/jruts/fe782ff2531d509784a24b655ad8ae76

BUILDING WITH GRANDSTACK: GraphQL, React, Apollo, and Neo4j

Last updated

Was this helpful?