Correct file docker_push.sh

- Name Docker repos like on Docker Hub.
- correct readme's.
This commit is contained in:
Wolfgang Huß 2020-11-02 11:09:16 +01:00
parent da91be2136
commit 4d64dd144d
5 changed files with 37 additions and 29 deletions

View File

@ -4,10 +4,10 @@
data:
SMTP_HOST: "mailserver.human-connection"
SMTP_PORT: "25"
GRAPHQL_URI: "http://develop-backend.human-connection:4000"
NEO4J_URI: "bolt://develop-neo4j.human-connection:7687"
GRAPHQL_URI: "http://backend.human-connection:4000"
NEO4J_URI: "bolt://neo4j.human-connection:7687"
NEO4J_AUTH: "none"
CLIENT_URI: "https://nitro-staging.human-connection.org"
CLIENT_URI: "https://staging.human-connection.org"
NEO4J_apoc_import_file_enabled: "true"
NEO4J_dbms_memory_pagecache_size: "490M"
NEO4J_dbms_memory_heap_max__size: "500M"

View File

@ -29,13 +29,15 @@ database connections left and nobody can access the application.
Run the following:
```sh
kubectl --namespace=human-connection edit deployment develop-neo4j
$ kubectl --namespace=human-connection edit deployment develop-neo4j
```
Add the following to `spec.template.spec.containers`:
```
```sh
["tail", "-f", "/dev/null"]
```
and write the file which will update the deployment.
The command `tail -f /dev/null` is the equivalent of *sleep forever*. It is a
@ -51,32 +53,36 @@ file and trigger an update of the deployment.
## Create a Backup in Kubernetes
First stop your Neo4J database, see above. Then:
```sh
kubectl --namespace=human-connection get pods
$ kubectl --namespace=human-connection get pods
# Copy the ID of the pod running Neo4J.
kubectl --namespace=human-connection exec -it <POD-ID> bash
$ kubectl --namespace=human-connection exec -it <POD-ID> bash
# Once you're in the pod, dump the db to a file e.g. `/root/neo4j-backup`.
neo4j-admin dump --to=/root/neo4j-backup
exit
> neo4j-admin dump --to=/root/neo4j-backup
> exit
# Download the file from the pod to your computer.
kubectl cp human-connection/<POD-ID>:/root/neo4j-backup ./neo4j-backup
$ kubectl cp human-connection/<POD-ID>:/root/neo4j-backup ./neo4j-backup
```
Revert your changes to deployment `develop-neo4j` which will restart the database.
## Restore a Backup in Kubernetes
First stop your Neo4J database. Then:
```sh
kubectl --namespace=human-connection get pods
$ kubectl --namespace=human-connection get pods
# Copy the ID of the pod running Neo4J.
# Then upload your local backup to the pod. Note that once the pod gets deleted
# e.g. if you change the deployment, the backup file is gone with it.
kubectl cp ./neo4j-backup human-connection/<POD-ID>:/root/
kubectl --namespace=human-connection exec -it <POD-ID> bash
$ kubectl cp ./neo4j-backup human-connection/<POD-ID>:/root/
$ kubectl --namespace=human-connection exec -it <POD-ID> bash
# Once you're in the pod restore the backup and overwrite the default database
# called `graph.db` with `--force`.
# This will delete all existing data in database `graph.db`!
neo4j-admin load --from=/root/neo4j-backup --force
exit
> neo4j-admin load --from=/root/neo4j-backup --force
> exit
```
Revert your changes to deployment `develop-neo4j` which will restart the database.

View File

@ -9,16 +9,17 @@ One of the benefits of doing an online backup is that the Neo4j database does no
To use Neo4j Enterprise you must add this line to your configmap, if using, or your deployment `develop-neo4j` env.
```
```sh
NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
```
## Create a Backup in Kubernetes
```sh
# Backup the database with one command, this will get the develop-neo4j pod, ssh into it, and run the backup command
kubectl -n=human-connection exec -it $(kubectl -n=human-connection get pods | grep develop-neo4j | awk '{ print $1 }') -- neo4j-admin backup --backup-dir=/var/lib/neo4j --name=neo4j-backup
$ kubectl -n=human-connection exec -it $(kubectl -n=human-connection get pods | grep develop-neo4j | awk '{ print $1 }') -- neo4j-admin backup --backup-dir=/var/lib/neo4j --name=neo4j-backup
# Download the file from the pod to your computer.
kubectl cp human-connection/$(kubectl -n=human-connection get pods | grep develop-neo4j | awk '{ print $1 }'):/var/lib/neo4j/neo4j-backup ./neo4j-backup/
$ kubectl cp human-connection/$(kubectl -n=human-connection get pods | grep develop-neo4j | awk '{ print $1 }'):/var/lib/neo4j/neo4j-backup ./neo4j-backup/
```
You should now have a backup of the database locally. If you want, you can simulate disaster recovery by sshing into the develop-neo4j pod, deleting all data and restoring from backup
@ -26,13 +27,13 @@ You should now have a backup of the database locally. If you want, you can simul
## Disaster where database data is gone somehow
```sh
kubectl -n=human-connection exec -it $(kubectl -n=human-connection get pods | grep develop-neo4j |awk '{ print $1 }') bash
$ kubectl -n=human-connection exec -it $(kubectl -n=human-connection get pods | grep develop-neo4j |awk '{ print $1 }') bash
# Enter cypher-shell
cypher-shell
$ cypher-shell
# Delete all data
> MATCH (n) DETACH DELETE (n);
exit
> exit
```
## Restore a backup in Kubernetes
@ -42,16 +43,17 @@ Restoration must be done while the database is not running, see [our docs](https
After, you have stopped the database, and have the pod running, you can restore the database by running these commands:
```sh
kubectl --namespace=human-connection get pods
$ kubectl --namespace=human-connection get pods
# Copy the ID of the pod running Neo4J.
# Then upload your local backup to the pod. Note that once the pod gets deleted
# e.g. if you change the deployment, the backup file is gone with it.
kubectl cp ./neo4j-backup/ human-connection/<POD-ID>:/root/
kubectl --namespace=human-connection exec -it <POD-ID> bash
$ kubectl cp ./neo4j-backup/ human-connection/<POD-ID>:/root/
$ kubectl --namespace=human-connection exec -it <POD-ID> bash
# Once you're in the pod restore the backup and overwrite the default database
# called `graph.db` with `--force`.
# This will delete all existing data in database `graph.db`!
neo4j-admin restore --from=/root/neo4j-backup --force
exit
> neo4j-admin restore --from=/root/neo4j-backup --force
> exit
```
Revert your changes to deployment `develop-neo4j` which will restart the database.

View File

@ -54,13 +54,13 @@ $ velero backup create hc-backup --include-namespaces=human-connection
That should backup your persistent volumes, too. When you enter:
```
```sh
$ velero backup describe hc-backup --details
```
You should see the persistent volumes at the end of the log:
```
```sh
....
Restic Backups:

View File

@ -4,7 +4,7 @@ ROOT_DIR=$(dirname "$0")/..
VERSION=$(jq -r '.version' $ROOT_DIR/package.json)
IFS='.' read -r major minor patch <<< $VERSION
apps=(develop-webapp develop-backend neo4j maintenance)
apps=(develop-webapp develop-backend develop-neo4j develop-maintenance)
tags=($major $major.$minor $major.$minor.$patch)
# These three docker images have already been built by now: