README.md
208 lines
| 7.3 KiB
| text/x-minidsrc
|
MarkdownLexer
r1 | # RhodeCode Cluster | |||
r152 | RhodeCode Cluster is a multi-node highly-scalable setup to run RhodeCode services. | |||
It consists of Edge Router(Traefik with optional SSL) and Metrics Stack (Prometheus, Loki, Grafana) and | ||||
r1 | all its additional components in single environment using Docker. | |||
Using a docker-compose this setup creates following services for RhodeCode: | ||||
r152 | Edge-Router (Mandatory): | |||
r23 | ||||
r152 | - Traefik, Edge Router, SSL termination etc. | |||
Traefik listens to few defaults ports and handles all incomming/outgoing traffic to the stack | ||||
r23 | Core Services: | |||
r25 | ||||
r23 | - Database (defaults to PostgreSQL) | |||
r152 | Optionally can be replaced by MySQL, or own external database if needed. | |||
r23 | - Redis, acts as cache and queue exchange | |||
- ChannelStream - live websocket communications | ||||
- Elasticsearch (full text search backend) | ||||
r152 | - Nginx (static file service) proxy serving RhodeCode static files | |||
r23 | RhodeCode | |||
r25 | ||||
r152 | - RhodeCode CE/EE web app | |||
r23 | - VCSServer for GIT/SVN/HG support | |||
r152 | - SSH server for cloning over SSH | |||
r23 | - SVN webserver for HTTP support over SVN | |||
- Celery workers for asynchronous tasks | ||||
- Celery beat for automation tasks | ||||
Metrics | ||||
r25 | ||||
r23 | - Loki, logs aggregation | |||
r27 | - Grafana, metrics Dashboard | |||
- Prometheus, metrics time-series | ||||
- Statsd-exporter - statsd to Prometheus bridge | ||||
- Node-exporter - machine stats and usage | ||||
- Promtail - log scraping | ||||
r1 | ||||
r152 | ##rcstack for Linux, docker based installer | |||
r32 | ||||
r144 | To get started with RhodeCode get the new shell installer called rcstack | |||
r38 | ||||
r121 | ``` | |||
mkdir docker-rhodecode && cd docker-rhodecode | ||||
r148 | curl -L -s -o rcstack https://dls.rhodecode.com/get/master && chmod +x rcstack | |||
r144 | ./rcstack get-started | |||
r121 | ``` | |||
r1 | ||||
## Pre requisites | ||||
r23 | To Run this stack Docker engine and Docker Compose needs to be installed on the host machine. | |||
r144 | Please run `./rcstack init` to install docker using the installer, or | |||
r25 | visit docker site and install docker (min version 20.10) and docker compose: | |||
r1 | ||||
r23 | - https://docs.docker.com/engine/install/ | |||
- https://docs.docker.com/compose/install/ | ||||
r1 | ||||
r152 | If there's docker already installed, rcstack will detect that and skip docker installation | |||
r4 | ||||
r38 | # Quick install tutorial | |||
r4 | ||||
r30 | Those are step-by-step installation/run steps. | |||
r2 | ||||
r30 | create configurations / docker definitions: | |||
r144 | ./rcstack init | |||
r25 | ||||
r152 | ||||
r30 | At this point a custom file under .custom/.runtime.env was created. Adjust it if required. | |||
r152 | Few adjustments that could be done is to change the domain | |||
Start Traefik router that would handle all incoming traffic, load balance. | ||||
- IMPORTANT: A valid domain needs to be present in .custom/.runtime.env to access the RhodeCode | ||||
This can be a local entry or real domain, e.g rhodecode.local/rhodecode.yourcompany.com (pointing to the machine IP) | ||||
- IMPORTANT: router binds to some common ports 80, 443, SSH (9022), Loki (3100) if those are | ||||
not available, please adjust them inside the override docker file | ||||
r25 | ||||
r144 | ./rcstack stack router up --detach | |||
r30 | ||||
Start the database and bootstrap it | ||||
r25 | ||||
r152 | ||||
r30 | ./rcontrol stack database up --detach | |||
Start other services required | ||||
r25 | ||||
r152 | ||||
r144 | ./rcstack stack services up --detach | |||
r25 | ||||
r30 | Start RhodeCode stack | |||
r152 | ||||
r144 | ./rcstack stack rhodecode up --detach | |||
r2 | ||||
r30 | Check stack status | |||
r0 | ||||
r144 | ./rcstack status | |||
r0 | ||||
r152 | Output should look similar to this: | |||
r0 | ||||
r30 | --- | |||
r121 | CONTAINER ID IMAGE STATUS NAMES PORTS | |||
ef54fc528e3a traefik:v2.9.5 Up 2 hours rc_cluster_router-traefik-1 0.0.0.0:80->80/tcp, :::80->80/tcp | ||||
f3ea0539e8b0 rhodecode/rhodecode-ee:4.28.0 Up 2 hours (healthy) rc_cluster_apps-rhodecode-1 0.0.0.0:10020->10020/tcp, :::10020->10020/tcp | ||||
2be52ba58ffe rhodecode/rhodecode-ee:4.28.0 Up 2 hours (healthy) rc_cluster_apps-vcsserver-1 | ||||
7cd730ad3263 rhodecode/rhodecode-ee:4.28.0 Up 2 hours (healthy) rc_cluster_apps-celery-1 | ||||
dfa231342c87 rhodecode/rhodecode-ee:4.28.0 Up 2 hours (healthy) rc_cluster_apps-celery-beat-1 | ||||
d3d76ce2de96 rhodecode/rhodecode-ee:4.28.0 Up 2 hours (healthy) rc_cluster_apps-sshd-1 | ||||
daaac329414b rhodecode/rhodecode-ee:4.28.0 Up 2 hours (healthy) rc_cluster_apps-svn-1 | ||||
7b8504fb9acb nginx:1.23.2 Up 2 hours (healthy) rc_cluster_services-nginx-1 80/tcp | ||||
7279c25feb6b elasticsearch:6.8.23 Up 2 hours (healthy) rc_cluster_services-elasticsearch-1 9200/tcp, 9300/tcp | ||||
19fb93587493 redis:7.0.5 Up 2 hours (healthy) rc_cluster_services-redis-1 6379/tcp | ||||
fb77fb6496c6 channelstream/channelstream:0.7.1 Up 2 hours (healthy) rc_cluster_services-channelstream-1 8000/tcp | ||||
cb6c5c022f5b postgres:14.6 Up 2 hours (healthy) rc_cluster_services-database-1 5432/tcp | ||||
r30 | ||||
r152 | At this point you should be able to access: | |||
r30 | ||||
r152 | - RhodeCode instance at your domain, e.g rhodecode.local, the default access | |||
credentials are generated in .runtime.env | ||||
r121 | ``` | |||
r152 | RHODECODE_USER_NAME=admin | |||
RHODECODE_USER_PASS=super-secret-password | ||||
r30 | ``` | |||
r152 | - Grafana monitoring dashboard at rhodecode.local/_grafana, grafana generates default access credentials | |||
those need to be changed after first login | ||||
r121 | ``` | |||
r152 | user: admin | |||
pass: admin | ||||
r38 | ``` | |||
# Operation | ||||
r152 | ## Data structure / volumes | |||
r38 | ||||
r152 | There are 4 main volumes defined: | |||
r38 | ||||
- `/etc/rhodecode/conf` | ||||
Shared volume used for configuration files for rhodecode, vcsserver and supervisord, and some cache data | ||||
r152 | rhodecode.ini and vcsserver.ini files are located there and can be adjusted | |||
r38 | ||||
- `/var/opt/rhodecode_repo_store` | ||||
r1 | ||||
r38 | Used for main repository storage where repositories would be stored | |||
- `/var/opt/rhodecode_data` | ||||
Data dir for rhodecode cache/lock files, or user sessions (for file backend) | ||||
r0 | ||||
r1 | ## Set License for EE version | |||
r0 | ||||
r23 | In order to install EE edition a license file is required to be present. | |||
It can contain your current license, or when empty license can be applied via Web interface. | ||||
r12 | To apply it during build phase save your raw license data into a file | |||
r9 | ||||
r23 | `config/rhodecode_enterprise.license` | |||
r9 | ||||
If this file is present build phase will read it and license will be applied at creation. | ||||
This file can also be empty and license can be applied via a WEB interface after first login. | ||||
r1 | ||||
r0 | ||||
r152 | ## scaling to handle more traffic | |||
r0 | In case for bigger setups docker-compose can scale more rhodecode/vcsserver workers: | |||
r152 | Adjust the .custom/docker-compose-apps.override.yaml file and change | |||
r0 | ||||
r121 | ``` | |||
r152 | services: | |||
rhodecode: | ||||
deploy: | ||||
# set number of instances of services to be spawned on stack start | ||||
replicas: 4 | ||||
vcsserver: | ||||
deploy: | ||||
# set number of instances of services to be spawned on stack start | ||||
replicas: 6 | ||||
r0 | ``` | |||
r23 | Logging is pushed to stdout from all services. | |||
r1 | ||||
r23 | ### Upgrade procedure: | |||
r1 | ||||
r144 | - run ./rcstack self-update | |||
- run ./rcstack stack-upgrade to get upgrade instructions | ||||
r23 | ||||
r8 | ||||
r23 | With this done, you can now proceed with every step of normal source installation (Creating & building images), but instead of using | |||
just `docker-compose` command it needs to be replaced with `docker-compose -f docker-compose.yaml -f docker-compose.source.yaml` | ||||
r8 | ||||
r23 | For example to override the installer build with the source `rhodecode` based image, and also setting proper version, run: | |||
r1 | ||||
r121 | ``` | |||
r38 | RC_VERSION="4.28.0.SRC.2022.12.12.1" docker-compose -f docker-compose-apps.yaml -f docker-compose.source.yaml build --no-cache --progress=plain rhodecode | |||
r4 | ``` | |||
r1 | ||||
r23 | NOTE THAT it's recommended to keep rc_version and source_Ver the same | |||
r0 | ||||