DEV Community

Cover image for Mastering Neo4j: Graph Database Awesomeness Unleashed!
Ahmed Zidan for AWS Community Builders

Posted on • Updated on • Originally published at dailytask.co

Mastering Neo4j: Graph Database Awesomeness Unleashed!

Dive into the world of Neo4j, where nodes, edges, and attributes come together in a symphony of data excellence. 🎓✹

Deploying Neo4j with Helm

Unlock the power of graph-data-science with a breeze! Follow these steps:

  1. Prepare Your Helm Chart:
  • Create a values.yaml file with essential configurations.
neo4j:
  name: licenses
  acceptLicenseAgreement: "yes"
  edition: enterprise
  resources:
    cpu: "1000m"
    memory: "2Gi"
volumes:
  data:
    mode: defaultStorageClass
env:
  NEO4J_PLUGINS: '["graph-data-science"]'
config:
  dbms.security.procedures.unrestricted: "gds.*"
Enter fullscreen mode Exit fullscreen mode
- Example Helm Chart available [here](https://github.com/neo4j/helm-charts)
Enter fullscreen mode Exit fullscreen mode
  1. Deploy with Helm:
  • Execute a single command for deployment.
helm repo add neo4j https://helm.neo4j.com/neo4j
helm repo update
helm upgrade --install neo4j-cluster neo4j/neo4j --namespace neo4j --values values.yaml --version v5.15.0
Enter fullscreen mode Exit fullscreen mode
  1. Verification:
    • Confirm your installation with kubectl get pod.
~ kubectl get pod 
NAME              READY   STATUS    RESTARTS      AGE
neo4j-cluster-0   1/1     Running   0                           124m
Enter fullscreen mode Exit fullscreen mode
  1. Graph-Data-Science Check:
  • Verify graph-data-science with a Neo4j console query.
RETURN gds.version();
Enter fullscreen mode Exit fullscreen mode

gds.version command line

Importing Data to Neo4j Cluster

Simplify the database import process effortlessly:

  1. Upload Dump File:
  • Move your dump file to the pod.
kubectl cp Downloads/neo4j.dump neo4j/neo4j-cluster-0:/import/neo4j.dump 
Enter fullscreen mode Exit fullscreen mode
  1. Run Import Command:
  • Execute the import command line.
kubectl exec neo4j-cluster-0 -- neo4j-admin database load --from-path=/import neo4j --overwrite-destination=true --verbose
Enter fullscreen mode Exit fullscreen mode

⚠ Issue Resolution:

  • Encounter locking issues? Delete the lock file.

Caused by: org.neo4j.io.locker.FileLockException: Lock file has been locked by another process: /data/databases/neo4j/database lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)

kubectl exec neo4j-cluster-0 -- rm -rf /data/databases/neo4j/database_lock 
Enter fullscreen mode Exit fullscreen mode
  1. Restart Neo4j:
  • Ensure data loading completion.
kubectl exec neo4j-cluster-0 -- neo4j restart
Enter fullscreen mode Exit fullscreen mode

Ready to unravel the magic of graph databases? 🌐✹ Connect with me on:

Top comments (0)