1 | # Neo4j Driver Toolkit
|
2 |
|
3 | Tools for downloading, managing and testing Neo4j servers.
|
4 |
|
5 | - `neoget` - download and unarchive Neo4j server packages
|
6 | - `neoctl` - start and stop Neo4j servers and update default server password
|
7 | - `neorun` - start and stop a Neo4j server with guarantee of server fully started and stopped
|
8 |
|
9 |
|
10 | ## Neoget
|
11 | Neoget is a download script for fetching Neo4j server packages. To download the latest released version of Neo4j, simply use:
|
12 | ```
|
13 | python neoget.py
|
14 | ```
|
15 | If successful, the downloaded package would be unarchived immediately following the download.
|
16 |
|
17 | To install a specific Neo4j package version, use `-v` to specify the version:
|
18 | ```
|
19 | python neoget.py -v 3.0.1
|
20 | ```
|
21 |
|
22 | Alternatively, a url could also be used with option `-l` to directly download the Neo4j specified by the url
|
23 | ```
|
24 | python neoget.py -l http://alpha.neohq.net/dist/neo4j-enterprise-3.0-NIGHTLY-unix.tar.gz
|
25 | ```
|
26 |
|
27 | To install a nightly version, use `-n` to specify the nightly version togther with env var `TEAMCITY_NEO4J_<version>[_WIN]` (such as `TEAMCITY_NEO4J_30NIGHTLY`) to provide the secret teamcity download url for the nightly archives.
|
28 |
|
29 | Teamcity requires basic access authentication, which could either be provided via environment variable `TEAMCITY_USER` and `TEAMCITY_PASSWORD` or via the url directly with `username:password@` added in front of hostname.
|
30 | ```
|
31 | TEAMCITY_USER=username TEAMCITY_PASSWORD=password TEAMCITY_NEO4J_30NIGHTLY=https://<teamcity_hostname>/repository/download/<build_type_id>/lastSuccessful/<artifact_path> python neoget.py -n 3.0
|
32 | ```
|
33 | or
|
34 | ```
|
35 | TEAMCITY_NEO4J_30NIGHTLY=https://username:password@<teamcity_hostname>/repository/download/<build_type_id>/lastSuccessful/<artifact_path> python neoget.py -n 3.0
|
36 | ```
|
37 |
|
38 | witch is almost equivalent to
|
39 | ```
|
40 | curl --user username:password -O https://<teamcity_hostname>/repository/download/<build_type_id>/lastSuccessful/<artifact_path>
|
41 | ```
|
42 |
|
43 | For a full help page, use `-h`:
|
44 | ```
|
45 | python neoget.py -h
|
46 | ```
|
47 |
|
48 | ## Neoctl
|
49 | Neoctl is a controller for start and stop Neo4j packages. It also provides a method to update default neo4j password.
|
50 |
|
51 | To start a server, use the `start` command:
|
52 | ```
|
53 | python neoctl.py --start=neo4j
|
54 | ```
|
55 |
|
56 | Similarly, to stop a server, use the `stop` command:
|
57 | ```
|
58 | python neoctl.py --stop=neo4j
|
59 | ```
|
60 |
|
61 | To change the default passowrd of a Neo4j server, simply use
|
62 | ```
|
63 | python neoctrl.py --update-passowrd=s3cr3tP4ssw0rd
|
64 | ```
|
65 |
|
66 |
|
67 | ## Neorun
|
68 | Neorun provides commands to start and stop a Neo4j server with the guarantee that the server is fully started and stopped when the script returns.
|
69 | The start command also exposes a command to download and install a specific Neo4j server if no Neo4j found locally,
|
70 | as well as an option to change the default server password after the start.
|
71 |
|
72 | To start a Neo4j server, simply use the following command:
|
73 | ```
|
74 | python neorun.py --start=neo4j
|
75 | ```
|
76 | When the script returns, then the server is fully ready for any database tasks.
|
77 |
|
78 | If no Neo4j server is found in path `./neo4j`, then the default Neo4j server version used in `neoget.py` will be downloaded and installed to `./neo4j`.
|
79 | To specify other versions to download when a Neo4j is absent, use `-v`, `-t`, `-l` in a similar way as they are defined in `neoget.py`:
|
80 | ```
|
81 | python neorun.py --start=neo4j -v 3.0.2 -p s3cr3tP4ssw0rd
|
82 | ```
|
83 | In the example above, the `-p` option is used to change the default Neo4j password after the server is ready.
|
84 |
|
85 | For stopping the server, simply use the `stop` command:
|
86 | ```
|
87 | python neorun.py --stop=neo4j
|
88 | ```
|
89 |
|