From f6f506984b12e3dad224ecd4c70ddf9e01e0d6da Mon Sep 17 00:00:00 2001 From: Dmitry Afanasyev Date: Thu, 9 Mar 2023 00:54:31 +0300 Subject: [PATCH] update README.md --- README.md | 64 +++++++++++------------ delete.yml | 123 --------------------------------------------- docker-compose.yml | 30 ++++++----- 3 files changed, 48 insertions(+), 169 deletions(-) delete mode 100644 delete.yml diff --git a/README.md b/README.md index f3055b1..26ec219 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,50 @@ -# HA setup +# Fast simple cloud based on GO language -Simple docker-compose deployment to experiment with Cells v4 Clustering model. -It uses `pydio/cells:unstable` docker image, use whatever image by editing the docker-compose.yml file. +- with Redis cache +- data storage on S3 Minio +- queue broker nats -## Preparing dependencies +Simple docker-compose deployment to experiment with Cells v4. +It uses `pydio/cells` docker image, use whatever image by editing the docker-compose.yml file. -HA deployments relies on external dependencies to make Cells image fully stateless. -This sample creates the following images : MySQL, MongoDB, NATS.io, ETCD, Hashicorp Vault and Redis. +## Starting Cells -This Vault requires a manual preparation for a specific key/value store (see below) - -```sh -cd -# start all third-party services -docker-compose up -d mysql mongo nats etcd vault redis minio caddy - -# create buckets in minio -docker-compose up createbuckets - -# Create a dedicated kvstore for certificates in Vault (configured in DEV mode with a preset VAULT_TOKEN, this should not be the case in production) -docker-compose exec -e VAULT_ADDR=http://localhost:8200 -e VAULT_TOKEN=secret_vault_token vault vault secrets enable -version=2 -path=caddycerts kv +```bash +docker-compose up -d ``` -## Starting Cells Nodes +on web browser: http://localhost:8080 -```sh -# Start one node, then open https://localhost:8080 to perform the install, it will read the conf/install-conf.yaml file -docker-compose up -d cells1; docker-compose logs -f cells1 +login: admin +password: admin + +## storing data + +setup directory with env `MINIO_STORE_DATA` in .env file + +if directory created by user +```bash +sudo chown $USER:$USER /path/to/data/directory -R +sudo chmod +ugo+rw ``` -Now you can spin more cells nodes: -```sh -# Once install is finished, start other nodes -docker-compose up -d cells2 cells3; docker-compose logs -f cells2 cells3 -``` +By default it in current directory named `cells_data` + ## Caddy LoadBalancer Access -Caddy load balancer is configured in self-signed mode. -This requires adding localhost => caddy domain name to your local /etc/hosts file. - -Once started, it will monitor cells instances on /pprofs endpoint to automatically enable/disable upstreams. - -Access https://caddy:8585/ to access Cells. Enjoy! +Access https://caddy:8080/ to access Cells. Enjoy! ## Stopping cluster +```bash +docker-compose down -v +``` + ```sh # To clean everything docker-compose down -v --remove-orphan +sudo rm -rf ./cells_data or user your `MINIO_STORE_DATA` storage path ``` ## Clean jwt table @@ -57,7 +53,7 @@ docker-compose down -v --remove-orphan docker exec -i pydio_mysql mysql -u pydiouser -pcellspasswrd cells < clean-jwt.sql ``` - +- if on `docker-compose down` and next `docker-compose up` getting error with jwt token ```sql SET FOREIGN_KEY_CHECKS = 0; TRUNCATE hydra_oauth2_trusted_jwt_bearer_issuer; diff --git a/delete.yml b/delete.yml deleted file mode 100644 index 375edc0..0000000 --- a/delete.yml +++ /dev/null @@ -1,123 +0,0 @@ -version: '3.9' - -# Common variables -x-cells: &cells-common - image: pydio/cells:4.1 - restart: unless-stopped - environment: - - CELLS_WORKING_DIR=/var/cells - - CELLS_BROKER=nats://nats:4222 - - CELLS_CACHE=redis://redis:6379 - - CELLS_BIND_ADDRESS=0.0.0.0 - -volumes: - cells_data: {} - mysql_data: {} - caddy_data: {} - caddy_logs: {} - caddy_config: {} - -services: - - # MySQL DB - mysql: - image: mysql:8.0.32 - restart: unless-stopped - volumes: - - mysql_data:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=cells - - MYSQL_DATABASE=cells - - MYSQL_USER=${MYSQL_DB_USER} - - MYSQL_PASSWORD=${MYSQL_DB_PASSWORD} - command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci] - - # Mongo DB - mongo: - image: mongo:6.0.4 - restart: unless-stopped - expose: [27017] - - # Nats events broker - nats: - image: nats:2.9.15 - expose: - - 4222 - - 8222 - #for verbose, use "--http_port 8222 -V" - command: "--http_port 8222" - - - redis: - image: redis:7.0.9 - hostname: redis - expose: [6379] - - minio: - image: quay.io/minio/minio - command: server --console-address ":9001" /data - hostname: minio - environment: - MINIO_ROOT_USER: ${MINIO_ROOT_USER} - MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD} - expose: - - 9000 - ports: - - "9001:9001" - volumes: - - cells_data:/data - - createbuckets: - image: minio/mc:RELEASE.2023-02-28T00-12-59Z - depends_on: - - minio - entrypoint: > - /bin/sh -c " - /usr/bin/mc config host add myminio http://minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD}; - /usr/bin/mc rm -r --force myminio/pydiods1; - /usr/bin/mc rm -r --force myminio/personal; - /usr/bin/mc rm -r --force myminio/cellsdata; - /usr/bin/mc rm -r --force myminio/thumbs; - /usr/bin/mc rm -r --force myminio/versions; - /usr/bin/mc rm -r --force myminio/binaries; - /usr/bin/mc mb myminio/pydiods1; - /usr/bin/mc mb myminio/personal; - /usr/bin/mc mb myminio/cellsdata; - /usr/bin/mc mb myminio/thumbs; - /usr/bin/mc mb myminio/versions; - /usr/bin/mc mb myminio/binaries; - exit 0; - " - # - # CELLS MULTIPLE NODES - # cells1 overrides env and volumes to access the install YAML - # - cells1: - <<: *cells-common - hostname: cells1 - expose: [8080] - environment: - - CELLS_WORKING_DIR=/var/cells - - CELLS_BROKER=nats://nats:4222 - - CELLS_CACHE=redis://redis:6379 - - CELLS_BIND_ADDRESS=0.0.0.0 - - - CELLS_INSTALL_YAML=/pydio/config/install.yml - - INSTALL_MYSQL_DB_USER=${MYSQL_DB_USER} - - INSTALL_MYSQL_DB_PASSWORD=${MYSQL_DB_PASSWORD} - - INSTALL_MINIO_ROOT_USER=${MINIO_ROOT_USER} - - INSTALL_MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD} - volumes: - - ./conf/install-conf.yml:/pydio/config/install.yml:ro - - - # Caddy reverse proxy, exposed as self-signed on port 445 - caddy: - image: caddy:2.6.4-alpine - ports: ["8085:8085"] - restart: unless-stopped - volumes: - - ./conf/Caddyfile:/etc/caddy/Caddyfile - - caddy_logs:/var/caddy/logs - - caddy_data:/data - - caddy_config:/config \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4b5986d..5e999d6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,21 @@ version: '3.9' volumes: - cells_dir: {} - mysql_data: {} - caddy_data: {} - caddy_logs: {} - caddy_config: {} + cells_dir: + name: pydio_cells_dir + mysql_data: + name: pydio_mysql_data + caddy_data: + name: pydio_caddy_data + caddy_logs: + name: pydio_caddy_logs + caddy_config: + name: pydio_caddy_config networks: pydio-network: - name: pydio-network + name: pydio_network services: @@ -19,6 +24,7 @@ services: image: mysql:8.0.32 container_name: pydio_mysql restart: unless-stopped + expose: [3306] volumes: - mysql_data:/var/lib/mysql environment: @@ -35,7 +41,7 @@ services: image: mongo:6.0.4 container_name: pydio_mongo restart: unless-stopped - expose: [27017] + expose: ["27017"] networks: - pydio-network @@ -45,8 +51,8 @@ services: container_name: pydio_nats restart: unless-stopped expose: - - 4222 - - 8222 + - "4222" + - "8222" #for verbose, use "--http_port 8222 -V" command: "--http_port 8222" networks: @@ -57,7 +63,7 @@ services: container_name: pydio_redis hostname: redis restart: unless-stopped - expose: [6379] + expose: ["6379"] networks: - pydio-network @@ -71,11 +77,11 @@ services: MINIO_ROOT_USER: ${MINIO_ROOT_USER} MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD} expose: - - 9000 + - "9000" ports: - "9001:9001" volumes: - - ./cells_data:/data + - ${MINIO_STORE_DATA}:/data networks: - pydio-network