Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
add more details to the instructions
  • Loading branch information
J1e9n9n1y authored Oct 19, 2023
1 parent 3805a36 commit c34402c
Showing 1 changed file with 70 additions and 4 deletions.
74 changes: 70 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The startup will take a short time.

# To create the namespace
```
kubectl apply -f git/neo4j5-on-kubernetes/minikube/minikube-namespace.yaml
kubectl apply -f minikube/minikube-namespace.yaml
```
Check with
```
Expand All @@ -22,15 +22,15 @@ kubectl get namespaces

# To create the persistent volume
```
kubectl apply -f git/neo4j5-on-kubernetes/minikube/minikube-persistentVolume.yaml
kubectl apply -f minikube/minikube-persistentVolume.yaml
```
Check with
```
kubectl get pv
```
# To create the persistent volume claims
```
kubectl apply -f git/neo4j5-on-kubernetes/minikube/minikube-persistentVolumeClaim.yaml
kubectl apply -f minikube/minikube-persistentVolumeClaim.yaml
```
Check with
```
Expand All @@ -39,7 +39,7 @@ kubectl get pvc --namespace neo4j-namespace

# Deploy neo4j version 4
```
kubectl apply -f git/neo4j5-on-kubernetes/neo4j/neo4j4-deployment.yaml
kubectl apply -f neo4j/neo4j4-deployment.yaml
```
Check with
```
Expand All @@ -59,8 +59,74 @@ kubectl --namespace neo4j-namespace describe pod neo4j-database-0
Use the default login for neo4j version 4 (neo4j:neo4j).
Open up the files NodeCreation.cypher and Relationship.cypher and copy/paste the statements to the webfrontend and executed it there.

To figure out what is the URL to access the webfront end use

```
minikube --namespace neo4j-namespace service neo4j-service –url
```

# To export the data using graphml
Run this Cypher-statement in the neo4j-Webfrontend
```
WITH "export-neo4j4.graphml" AS filename
CALL apoc.export.graphml.all(filename, {useTypes:TRUE, storeNodeIds:FALSE})
YIELD file
RETURN file;
```
after that export the saved data to your file system.

# Delete the neo4j version 4
```
Removing statefulset
kubectl --namespace neo4j-namespace delete statefulsets.apps neo4j-database
removing service
kubectl --namespace neo4j-namespace delete service neo4j-service
check if deleted
kubectl --namespace neo4j-namespace get all
```
# Create secret for neo4j version 5
```
kubectl apply -f neo4j5-on-kubernetes/neo4j/neo4j-secret.yaml
```
# Create neo4j version 5 database
```
kubectl apply -f neo4j5-on-kubernetes/neo4j/neo4j5-deployment.yaml
```
# Import the graphml data
Using this Cypher-statement
```
CALL apoc.import.graphml("export-neo4j4.graphml", {readLabels: true})
```

# Deploy neo4j version 5 to the neo4j-backup namespace
```
kubectl apply -f neo4j5-on-kubernetes/backup/neo4j5-secret-backup.yaml
kubectl apply -f neo4j5-on-kubernetes/backup/neo4j5-deployment-backup.yaml
```
# Check the connection to the HTTP API
by placing this curl statement into your terminal
```
curl -X POST http://192.168.49.2:30047/db/neo4j/tx/commit -H "Content-Type:application/json" -d "{\"statements\":[{\"statement\":\"match (n) return count(n)\"}]}" -H "Authorization: bmVvNGo6MTIzNDU2Nzg="
```
use this similar statement into your Cronjob
```
curl -d '{"statements": [ { "statement" : "WITH \"backup.graphml\" AS filename CALL apoc.export.graphml.all(filename, {useTypes:TRUE, storeNodeIds:FALSE}) YIELD file RETURN file;" } ]}' -H "Authorization: Basic bmVvNGo6MTIzNDU2Nzg=" -H "Content-Type: application/json" -X POST http://192.168.49.2:30047/db/neo4j/tx/commit
```

# Deploy the Cronjob
```
kubectl apply -f neo4j5-on-kubernetes/backup/neo4j5-backup-job.yaml
```
# Derive a job from the Cronjob for immediate execution
```
kubectl --namespace neo4j-backup create job --from=cronjob/neo4j-backup neo4j-backup-once
```

# Check for the availability of the created backup file
by accessing the database backend and navigating to the import folder
```
kubectl --namespace neo4j-backup exec -it neo4j-database-0 -- /bin/sh
```

# To reset anything you did and start from scratch
```
Expand Down

0 comments on commit c34402c

Please sign in to comment.