3
3
## Usage
4
4
5
5
### Clone
6
+
6
7
To use this repo, you must first clone it locally
8
+
7
9
``` sh
8
10
git clone
[email protected] :Linkurious/docker-neo4j.git
9
11
cd ./docker-neo4j
10
12
```
11
13
12
14
### Configure
15
+
13
16
Configure variables in .env. See .env.example for template.
14
17
Reasonable defaults are provided. Simply use them when working localy.
18
+
15
19
``` sh
16
20
ln -s .env.example .env
17
21
ln -s .env.neo4j.v4.example .env.neo4j.v4.dev
18
22
```
19
23
20
24
### Start Neo4j
25
+
21
26
Run with docker-compose
22
27
Neo4j v4
23
28
24
29
``` sh
25
30
docker-compose up -d
26
31
```
32
+
27
33
Neo4j v5
28
34
29
35
``` sh
30
36
docker-compose -f docker-compose.v5.yml -f docker-compose.override.yml up -d
31
37
```
32
38
33
39
### Start Neo4j cluster
40
+
34
41
Neo4j v4
42
+
35
43
``` sh
36
44
ln -s .env.neo4j.v4.example .env.neo4j.v4.dev
37
45
docker-compose -f docker-compose.cluster.v4.yml -f docker-compose.cluster.override.yml up -d
38
46
39
47
```
40
48
Neo4j v5
49
+
41
50
``` sh
42
51
ln -s .env.neo4j.v5.example .env.neo4j.v5.dev
43
52
docker-compose -f docker-compose.cluster.v5.yml -f docker-compose.cluster.override.yml up -d
44
53
45
54
```
46
55
47
56
## Browse database when working localy
57
+
48
58
Go to http://localhost:7474 and connect with the following parameters:
49
59
50
60
- Connect URL: bolt://localhost:7687
@@ -54,6 +64,7 @@ Go to http://localhost:7474 and connect with the following parameters:
54
64
- Password: neo3j
55
65
56
66
## Neo4j v3 restore
67
+
57
68
``` sh
58
69
docker-compose -f docker-compose.yml -f docker-compose.shell.yml run --rm neo4j bash
59
70
```
@@ -63,80 +74,104 @@ docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-c
63
74
```
64
75
65
76
## Backup and restore (Neo4j V4)
77
+
66
78
see https://neo4j.com/docs/operations-manual/current/backup/
67
79
68
80
When working localy, docker-compose.override.yml adds a local bind mount to the /backups folder.
69
81
70
82
Backups can be downloaded from Nexus. They have to be decompressed in the ./backups bind mounted folder.
71
83
72
84
Create an online backup (command to be executed in the context of the neo4j container, with ` docker-compose exec neo4j ` ):
85
+
73
86
``` sh
74
87
neo4j-admin backup --backup-dir /backups --database crunchbase-1.0.0
75
88
```
76
89
77
90
Restore/create from dataset:
91
+
78
92
``` sh
79
93
neo4j-admin restore --from /datasets/4.2.0/crunchbase --database crunchbase-1.0.0 --verbose
80
94
```
81
95
82
96
Restore from backup:
97
+
83
98
``` sh
84
99
neo4j-admin restore --from /backups/4.2.0/crunchbase --database crunchbase-1.0.0 --verbose
85
100
```
86
101
in v3.5.x
102
+
87
103
``` sh
88
104
neo4j-admin restore --from /backups/3.5.15/fincrime-1.0.0/ --database graph.db
89
105
```
90
106
91
107
On first creation of a db, you will have to:
108
+
92
109
```
93
110
:use system
94
111
CREATE DATABASE `crunchbase-1.0.0` WAIT;
95
112
```
96
113
97
114
You can then check that the db has succesfully been restored with:
115
+
98
116
```
99
117
:use crunchbase-1.0.0
100
118
match (n) return n limit 10
101
119
```
102
120
103
121
### Offline load
122
+
104
123
```
105
124
neo4j-admin load --from=/datasets/crunch.3.5.15 --database=crunchbase-1.0.0
106
125
```
126
+
107
127
and create the database via cypher-shell (the credential are specified in the .env.neo4j.dev at the root of you repository) :
128
+
108
129
```
109
130
cypher-shell
110
131
CREATE DATABASE crunchbase;
111
132
```
112
133
113
134
## Plugins
114
135
### Apoc
136
+
115
137
see https://neo4j.com/labs/apoc/4.4/installation/
116
138
117
139
Download the appropriate version of apoc plugin and drop it in the plugins folder:
140
+
118
141
``` sh
119
142
curl -L https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.4.0.11/apoc-4.4.0.11-all.jar -o plugins/apoc-4.4.0.11-all.jar
120
143
```
144
+
121
145
Warning: Check the matching version for your version of Neo4j
122
146
123
147
### Aura
124
148
## load db
125
149
From a shell, stoped database :
150
+
126
151
``` sh
127
152
bin/neo4j-admin push-to-cloud --bolt-uri neo4j+s://XXXXX.databases.neo4j.io --database=fincrime-1.0.0 --overwrite
128
153
```
129
154
130
155
### Nexus datasets
131
156
157
+ ## Retrieve backup
158
+
159
+ We provide a script automating retrieving a backup from a given instance running in K8s:
160
+
161
+ ``` sh
162
+ ./scripts/backup.sh
163
+ ```
132
164
133
165
## Manual upload for large datasets
166
+
134
167
``` sh
135
168
export dataset_name=fincrime-sales
136
169
export dataset_version=1.0.0
137
170
curl -L -v --user
[email protected] :
${USER_PWD} --upload-file
${dataset_name} -
${dataset_version} .tgz https://nexus3.linkurious.net/repository/datasets/com/linkurious/neo4j/4.2.4/
${dataset_name} /
${dataset_name} -
${dataset_version} .tgz
138
171
```
172
+
139
173
## Download dataset
174
+
140
175
``` sh
141
176
export dataset_name=fincrime-sales
142
177
export dataset_version=1.0.0
0 commit comments