mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Adjust docs for deployment, DigitalOcean, and neo4j cypher commands
This commit is contained in:
parent
98f5fb868f
commit
5bc5ae68a8
@ -81,6 +81,17 @@ $ scripts/cluster.backup.sh
|
||||
|
||||
The backup will be saved into your network folders `backup` folder in a new folder with the date and time.
|
||||
|
||||
##### Default Database Name
|
||||
|
||||
To execute this script, it may be necessary to set the default database name in Neo4j.
|
||||
|
||||
In our deployments there are cases where the database is called `neo4j` (used by default) and in other cases `graph.db` (accidentally happened when we loaded the database into a new cluster).
|
||||
|
||||
In the new deployment with Helm, we set the default database name by the environment variable `NEO4J_dbms_default__database` in the Helm `values.yaml`.
|
||||
See [Docker-specific configuration settings](https://neo4j.com/docs/operations-manual/4.4/docker/ref-settings/)
|
||||
|
||||
For more information see [Database Management Commands](/neo4j/README.md#database-management-commands).
|
||||
|
||||
#### Multiple Networks Backup
|
||||
|
||||
In order to save several network backups locally, you must define the configuration names of all networks in `.env`. The template for this is `deployment/.env.dist`:
|
||||
|
||||
@ -70,9 +70,14 @@ For authentication, download the current cluster configuration file from Digital
|
||||
Set the context of the cluster by command:
|
||||
|
||||
```bash
|
||||
$ kubectl config use-context <context-name>
|
||||
kubectl config use-context <context-name>
|
||||
```
|
||||
|
||||
We seem to have two instances in our DigitalOcean cluster how we need to log into the Kubernetes Dashboard.
|
||||
It looks like it depends on the Kubernetes Dashboard version, but we are not absolutely sure.
|
||||
|
||||
#### Login with `kubeconfig` File
|
||||
|
||||
Port-forward the Kubernetes Dashboard to your local machine:
|
||||
|
||||
```bash
|
||||
@ -82,9 +87,22 @@ $ export POD_NAME=$(kubectl get pods -n kubernetes-dashboard -l "app.kubernetes.
|
||||
$ kubectl -n kubernetes-dashboard port-forward $POD_NAME 8443:8443
|
||||
```
|
||||
|
||||
### Log-In to Kubernetes Dashboard
|
||||
Access the URL in your local web browser at `https://127.0.0.1:8443/`, and log in using your Kubernetes cluster credentials – downloaded config file.
|
||||
You may encounter a certificate warning, so make sure to override it.
|
||||
|
||||
Access the URL in your local web browser at `https://127.0.0.1:8443/`, and log in using your Kubernetes cluster credentials – downloaded config file. You may encounter a certificate warning, so make sure to override it.
|
||||
#### Login with Admin Token
|
||||
|
||||
Port-forward the Kubernetes Dashboard to your local machine:
|
||||
|
||||
```bash
|
||||
# create your access token
|
||||
kubectl -n kubernetes-dashboard create token admin-user
|
||||
# forward port
|
||||
kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443
|
||||
```
|
||||
|
||||
Access the URL in your local web browser at `https://127.0.0.1:8443/`, and log in using your access token.
|
||||
You may encounter a certificate warning, so make sure to override it.
|
||||
|
||||
## Alternatives to Kubernetes Dashboard
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ and drop the `.jar` file into the `plugins` folder of the just extracted Neo4j-S
|
||||
|
||||
Then make sure to allow Apoc procedures by adding the following line to your Neo4j configuration \(`conf/neo4j.conf`\):
|
||||
|
||||
```
|
||||
```text
|
||||
dbms.security.procedures.unrestricted=apoc.*
|
||||
```
|
||||
|
||||
@ -76,6 +76,8 @@ $ docker cp <docker-image-name('neo4j')>:/var/lib/neo4j/neo4j-dump <local-folder
|
||||
|
||||
If you need a specific database name, add the option `--database=<name>` to the command `neo4j-admin dump`.
|
||||
|
||||
In our deployments there are cases where the database is called `neo4j` (used by default) and in other cases `graph.db` (accidentally happened when we loaded the database into a new cluster).
|
||||
|
||||
### Import Neo4j Dump
|
||||
|
||||
To import a dump into Neo4j running in a Docker container:
|
||||
@ -144,6 +146,23 @@ On a server with Kubernetes cluster:
|
||||
$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "yarn prod:migrate init"
|
||||
```
|
||||
|
||||
***Enter and Exit Cypher Shell***
|
||||
|
||||
```bash
|
||||
# enter the bash of Neo4j database
|
||||
$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') -- bash
|
||||
# enter Cypher-Shell to send Cypher commands
|
||||
neo4j# cypher-shell
|
||||
|
||||
# send Cypher commands
|
||||
cypher-shell# < Cypher commands >
|
||||
# exit Cypher-Shell
|
||||
cypher-shell# :exit
|
||||
|
||||
# exit bash
|
||||
neo4j# exit
|
||||
```
|
||||
|
||||
***Cypher commands to show indexes and constraints***
|
||||
|
||||
```bash
|
||||
@ -189,7 +208,12 @@ $ SHOW DEFAULT DATABASE
|
||||
$ SHOW DATABASES
|
||||
```
|
||||
|
||||
To set the default database by configuration, use `NEO4J_dbms_default__database` as an environment variable when starting Neo4j 4.4, see [Docker specific configuration settings](<https://neo4j.com/docs/operations-manual/4.4/docker/ref-settings/>).
|
||||
To set the default database by configuration, use `NEO4J_dbms_default__database` as an environment variable when starting Neo4j 4.4, see [Docker specific configuration settings](https://neo4j.com/docs/operations-manual/4.4/docker/ref-settings/).
|
||||
|
||||
If a database with this name does not exist, an empty database with this name is created and all other databases remain.
|
||||
You can switch back to an existing database without damaging it.
|
||||
|
||||
It seems to be impossible to change the name of an existing database on the fly.
|
||||
To change the name of an existing database, we need to load a dump or restore a backup under a new name in Neo4j.
|
||||
|
||||
For more information on deployment, see [Default Database Name](/deployment/deployment.md#default-database-name).
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user