2014-01-28 10:10:25 -05:00
# GitLab Architecture Overview
2013-11-25 04:47:55 -05:00
2014-04-24 18:48:22 -04:00
## Software delivery
2013-11-25 04:47:55 -05:00
2019-09-18 10:02:45 -04:00
There are two software distributions of GitLab: the open source [Community Edition ](https://gitlab.com/gitlab-org/gitlab-foss/ ) (CE), and the open core [Enterprise Edition ](https://gitlab.com/gitlab-org/gitlab/ ) (EE). GitLab is available under [different subscriptions ](https://about.gitlab.com/pricing/ ).
2013-11-25 04:47:55 -05:00
2018-02-22 11:13:35 -05:00
New versions of GitLab are released in stable branches and the master branch is for bleeding edge development.
2020-02-06 01:08:52 -05:00
For information, see the [GitLab Release Process ](https://gitlab.com/gitlab-org/release/docs/-/tree/master#gitlab-release-process ).
2014-02-04 08:49:06 -05:00
2020-02-06 01:08:52 -05:00
Both EE and CE require some add-on components called GitLab Shell and Gitaly. These components are available from the [GitLab Shell ](https://gitlab.com/gitlab-org/gitlab-shell/-/tree/master ) and [Gitaly ](https://gitlab.com/gitlab-org/gitaly/-/tree/master ) repositories respectively. New versions are usually tags but staying on the master branch will give you the latest stable version. New releases are generally around the same time as GitLab CE releases with exception for informal security updates deemed critical.
2013-11-25 04:47:55 -05:00
2019-05-17 15:17:29 -04:00
## Components
2014-11-26 12:51:12 -05:00
2019-10-11 02:06:27 -04:00
A typical install of GitLab will be on GNU/Linux. It uses NGINX or Apache as a web front end to proxypass the Unicorn web server. By default, communication between Unicorn and the front end is via a Unix domain socket but forwarding requests via TCP is also supported. The web front end accesses `/home/git/gitlab/public` bypassing the Unicorn server to serve static pages, uploads (e.g. avatar images or attachments), and precompiled assets. GitLab serves web pages and the [GitLab API ](../api/README.md ) using the Unicorn web server. It uses Sidekiq as a job queue which, in turn, uses Redis as a non-persistent database backend for job information, meta data, and incoming jobs.
2019-05-17 15:17:29 -04:00
2019-08-27 04:44:07 -04:00
We also support deploying GitLab on Kubernetes using our [GitLab Helm chart ](https://docs.gitlab.com/charts/ ).
2019-05-17 15:17:29 -04:00
2019-08-27 04:44:07 -04:00
The GitLab web app uses PostgreSQL for persistent database information (e.g. users, permissions, issues, other meta data). GitLab stores the bare Git repositories it serves in `/home/git/repositories` by default. It also keeps default branch and hook information with the bare repository.
2019-05-17 15:17:29 -04:00
2019-08-27 04:44:07 -04:00
When serving repositories over HTTP/HTTPS GitLab utilizes the GitLab API to resolve authorization and access as well as serving Git objects.
2019-05-17 15:17:29 -04:00
2019-10-11 02:06:27 -04:00
The add-on component GitLab Shell serves repositories over SSH. It manages the SSH keys within `/home/git/.ssh/authorized_keys` which should not be manually edited. GitLab Shell accesses the bare repositories through Gitaly to serve Git objects and communicates with Redis to submit jobs to Sidekiq for GitLab to process. GitLab Shell queries the GitLab API to determine authorization and access.
2019-05-17 15:17:29 -04:00
2019-08-27 04:44:07 -04:00
Gitaly executes Git operations from GitLab Shell and the GitLab web app, and provides an API to the GitLab web app to get attributes from Git (e.g. title, branches, tags, other meta data), and to get blobs (e.g. diffs, commits, files).
2019-05-17 15:17:29 -04:00
2020-02-06 01:08:52 -05:00
You may also be interested in the [production architecture of GitLab.com ](https://about.gitlab.com/handbook/engineering/infrastructure/production/architecture/ ).
2019-05-17 15:17:29 -04:00
2019-06-11 14:46:14 -04:00
### Simplified Component Overview
This is a simplified architecture diagram that can be used to
understand GitLab's architecture.
A complete architecture diagram is available in our
[component diagram ](#component-diagram ) below.
![Simplified Component Overview ](img/architecture_simplified.png )
2019-07-02 04:50:00 -04:00
<!--
2019-06-11 14:46:14 -04:00
To update this diagram, GitLab team members can edit this source file:
https://docs.google.com/drawings/d/1fBzAyklyveF-i-2q-OHUIqDkYfjjxC4mq5shwKSZHLs/edit.
-->
2019-05-17 15:17:29 -04:00
### Component diagram
```mermaid
graph TB
HTTP[HTTP/HTTPS] -- TCP 80, 443 --> NGINX[NGINX]
SSH -- TCP 22 --> GitLabShell[GitLab Shell]
SMTP[SMTP Gateway]
Geo[GitLab Geo Node] -- TCP 22, 80, 443 --> NGINX
GitLabShell --TCP 8080 -->Unicorn["Unicorn (GitLab Rails)"]
2020-02-05 07:09:15 -05:00
GitLabShell --> Praefect
2019-05-17 15:17:29 -04:00
GitLabShell --> Redis
Unicorn --> PgBouncer[PgBouncer]
Unicorn --> Redis
2020-02-05 07:09:15 -05:00
Unicorn --> Praefect
2019-09-04 15:47:18 -04:00
Sidekiq --> Redis
Sidekiq --> PgBouncer
2020-02-05 07:09:15 -05:00
Sidekiq --> Praefect
2019-05-17 15:17:29 -04:00
GitLabWorkhorse[GitLab Workhorse] --> Unicorn
GitLabWorkhorse --> Redis
2020-02-05 07:09:15 -05:00
GitLabWorkhorse --> Praefect
Praefect --> Gitaly
2019-05-17 15:17:29 -04:00
NGINX --> GitLabWorkhorse
NGINX -- TCP 8090 --> GitLabPages[GitLab Pages]
NGINX --> Grafana[Grafana]
Grafana -- TCP 9090 --> Prometheus[Prometheus]
Prometheus -- TCP 80, 443 --> Unicorn
RedisExporter[Redis Exporter] --> Redis
Prometheus -- TCP 9121 --> RedisExporter
PostgreSQLExporter[PostgreSQL Exporter] --> PostgreSQL
PgBouncerExporter[PgBouncer Exporter] --> PgBouncer
Prometheus -- TCP 9187 --> PostgreSQLExporter
Prometheus -- TCP 9100 --> NodeExporter[Node Exporter]
2019-09-18 10:02:45 -04:00
Prometheus -- TCP 9168 --> GitLabExporter[GitLab Exporter]
2019-05-17 15:17:29 -04:00
Prometheus -- TCP 9127 --> PgBouncerExporter
2019-09-18 10:02:45 -04:00
GitLabExporter --> PostgreSQL
GitLabExporter --> GitLabShell
GitLabExporter --> Sidekiq
2019-05-17 15:17:29 -04:00
PgBouncer --> Consul
PostgreSQL --> Consul
PgBouncer --> PostgreSQL
NGINX --> Registry
Unicorn --> Registry
NGINX --> Mattermost
Mattermost --- Unicorn
Prometheus --> Alertmanager
Migrations --> PostgreSQL
Runner -- TCP 443 --> NGINX
2019-06-28 06:33:58 -04:00
Unicorn -- TCP 9200 --> Elasticsearch
Sidekiq -- TCP 9200 --> Elasticsearch
2019-05-17 15:17:29 -04:00
Sidekiq -- TCP 80, 443 --> Sentry
Unicorn -- TCP 80, 443 --> Sentry
Sidekiq -- UDP 6831 --> Jaeger
Unicorn -- UDP 6831 --> Jaeger
Gitaly -- UDP 6831 --> Jaeger
GitLabShell -- UDP 6831 --> Jaeger
GitLabWorkhorse -- UDP 6831 --> Jaeger
Alertmanager -- TCP 25 --> SMTP
Sidekiq -- TCP 25 --> SMTP
Unicorn -- TCP 25 --> SMTP
Unicorn -- TCP 369 --> LDAP
Sidekiq -- TCP 369 --> LDAP
Unicorn -- TCP 443 --> ObjectStorage["Object Storage"]
Sidekiq -- TCP 443 --> ObjectStorage
GitLabWorkhorse -- TCP 443 --> ObjectStorage
Registry -- TCP 443 --> ObjectStorage
Geo -- TCP 5432 --> PostgreSQL
```
### Component legend
2019-06-30 23:36:23 -04:00
- ✅ - Installed by default
- ⚙ - Requires additional configuration, or GitLab Managed Apps
- ⤓ - Manual installation required
- ❌ - Not supported or no instructions available
2019-12-12 10:08:41 -05:00
- N/A - Not applicable
2019-05-17 15:17:29 -04:00
Component statuses are linked to configuration documentation for each component.
### Component list
2019-05-19 19:27:22 -04:00
| Component | Description | [Omnibus GitLab ](https://docs.gitlab.com/omnibus/ ) | [GitLab chart ](https://docs.gitlab.com/charts/ ) | [Minikube Minimal ](https://docs.gitlab.com/charts/development/minikube/#deploying-gitlab-with-minimal-settings ) | [GitLab.com ](https://gitlab.com ) | [Source ](../install/installation.md ) | [GDK ](https://gitlab.com/gitlab-org/gitlab-development-kit ) | CE/EE |
2019-05-24 12:16:51 -04:00
| --------- | ----------- |:--------------------:|:------------------:|:-----:|:--------:|:--------:|:-------:|:-------:|
| [NGINX ](#nginx ) | Routes requests to appropriate components, terminates SSL | [✅][nginx-omnibus] | [✅][nginx-charts] | [⚙][nginx-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/infrastructure/production-architecture/#service-architecture ) | [⤓][nginx-source] | ❌ | CE & EE |
2019-05-19 19:27:22 -04:00
| [Unicorn (GitLab Rails) ](#unicorn ) | Handles requests for the web interface and API | [✅][unicorn-omnibus] | [✅][unicorn-charts] | [✅][unicorn-charts] | [✅ ](../user/gitlab_com/index.md#unicorn ) | [⚙][unicorn-source] | [✅][gitlab-yml] | CE & EE |
| [Sidekiq ](#sidekiq ) | Background jobs processor | [✅][sidekiq-omnibus] | [✅][sidekiq-charts] | [✅ ](https://docs.gitlab.com/charts/charts/gitlab/sidekiq/index.html ) | [✅ ](../user/gitlab_com/index.md#sidekiq ) | [✅][gitlab-yml] | [✅][gitlab-yml] | CE & EE |
2019-08-27 04:44:07 -04:00
| [Gitaly ](#gitaly ) | Git RPC service for handling all Git calls made by GitLab | [✅][gitaly-omnibus] | [✅][gitaly-charts] | [✅][gitaly-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/infrastructure/production-architecture/#service-architecture ) | [⚙][gitaly-source] | ✅ | CE & EE |
2020-02-05 07:09:15 -05:00
| [Praefect ](#praefect ) | A transparant proxy between any Git client and Gitaly storage nodes. | [✅][gitaly-omnibus] | [❌][gitaly-charts] | [❌][gitaly-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/infrastructure/production-architecture/#service-architecture ) | [⚙][praefect-source] | ✅ | CE & EE |
2019-05-24 12:16:51 -04:00
| [GitLab Workhorse ](#gitlab-workhorse ) | Smart reverse proxy, handles large HTTP requests | [✅][workhorse-omnibus] | [✅][workhorse-charts] | [✅][workhorse-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/infrastructure/production-architecture/#service-architecture ) | [⚙][workhorse-source] | ✅ | CE & EE |
| [GitLab Shell ](#gitlab-shell ) | Handles `git` over SSH sessions | [✅][shell-omnibus] | [✅][shell-charts] | [✅][shell-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/infrastructure/production-architecture/#service-architecture ) | [⚙][shell-source] | [✅][gitlab-yml] | CE & EE |
2019-05-19 19:27:22 -04:00
| [GitLab Pages ](#gitlab-pages ) | Hosts static websites | [⚙][pages-omnibus] | [❌][pages-charts] | [❌][pages-charts] | [✅ ](../user/gitlab_com/index.md#gitlab-pages ) | [⚙][pages-source] | [⚙][pages-gdk] | CE & EE |
2020-01-31 22:09:04 -05:00
| [Registry ](#registry ) | Container registry, allows pushing and pulling of images | [⚙][registry-omnibus] | [✅][registry-charts] | [✅][registry-charts] | [✅ ](../user/packages/container_registry/index.md#build-and-push-images-using-gitlab-cicd ) | [⤓][registry-source] | [⚙][registry-gdk] | CE & EE |
2019-05-24 12:16:51 -04:00
| [Redis ](#redis ) | Caching service | [✅][redis-omnibus] | [✅][redis-omnibus] | [✅][redis-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/infrastructure/production-architecture/#service-architecture ) | [⤓][redis-source] | ✅ | CE & EE |
2019-05-19 19:27:22 -04:00
| [PostgreSQL ](#postgresql ) | Database | [✅][postgres-omnibus] | [✅][postgres-charts] | [✅][postgres-charts] | [✅ ](../user/gitlab_com/index.md#postgresql ) | [⤓][postgres-source] | ✅ | CE & EE |
2019-05-24 12:16:51 -04:00
| [PgBouncer ](#pgbouncer ) | Database connection pooling, failover | [⚙][pgbouncer-omnibus] | [❌][pgbouncer-charts] | [❌][pgbouncer-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/infrastructure/production-architecture/#database-architecture ) | ❌ | ❌ | EE Only |
2019-05-19 19:27:22 -04:00
| [Consul ](#consul ) | Database node discovery, failover | [⚙][consul-omnibus] | [❌][consul-charts] | [❌][consul-charts] | [✅ ](../user/gitlab_com/index.md#consul ) | ❌ | ❌ | EE Only |
| [GitLab self-monitoring: Prometheus ](#prometheus ) | Time-series database, metrics collection, and query service | [✅][prometheus-omnibus] | [✅][prometheus-charts] | [⚙][prometheus-charts] | [✅ ](../user/gitlab_com/index.md#prometheus ) | ❌ | ❌ | CE & EE |
2019-06-09 03:07:18 -04:00
| [GitLab self-monitoring: Alertmanager ](#alertmanager ) | Deduplicates, groups, and routes alerts from Prometheus | [⚙][alertmanager-omnibus] | [✅][alertmanager-charts] | [⚙][alertmanager-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/monitoring/ ) | ❌ | ❌ | CE & EE |
2019-06-20 18:12:35 -04:00
| [GitLab self-monitoring: Grafana ](#grafana ) | Metrics dashboard | [✅][grafana-omnibus] | [⤓][grafana-charts] | [⤓][grafana-charts] | [✅ ](https://dashboards.gitlab.com/d/RZmbBr7mk/gitlab-triage?refresh=30s ) | ❌ | ❌ | CE & EE |
2019-09-16 14:06:05 -04:00
| [GitLab self-monitoring: Sentry ](#sentry ) | Track errors generated by the GitLab instance | [⤓][sentry-omnibus] | [❌][sentry-charts] | [❌][sentry-charts] | [✅ ](https://about.gitlab.com/handbook/support/workflows/500_errors.html#searching-sentry ) | [⤓][gitlab-yml] | [⤓][gitlab-yml] | CE & EE |
2019-05-24 12:16:51 -04:00
| [GitLab self-monitoring: Jaeger ](#jaeger ) | View traces generated by the GitLab instance | [❌][jaeger-omnibus] | [❌][jaeger-charts] | [❌][jaeger-charts] | [❌ ](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4104 ) | [⤓][jaeger-source] | [⚙][jaeger-gdk] | CE & EE |
| [Redis Exporter ](#redis-exporter ) | Prometheus endpoint with Redis metrics | [✅][redis-exporter-omnibus] | [✅][redis-exporter-charts] | [✅][redis-exporter-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/monitoring/ ) | ❌ | ❌ | CE & EE |
| [Postgres Exporter ](#postgres-exporter ) | Prometheus endpoint with PostgreSQL metrics | [✅][postgres-exporter-omnibus] | [✅][postgres-exporter-charts] | [✅][postgres-exporter-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/monitoring/ ) | ❌ | ❌ | CE & EE |
| [PgBouncer Exporter ](#pgbouncer-exporter ) | Prometheus endpoint with PgBouncer metrics | [⚙][pgbouncer-exporter-omnibus] | [❌][pgbouncer-exporter-charts] | [❌][pgbouncer-exporter-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/monitoring/ ) | ❌ | ❌ | CE & EE |
2019-09-18 10:02:45 -04:00
| [GitLab Exporter ](#gitlab-exporter ) | Generates a variety of GitLab metrics | [✅][gitlab-exporter-omnibus] | [✅][gitlab-exporter-charts] | [✅][gitlab-exporter-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/monitoring/ ) | ❌ | ❌ | CE & EE |
2019-12-12 10:08:41 -05:00
| [Node Exporter ](#node-exporter ) | Prometheus endpoint with system metrics | [✅][node-exporter-omnibus] | [N/A][node-exporter-charts] | [N/A][node-exporter-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/monitoring/ ) | ❌ | ❌ | CE & EE |
2019-06-19 03:11:24 -04:00
| [Mattermost ](#mattermost ) | Open-source Slack alternative | [⚙][mattermost-omnibus] | [⤓][mattermost-charts] | [⤓][mattermost-charts] | [⤓ ](../user/project/integrations/mattermost.md ) | ❌ | ❌ | CE & EE |
2019-05-24 12:16:51 -04:00
| [MinIO ](#minio ) | Object storage service | [⤓][minio-omnibus] | [✅][minio-charts] | [✅][minio-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/infrastructure/production-architecture/#storage-architecture ) | ❌ | [⚙][minio-gdk] | CE & EE |
2019-05-19 19:27:22 -04:00
| [Runner ](#gitlab-runner ) | Executes GitLab CI jobs | [⤓][runner-omnibus] | [✅][runner-charts] | [⚙][runner-charts] | [✅ ](../user/gitlab_com/index.md#shared-runners ) | [⚙][runner-source] | [⚙][runner-gdk] | CE & EE |
2019-05-24 12:16:51 -04:00
| [Database Migrations ](#database-migrations ) | Database migrations | [✅][database-migrations-omnibus] | [✅][database-migrations-charts] | [✅][database-migrations-charts] | ✅ | [⚙][database-migrations-source] | ✅ | CE & EE |
| [Certificate Management ](#certificate-management ) | TLS Settings, Let's Encrypt | [✅][certificate-management-omnibus] | [✅][certificate-management-charts] | [⚙][certificate-management-charts] | [✅ ](https://about.gitlab.com/handbook/engineering/infrastructure/production-architecture/#secrets-management ) | [⚙][certificate-management-source] | [⚙][certificate-management-gdk] | CE & EE |
2019-05-27 13:33:31 -04:00
| [GitLab Geo Node ](#gitlab-geo ) | Geographically distributed GitLab nodes | [⚙][geo-omnibus] | [❌][geo-charts] | [❌][geo-charts] | ✅ | ❌ | [⚙][geo-gdk] | EE Only |
2019-05-24 12:16:51 -04:00
| [LDAP Authentication ](#ldap-authentication ) | Authenticate users against centralized LDAP directory | [⤓][ldap-omnibus] | [⤓][ldap-charts] | [⤓][ldap-charts] | [❌ ](https://about.gitlab.com/pricing/#gitlab-com ) | [⤓][gitlab-yml] | [⤓][ldap-gdk] | CE & EE |
2019-05-19 19:27:22 -04:00
| [Outbound email (SMTP) ](#outbound-email ) | Send email messages to users | [⤓][outbound-email-omnibus] | [⤓][outbound-email-charts] | [⤓][outbound-email-charts] | [✅ ](../user/gitlab_com/index.md#mail-configuration ) | [⤓][gitlab-yml] | [⤓][gitlab-yml] | CE & EE |
| [Inbound email (SMTP) ](#inbound-email ) | Receive messages to update issues | [⤓][inbound-email-omnibus] | [⤓][inbound-email-charts] | [⤓][inbound-email-charts] | [✅ ](../user/gitlab_com/index.md#mail-configuration ) | [⤓][gitlab-yml] | [⤓][gitlab-yml] | CE & EE |
2019-06-28 06:33:58 -04:00
| [Elasticsearch ](#elasticsearch ) | Improved search within GitLab | [⤓][elasticsearch-omnibus] | [⤓][elasticsearch-charts] | [⤓][elasticsearch-charts] | [❌ ](https://gitlab.com/groups/gitlab-org/-/epics/153 ) | [⤓][elasticsearch-source] | [⤓][elasticsearch-gdk] | EE Only |
2019-05-24 12:16:51 -04:00
| [Sentry integration ](#sentry ) | Error tracking for deployed apps | [⤓][sentry-integration] | [⤓][sentry-integration] | [⤓][sentry-integration] | [⤓][sentry-integration] | [⤓][sentry-integration] | [⤓][sentry-integration] | CE & EE |
| [Jaeger integration ](#jaeger ) | Distributed tracing for deployed apps | [⤓][jaeger-integration] | [⤓][jaeger-integration] | [⤓][jaeger-integration] | [⤓][jaeger-integration] | [⤓][jaeger-integration] | [⤓][jaeger-integration] | EE Only |
2019-09-27 08:06:07 -04:00
| [GitLab Managed Apps ](#gitlab-managed-apps ) | Deploy [Helm ](https://helm.sh/docs/ ), [Ingress ](https://kubernetes.io/docs/concepts/services-networking/ingress/ ), [Cert-Manager ](https://docs.cert-manager.io/en/latest/ ), [Prometheus ](https://prometheus.io/docs/introduction/overview/ ), a [Runner ](https://docs.gitlab.com/runner/ ), [JupyterHub ](https://jupyter.org ), [Knative ](https://cloud.google.com/knative/ ) to a cluster | [⤓][managed-k8s-apps] | [⤓][managed-k8s-apps] | [⤓][managed-k8s-apps] | [⤓][managed-k8s-apps] | [⤓][managed-k8s-apps] | [⤓][managed-k8s-apps] | CE & EE |
2019-05-17 15:17:29 -04:00
### Component details
This document is designed to be consumed by systems administrators and GitLab Support Engineers who want to understand more about the internals of GitLab and how they work together.
2014-11-26 12:51:12 -05:00
2018-11-16 10:06:22 -05:00
When deployed, GitLab should be considered the amalgamation of the below processes. When troubleshooting or debugging, be as specific as possible as to which component you are referencing. That should increase clarity and reduce confusion.
2014-11-26 12:51:12 -05:00
2019-05-17 15:17:29 -04:00
**Layers**
2019-05-15 15:34:48 -04:00
GitLab can be considered to have two layers from a process perspective:
- **Monitoring**: Anything from this layer is not required to deliver GitLab the application, but will allow administrators more insight into their infrastructure and what the service as a whole is doing.
- **Core**: Any process that is vital for the delivery of GitLab as a platform. If any of these processes halt there will be a GitLab outage. For the Core layer, you can further divide into:
- **Processors**: These processes are responsible for actually performing operations and presenting the service.
- **Data**: These services store/expose structured data for the GitLab service.
2019-05-17 15:17:29 -04:00
#### Alertmanager
2014-11-26 12:51:12 -05:00
2019-05-17 15:17:29 -04:00
- [Project page ](https://github.com/prometheus/alertmanager/blob/master/README.md )
- Configuration: [Omnibus][alertmanager-omnibus], [Charts][alertmanager-charts]
- Layer: Monitoring
2019-05-24 12:16:51 -04:00
- Process: `alertmanager`
2014-11-26 12:51:12 -05:00
2019-09-18 10:02:45 -04:00
[Alert manager ](https://prometheus.io/docs/alerting/alertmanager/ ) is a tool provided by Prometheus that _"handles alerts sent by client applications such as the Prometheus server. It takes care of deduplicating, grouping, and routing them to the correct receiver integration such as email, PagerDuty, or OpsGenie. It also takes care of silencing and inhibition of alerts."_ You can read more in [issue #45740 ](https://gitlab.com/gitlab-org/gitlab-foss/issues/45740 ) about what we will be alerting on.
2014-11-26 12:51:12 -05:00
2019-05-17 15:17:29 -04:00
#### Certificate management
2014-11-26 12:51:12 -05:00
2019-05-17 15:17:29 -04:00
- Project page: [Omnibus ](https://github.com/certbot/certbot/blob/master/README.rst ), [Charts ](https://github.com/jetstack/cert-manager/blob/master/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][certificate-management-omnibus], [Charts][certificate-management-charts], [Source][certificate-management-source], [GDK][certificate-management-gdk]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Processor)
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Consul
- [Project page ](https://github.com/hashicorp/consul/blob/master/README.md )
- Configuration: [Omnibus][consul-omnibus], [Charts][consul-charts]
- Layer: Core Service (Data)
Consul is a tool for service discovery and configuration. Consul is distributed, highly available, and extremely scalable.
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Database migrations
2018-11-16 10:06:22 -05:00
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][registry-omnibus], [Charts][registry-charts], [Source][database-migrations-source]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Data)
#### Elasticsearch
- [Project page ](https://github.com/elastic/elasticsearch/blob/master/README.textile )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][elasticsearch-omnibus], [Charts][elasticsearch-charts], [Source][elasticsearch-source], [GDK][elasticsearch-gdk]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Data)
Elasticsearch is a distributed RESTful search engine built for the cloud.
#### Gitaly
- [Project page ](https://gitlab.com/gitlab-org/gitaly/blob/master/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][gitaly-omnibus], [Charts][gitaly-charts], [Source][gitaly-source]
2018-11-16 10:06:22 -05:00
- Layer: Core Service (Data)
2019-05-24 12:16:51 -04:00
- Process: `gitaly`
2018-11-16 10:06:22 -05:00
2019-05-15 15:34:48 -04:00
Gitaly is a service designed by GitLab to remove our need for NFS for Git storage in distributed deployments of GitLab (think GitLab.com or High Availability Deployments). As of 11.3.0, this service handles all Git level access in GitLab. You can read more about the project [in the project's readme ](https://gitlab.com/gitlab-org/gitaly ).
2018-11-16 10:06:22 -05:00
2020-02-05 07:09:15 -05:00
#### Praefect
- [Project page ](https://gitlab.com/gitlab-org/gitaly/blob/master/README.md )
- Configuration: [Omnibus][gitaly-omnibus], [Source][praefect-source]
- Layer: Core Service (Data)
- Process: `praefect`
Praefect is a transparent proxy between each Git client and the Gitaly coordinating the replication of
repository updates to secondairy nodes.
2019-08-27 04:44:07 -04:00
#### GitLab Geo
2019-05-17 15:17:29 -04:00
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][geo-omnibus], [Charts][geo-charts], [GDK][geo-gdk]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Processor)
2018-11-16 10:06:22 -05:00
2019-10-11 02:06:27 -04:00
#### GitLab Exporter
2019-05-17 15:17:29 -04:00
2019-09-18 10:02:45 -04:00
- [Project page ](https://gitlab.com/gitlab-org/gitlab-exporter )
- Configuration: [Omnibus][gitlab-exporter-omnibus], [Charts][gitlab-exporter-charts]
2019-02-18 04:36:13 -05:00
- Layer: Monitoring
2019-09-18 10:02:45 -04:00
- Process: `gitlab-exporter`
2018-11-16 10:06:22 -05:00
2019-09-18 10:02:45 -04:00
GitLab Exporter is a process designed in house that allows us to export metrics about GitLab application internals to Prometheus. You can read more [in the project's readme ](https://gitlab.com/gitlab-org/gitlab-exporter ).
2018-11-16 10:06:22 -05:00
2019-08-27 04:44:07 -04:00
#### GitLab Pages
2018-11-16 10:06:22 -05:00
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][pages-omnibus], [Charts][pages-charts], [Source][pages-source], [GDK][pages-gdk]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Processor)
GitLab Pages is a feature that allows you to publish static websites directly from a repository in GitLab.
You can use it either for personal or business websites, such as portfolios, documentation, manifestos, and business presentations. You can also attribute any license to your content.
2019-08-27 04:44:07 -04:00
#### GitLab Runner
2019-05-17 15:17:29 -04:00
- [Project page ](https://gitlab.com/gitlab-org/gitlab-runner/blob/master/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][runner-omnibus], [Charts][runner-charts], [Source][runner-source], [GDK][runner-gdk]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Processor)
GitLab Runner runs tests and sends the results to GitLab.
GitLab CI is the open-source continuous integration service included with GitLab that coordinates the testing. The old name of this project was GitLab CI Multi Runner but please use "GitLab Runner" (without CI) from now on.
2019-08-27 04:44:07 -04:00
#### GitLab Shell
2019-05-17 15:17:29 -04:00
- [Project page ](https://gitlab.com/gitlab-org/gitlab-shell/blob/master/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][shell-omnibus], [Charts][shell-charts], [Source][shell-source], [GDK][gitlab-yml]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Processor)
2019-10-11 02:06:27 -04:00
[GitLab Shell ](https://gitlab.com/gitlab-org/gitlab-shell ) is a program designed at GitLab to handle SSH-based `git` sessions, and modifies the list of authorized keys. GitLab Shell is not a Unix shell nor a replacement for Bash or Zsh.
2019-05-17 15:17:29 -04:00
2019-08-27 04:44:07 -04:00
#### GitLab Workhorse
2019-05-17 15:17:29 -04:00
- [Project page ](https://gitlab.com/gitlab-org/gitlab-workhorse/blob/master/README.md )
2019-07-04 18:46:12 -04:00
- Configuration: [Omnibus][workhorse-omnibus], [Charts][workhorse-charts], [Source][workhorse-source]
2018-11-16 10:06:22 -05:00
- Layer: Core Service (Processor)
2019-05-24 12:16:51 -04:00
- Process: `gitlab-workhorse`
2018-11-16 10:06:22 -05:00
2019-10-16 11:06:17 -04:00
[GitLab Workhorse ](https://gitlab.com/gitlab-org/gitlab-workhorse ) is a program designed at GitLab to help alleviate pressure from Unicorn. You can read more about the [historical reasons for developing ](https://about.gitlab.com/blog/2016/04/12/a-brief-history-of-gitlab-workhorse/ ). It's designed to act as a smart reverse proxy to help speed up GitLab as a whole.
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Grafana
- [Project page ](https://github.com/grafana/grafana/blob/master/README.md )
- Configuration: [Omnibus][grafana-omnibus], [Charts][grafana-charts]
- Layer: Monitoring
Grafana is an open source, feature rich metrics dashboard and graph editor for Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.
#### Jaeger
- [Project page ](https://github.com/jaegertracing/jaeger/blob/master/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][jaeger-omnibus], [Charts][jaeger-charts], [Source][jaeger-source], [GDK][jaeger-gdk]
2019-05-17 15:17:29 -04:00
- Layer: Monitoring
Jaeger, inspired by Dapper and OpenZipkin, is a distributed tracing system. It can be used for monitoring microservices-based distributed systems.
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Logrotate
- [Project page ](https://github.com/logrotate/logrotate/blob/master/README.md )
- Configuration: [Omnibus ](https://docs.gitlab.com/omnibus/settings/logs.html#logrotate )
2018-11-16 10:06:22 -05:00
- Layer: Core Service
2019-05-24 12:16:51 -04:00
- Process: `logrotate`
2018-11-16 10:06:22 -05:00
2019-05-15 15:34:48 -04:00
GitLab is comprised of a large number of services that all log. We started bundling our own logrotate as of 7.4 to make sure we were logging responsibly. This is just a packaged version of the common open source offering.
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Mattermost
- [Project page ](https://github.com/mattermost/mattermost-server/blob/master/README.md )
- Configuration: [Omnibus][mattermost-omnibus], [Charts][mattermost-charts]
- Layer: Core Service (Processor)
2019-07-02 04:50:00 -04:00
Mattermost is an open source, private cloud, Slack-alternative from < https: / / mattermost . com > .
2019-05-17 15:17:29 -04:00
#### MinIO
- [Project page ](https://github.com/minio/minio/blob/master/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][minio-omnibus], [Charts][minio-charts], [GDK][minio-gdk]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Data)
MinIO is an object storage server released under Apache License v2.0. It is compatible with Amazon S3 cloud storage service. It is best suited for storing unstructured data such as photos, videos, log files, backups and container / VM images. Size of an object can range from a few KBs to a maximum of 5TB.
#### NGINX
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
- Project page: [Omnibus ](https://github.com/nginx/nginx ), [Charts ](https://github.com/kubernetes/ingress-nginx/blob/master/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][nginx-omnibus], [Charts][nginx-charts], [Source][nginx-source]
2018-11-16 10:06:22 -05:00
- Layer: Core Service (Processor)
2019-05-24 12:16:51 -04:00
- Process: `nginx`
2018-11-16 10:06:22 -05:00
2019-10-11 02:06:27 -04:00
NGINX has an Ingress port for all HTTP requests and routes them to the appropriate sub-systems within GitLab. We are bundling an unmodified version of the popular open source webserver.
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Node Exporter
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
- [Project page ](https://github.com/prometheus/node_exporter/blob/master/README.md )
- Configuration: [Omnibus][node-exporter-omnibus], [Charts][node-exporter-charts]
2018-11-16 10:06:22 -05:00
- Layer: Monitoring
2019-05-24 12:16:51 -04:00
- Process: `node-exporter`
2018-11-16 10:06:22 -05:00
2019-05-15 15:34:48 -04:00
[Node Exporter ](https://github.com/prometheus/node_exporter ) is a Prometheus tool that gives us metrics on the underlying machine (think CPU/Disk/Load). It's just a packaged version of the common open source offering from the Prometheus project.
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### PgBouncer
- [Project page ](https://github.com/pgbouncer/pgbouncer/blob/master/README.md )
- Configuration: [Omnibus][pgbouncer-omnibus], [Charts][pgbouncer-charts]
- Layer: Core Service (Data)
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
Lightweight connection pooler for PostgreSQL.
#### PgBouncer Exporter
- [Project page ](https://github.com/stanhu/pgbouncer_exporter/blob/master/README.md )
- Configuration: [Omnibus][pgbouncer-exporter-omnibus], [Charts][pgbouncer-exporter-charts]
2018-11-16 10:06:22 -05:00
- Layer: Monitoring
2019-05-17 15:17:29 -04:00
Prometheus exporter for PgBouncer. Exports metrics at 9127/metrics.
2018-11-16 10:06:22 -05:00
2019-10-11 02:06:27 -04:00
#### PostgreSQL
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
- [Project page ](https://github.com/postgres/postgres/blob/master/README )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][postgres-omnibus], [Charts][postgres-charts], [Source][postgres-source]
2018-11-16 10:06:22 -05:00
- Layer: Core Service (Data)
2019-05-24 12:16:51 -04:00
- Process: `postgresql`
2018-11-16 10:06:22 -05:00
2019-02-18 04:36:13 -05:00
GitLab packages the popular Database to provide storage for Application meta data and user information.
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Postgres Exporter
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
- [Project page ](https://github.com/wrouesnel/postgres_exporter/blob/master/README.md )
- Configuration: [Omnibus][postgres-exporter-omnibus], [Charts][postgres-exporter-charts]
- Layer: Monitoring
2019-05-24 12:16:51 -04:00
- Process: `postgres-exporter`
2019-05-17 15:17:29 -04:00
[Postgres-exporter ](https://github.com/wrouesnel/postgres_exporter ) is the community provided Prometheus exporter that will deliver data about Postgres to Prometheus for use in Grafana Dashboards.
#### Prometheus
- [Project page ](https://github.com/prometheus/prometheus/blob/master/README.md )
- Configuration: [Omnibus][prometheus-omnibus], [Charts][prometheus-charts]
2018-11-16 10:06:22 -05:00
- Layer: Monitoring
2019-05-24 12:16:51 -04:00
- Process: `prometheus`
2018-11-16 10:06:22 -05:00
Prometheus is a time-series tool that helps GitLab administrators expose metrics about the individual processes used to provide GitLab the service.
2019-05-17 15:17:29 -04:00
#### Redis
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
- [Project page ](https://github.com/antirez/redis/blob/unstable/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][redis-omnibus], [Charts][redis-charts], [Source][redis-source]
2018-11-16 10:06:22 -05:00
- Layer: Core Service (Data)
2019-05-24 12:16:51 -04:00
- Process: `redis`
2018-11-16 10:06:22 -05:00
2019-02-18 04:36:13 -05:00
Redis is packaged to provide a place to store:
2018-11-16 10:06:22 -05:00
- session data
- temporary cache information
2019-05-15 15:34:48 -04:00
- background job queues
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Redis Exporter
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
- [Project page ](https://github.com/oliver006/redis_exporter/blob/master/README.md )
- Configuration: [Omnibus][redis-exporter-omnibus], [Charts][redis-exporter-charts]
2018-11-16 10:06:22 -05:00
- Layer: Monitoring
2019-05-24 12:16:51 -04:00
- Process: `redis-exporter`
2018-11-16 10:06:22 -05:00
2019-05-15 15:34:48 -04:00
[Redis Exporter ](https://github.com/oliver006/redis_exporter ) is designed to give specific metrics about the Redis process to Prometheus so that we can graph these metrics in Grafana.
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Registry
- [Project page ](https://github.com/docker/distribution/blob/master/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][registry-omnibus], [Charts][registry-charts], [Source][registry-source], [GDK][registry-gdk]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Processor)
The registry is what users use to store their own Docker images. The bundled
2019-10-11 02:06:27 -04:00
registry uses NGINX as a load balancer and GitLab as an authentication manager.
2019-05-17 15:17:29 -04:00
Whenever a client requests to pull or push an image from the registry, it will
return a `401` response along with a header detailing where to get an
authentication token, in this case the GitLab instance. The client will then
request a pull or push auth token from GitLab and retry the original request
to the registry. Learn more about [token authentication ](https://docs.docker.com/registry/spec/auth/token/ ).
An external registry can also be configured to use GitLab as an auth endpoint.
#### Sentry
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
- [Project page ](https://github.com/getsentry/sentry/blob/master/README.rst )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][sentry-omnibus], [Charts][sentry-charts], [Source][gitlab-yml], [GDK][gitlab-yml]
2019-05-17 15:17:29 -04:00
- Layer: Monitoring
Sentry fundamentally is a service that helps you monitor and fix crashes in realtime. The server is in Python, but it contains a full API for sending events from any language, in any application.
#### Sidekiq
- [Project page ](https://github.com/mperham/sidekiq/blob/master/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][sidekiq-omnibus], [Charts][sidekiq-charts], [Source][gitlab-yml], [GDK][gitlab-yml]
2018-11-16 10:06:22 -05:00
- Layer: Core Service (Processor)
2019-05-24 12:16:51 -04:00
- Process: `sidekiq`
2018-11-16 10:06:22 -05:00
2019-10-11 02:06:27 -04:00
Sidekiq is a Ruby background job processor that pulls jobs from the Redis queue and processes them. Background jobs allow GitLab to provide a faster request/response cycle by moving work into the background.
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Unicorn
2018-11-16 10:06:22 -05:00
2019-09-18 10:02:45 -04:00
- [Project page ](https://gitlab.com/gitlab-org/gitlab/blob/master/README.md )
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][unicorn-omnibus], [Charts][unicorn-charts], [Source][unicorn-source], [GDK][gitlab-yml]
2018-11-16 10:06:22 -05:00
- Layer: Core Service (Processor)
2019-05-24 12:16:51 -04:00
- Process: `unicorn`
2018-11-16 10:06:22 -05:00
2019-02-18 04:36:13 -05:00
[Unicorn ](https://bogomips.org/unicorn/ ) is a Ruby application server that is used to run the core Rails Application that provides the user facing features in GitLab. Often process output you will see this as `bundle` or `config.ru` depending on the GitLab version.
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### LDAP Authentication
2019-05-15 15:34:48 -04:00
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][ldap-omnibus], [Charts][ldap-charts], [Source][gitlab-yml], [GDK][ldap-gdk]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Processor)
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Outbound Email
2018-11-16 10:06:22 -05:00
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][outbound-email-omnibus], [Charts][outbound-email-charts], [Source][gitlab-yml], [GDK][gitlab-yml]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Processor)
2018-11-16 10:06:22 -05:00
2019-05-17 15:17:29 -04:00
#### Inbound Email
2018-11-16 10:06:22 -05:00
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][inbound-email-omnibus], [Charts][inbound-email-charts], [Source][gitlab-yml], [GDK][gitlab-yml]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Processor)
2018-11-16 10:06:22 -05:00
2019-05-29 15:21:43 -04:00
#### GitLab Managed Apps
2019-03-19 04:13:59 -04:00
2019-05-24 12:16:51 -04:00
- Configuration: [Omnibus][managed-k8s-apps], [Charts][managed-k8s-apps], [Source][managed-k8s-apps], [GDK][managed-k8s-apps]
2019-05-17 15:17:29 -04:00
- Layer: Core Service (Processor)
2019-03-19 04:13:59 -04:00
2019-05-19 19:27:22 -04:00
GitLab provides [GitLab Managed Apps ](../user/project/clusters/index.md#installing-applications ), a one-click install for various applications which can be added directly to your configured cluster. These applications are needed for Review Apps and deployments when using Auto DevOps. You can install them after you create a cluster.
2019-03-19 04:13:59 -04:00
2018-11-16 10:06:22 -05:00
## GitLab by Request Type
GitLab provides two "interfaces" for end users to access the service:
- Web HTTP Requests (Viewing the UI/API)
- Git HTTP/SSH Requests (Pushing/Pulling Git Data)
It's important to understand the distinction as some processes are used in both and others are exclusive to a specific request type.
### GitLab Web HTTP Request Cycle
2019-05-15 15:34:48 -04:00
When making a request to an HTTP Endpoint (think `/users/sign_in` ) the request will take the following path through the GitLab Service:
2018-11-16 10:06:22 -05:00
2019-10-11 02:06:27 -04:00
- NGINX - Acts as our first line reverse proxy.
2019-08-27 04:44:07 -04:00
- GitLab Workhorse - This determines if it needs to go to the Rails application or somewhere else to reduce load on Unicorn.
2019-10-11 02:06:27 -04:00
- Unicorn - Since this is a web request, and it needs to access the application it will go to Unicorn.
2019-02-23 07:49:55 -05:00
- Postgres/Gitaly/Redis - Depending on the type of request, it may hit these services to store or retrieve data.
2018-11-16 10:06:22 -05:00
### GitLab Git Request Cycle
Below we describe the different pathing that HTTP vs. SSH Git requests will take. There is some overlap with the Web Request Cycle but also some differences.
### Web Request (80/443)
2019-07-09 03:16:17 -04:00
2018-11-16 10:06:22 -05:00
TODO
### SSH Request (22)
2019-07-09 03:16:17 -04:00
2018-11-16 10:06:22 -05:00
TODO
2014-11-26 12:51:12 -05:00
2014-04-24 18:48:22 -04:00
## System Layout
2013-11-25 04:47:55 -05:00
2019-08-27 04:44:07 -04:00
When referring to `~git` in the pictures it means the home directory of the Git user which is typically `/home/git` .
2013-11-25 04:47:55 -05:00
2014-04-24 18:48:22 -04:00
GitLab is primarily installed within the `/home/git` user home directory as `git` user. Within the home directory is where the gitlabhq server software resides as well as the repositories (though the repository location is configurable).
The bare repositories are located in `/home/git/repositories` . GitLab is a ruby on rails application so the particulars of the inner workings can be learned by studying how a ruby on rails application works.
2019-08-27 04:44:07 -04:00
To serve repositories over SSH there's an add-on application called GitLab Shell which is installed in `/home/git/gitlab-shell` .
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
### Installation Folder Summary
To summarize here's the [directory structure of the `git` user home directory ](../install/structure.md ).
2014-01-29 09:17:58 -05:00
2014-04-24 18:48:22 -04:00
### Processes
2014-01-28 10:10:25 -05:00
2020-01-30 10:09:15 -05:00
```shell
2019-07-09 03:16:17 -04:00
ps aux | grep '^git'
```
2014-01-28 10:10:25 -05:00
2019-08-12 06:29:10 -04:00
GitLab has several components to operate. It requires a persistent database
2019-10-11 02:06:27 -04:00
(PostgreSQL) and Redis database, and uses Apache httpd or NGINX to proxypass
2019-08-12 06:29:10 -04:00
Unicorn. All these components should run as different system users to GitLab
(e.g., `postgres` , `redis` and `www-data` , instead of `git` ).
As the `git` user it starts Sidekiq and Unicorn (a simple ruby HTTP server
running on port `8080` by default). Under the GitLab user there are normally 4
processes: `unicorn_rails master` (1 process), `unicorn_rails worker`
(2 processes), `sidekiq` (1 process).
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
### Repository access
2014-01-28 10:10:25 -05:00
2019-08-27 04:44:07 -04:00
Repositories get accessed via HTTP or SSH. HTTP cloning/push/pull utilizes the GitLab API and SSH cloning is handled by GitLab Shell (previously explained).
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
## Troubleshooting
2014-01-28 10:10:25 -05:00
2014-02-04 08:49:06 -05:00
See the README for more information.
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
### Init scripts of the services
2014-01-28 10:10:25 -05:00
2019-08-27 04:44:07 -04:00
The GitLab init script starts and stops Unicorn and Sidekiq:
2014-01-28 10:10:25 -05:00
```
2014-08-04 16:32:41 -04:00
/etc/init.d/gitlab
2014-01-28 10:10:25 -05:00
Usage: service gitlab {start|stop|restart|reload|status}
2014-02-04 08:49:06 -05:00
```
2014-01-28 10:10:25 -05:00
2019-08-27 04:44:07 -04:00
Redis (key-value store/non-persistent database):
2014-02-04 08:49:06 -05:00
```
2014-08-04 16:32:41 -04:00
/etc/init.d/redis
2014-01-28 10:10:25 -05:00
Usage: /etc/init.d/redis {start|stop|status|restart|condrestart|try-restart}
2014-02-04 08:49:06 -05:00
```
2019-08-27 04:44:07 -04:00
SSH daemon:
2014-01-28 10:10:25 -05:00
2014-02-04 08:49:06 -05:00
```
2014-08-04 16:32:41 -04:00
/etc/init.d/sshd
2014-01-28 10:10:25 -05:00
Usage: /etc/init.d/sshd {start|stop|restart|reload|force-reload|condrestart|try-restart|status}
```
2019-08-27 04:44:07 -04:00
Web server (one of the following):
2014-01-28 10:10:25 -05:00
```
2014-08-04 16:32:41 -04:00
/etc/init.d/httpd
2014-01-28 10:10:25 -05:00
Usage: httpd {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}
$ /etc/init.d/nginx
Usage: nginx {start|stop|restart|reload|force-reload|status|configtest}
```
2019-08-27 04:44:07 -04:00
Persistent database:
2014-01-28 10:10:25 -05:00
```
$ /etc/init.d/postgresql
Usage: /etc/init.d/postgresql {start|stop|restart|reload|force-reload|status} [version ..]
```
2014-04-24 18:48:22 -04:00
### Log locations of the services
2014-01-28 10:10:25 -05:00
2019-08-27 04:44:07 -04:00
gitlabhq (includes Unicorn and Sidekiq logs):
2014-01-28 10:10:25 -05:00
2019-08-08 16:30:37 -04:00
- `/home/git/gitlab/log/` contains `application.log` , `production.log` , `sidekiq.log` , `unicorn.stdout.log` , `git_json.log` and `unicorn.stderr.log` normally.
2014-01-28 10:10:25 -05:00
2019-08-27 04:44:07 -04:00
GitLab Shell:
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
- `/home/git/gitlab-shell/gitlab-shell.log`
2014-01-28 10:10:25 -05:00
2019-08-27 04:44:07 -04:00
SSH:
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
- `/var/log/auth.log` auth log (on Ubuntu).
- `/var/log/secure` auth log (on RHEL).
2014-01-28 10:10:25 -05:00
2019-10-11 02:06:27 -04:00
NGINX:
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
- `/var/log/nginx/` contains error and access logs.
2014-01-28 10:10:25 -05:00
2019-08-27 04:44:07 -04:00
Apache httpd:
2014-01-28 10:10:25 -05:00
2015-11-16 05:01:26 -05:00
- [Explanation of Apache logs ](https://httpd.apache.org/docs/2.2/logs.html ).
2014-04-24 18:48:22 -04:00
- `/var/log/apache2/` contains error and output logs (on Ubuntu).
- `/var/log/httpd/` contains error and output logs (on RHEL).
2014-01-28 10:10:25 -05:00
2019-08-27 04:44:07 -04:00
Redis:
2014-01-28 10:10:25 -05:00
2015-02-03 18:18:40 -05:00
- `/var/log/redis/redis.log` there are also log-rotated logs there.
2014-01-28 10:10:25 -05:00
2019-08-27 04:44:07 -04:00
PostgreSQL:
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
- `/var/log/postgresql/*`
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
### GitLab specific config files
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
GitLab has configuration files located in `/home/git/gitlab/config/*` . Commonly referenced config files include:
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
- `gitlab.yml` - GitLab configuration.
- `unicorn.rb` - Unicorn web server settings.
- `database.yml` - Database connection settings.
2014-01-28 10:10:25 -05:00
2019-08-27 04:44:07 -04:00
GitLab Shell has a configuration file at `/home/git/gitlab-shell/config.yml` .
2014-01-28 10:10:25 -05:00
2014-04-24 18:48:22 -04:00
### Maintenance Tasks
2014-01-28 10:10:25 -05:00
2019-09-18 14:06:14 -04:00
[GitLab ](https://gitlab.com/gitlab-org/gitlab/tree/master ) provides rake tasks with which you see version information and run a quick check on your configuration to ensure it is configured properly within the application. See [maintenance rake tasks ](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/raketasks/maintenance.md ).
2014-02-10 07:59:30 -05:00
In a nutshell, do the following:
2014-01-28 10:10:25 -05:00
```
sudo -i -u git
cd gitlab
bundle exec rake gitlab:env:info RAILS_ENV=production
bundle exec rake gitlab:check RAILS_ENV=production
```
2014-04-24 18:48:22 -04:00
Note: It is recommended to log into the `git` user using `sudo -i -u git` or `sudo su - git` . While the sudo commands provided by gitlabhq work in Ubuntu they do not always work in RHEL.
2017-06-27 20:47:54 -04:00
## GitLab.com
2019-12-18 10:08:03 -05:00
We've also detailed [our architecture of GitLab.com ](https://about.gitlab.com/handbook/engineering/infrastructure/production/architecture/ ) but this is probably over the top unless you have millions of users.
2019-05-17 15:17:29 -04:00
[alertmanager-omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
[alertmanager-charts]: https://github.com/helm/charts/tree/master/stable/prometheus
2019-05-19 19:27:22 -04:00
[nginx-omnibus]: https://docs.gitlab.com/omnibus/settings/
[nginx-charts]: https://docs.gitlab.com/charts/charts/nginx/
[nginx-source]: ../install/installation.md#9-nginx
2019-05-17 15:17:29 -04:00
[unicorn-omnibus]: https://docs.gitlab.com/omnibus/settings/unicorn.html
2019-05-19 19:27:22 -04:00
[unicorn-charts]: https://docs.gitlab.com/charts/charts/gitlab/unicorn/
[unicorn-source]: ../install/installation.md#configure-it
2019-09-18 14:06:14 -04:00
[gitlab-yml]: https://gitlab.com/gitlab-org/gitlab/blob/master/config/gitlab.yml.example
2019-05-17 15:17:29 -04:00
[sidekiq-omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
2019-05-19 19:27:22 -04:00
[sidekiq-charts]: https://docs.gitlab.com/charts/charts/gitlab/sidekiq/
[gitaly-omnibus]: ../administration/gitaly/index.md
[gitaly-charts]: https://docs.gitlab.com/charts/charts/gitlab/gitaly/
[gitaly-source]: ../install/installation.md#install-gitaly
2020-02-05 07:09:15 -05:00
[praefect-source]: ../install/installation.md#install-gitaly
2019-05-17 15:17:29 -04:00
[workhorse-omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
2019-05-19 19:27:22 -04:00
[workhorse-charts]: https://docs.gitlab.com/charts/charts/gitlab/unicorn/
[workhorse-source]: ../install/installation.md#install-gitlab-workhorse
2019-05-17 15:17:29 -04:00
[shell-omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
2019-05-19 19:27:22 -04:00
[shell-charts]: https://docs.gitlab.com/charts/charts/gitlab/gitlab-shell/
[shell-source]: ../install/installation.md#install-gitlab-shell
[pages-omnibus]: ../administration/pages/index.md
2019-09-03 00:36:02 -04:00
[pages-charts]: https://gitlab.com/gitlab-org/charts/gitlab/issues/37
2019-05-19 19:27:22 -04:00
[pages-source]: ../install/installation.md#install-gitlab-pages
2019-05-24 12:16:51 -04:00
[pages-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/pages.md
2019-09-17 08:06:48 -04:00
[registry-omnibus]: ../administration/packages/container_registry.md#container-registry-domain-configuration
2019-05-19 19:27:22 -04:00
[registry-charts]: https://docs.gitlab.com/charts/charts/registry/
2019-09-17 08:06:48 -04:00
[registry-source]: ../administration/packages/container_registry.md#enable-the-container-registry
2019-05-24 12:16:51 -04:00
[registry-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/registry.md
2019-05-17 15:17:29 -04:00
[redis-omnibus]: https://docs.gitlab.com/omnibus/settings/redis.html
2019-05-19 19:27:22 -04:00
[redis-charts]: https://docs.gitlab.com/charts/charts/redis/
[redis-source]: ../install/installation.md#7-redis
2019-05-17 15:17:29 -04:00
[postgres-omnibus]: https://docs.gitlab.com/omnibus/settings/database.html
[postgres-charts]: https://github.com/helm/charts/tree/master/stable/postgresql
2019-05-19 19:27:22 -04:00
[postgres-source]: ../install/installation.md#6-database
[pgbouncer-omnibus]: ../administration/high_availability/pgbouncer.md
2019-05-17 15:17:29 -04:00
[pgbouncer-charts]: https://docs.gitlab.com/charts/installation/deployment.html#postgresql
2019-05-19 19:27:22 -04:00
[consul-omnibus]: ../administration/high_availability/consul.md
2019-05-17 15:17:29 -04:00
[consul-charts]: https://docs.gitlab.com/charts/installation/deployment.html#postgresql
2019-05-19 19:27:22 -04:00
[prometheus-omnibus]: ../administration/monitoring/prometheus/index.md
2019-05-17 15:17:29 -04:00
[prometheus-charts]: https://github.com/helm/charts/tree/master/stable/prometheus
2019-05-19 19:27:22 -04:00
[grafana-omnibus]: ../administration/monitoring/performance/grafana_configuration.md
2019-05-17 15:17:29 -04:00
[grafana-charts]: https://github.com/helm/charts/tree/master/stable/grafana
[sentry-omnibus]: https://docs.gitlab.com/omnibus/settings/configuration.html#error-reporting-and-logging-with-sentry
2019-09-03 00:36:02 -04:00
[sentry-charts]: https://gitlab.com/gitlab-org/charts/gitlab/issues/1319
2019-05-17 15:17:29 -04:00
[jaeger-omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4104
2019-09-03 00:36:02 -04:00
[jaeger-charts]: https://gitlab.com/gitlab-org/charts/gitlab/issues/1320
2019-05-19 19:27:22 -04:00
[jaeger-source]: ../development/distributed_tracing.md#enabling-distributed-tracing
[jaeger-gdk]: ../development/distributed_tracing.html#using-jaeger-in-the-gitlab-development-kit
[redis-exporter-omnibus]: ../administration/monitoring/prometheus/redis_exporter.md
[redis-exporter-charts]: https://docs.gitlab.com/charts/charts/redis/
[postgres-exporter-omnibus]: ../administration/monitoring/prometheus/postgres_exporter.md
2019-05-17 15:17:29 -04:00
[postgres-exporter-charts]: https://github.com/helm/charts/tree/master/stable/postgresql
2019-05-19 19:27:22 -04:00
[pgbouncer-exporter-omnibus]: ../administration/monitoring/prometheus/pgbouncer_exporter.md
2019-05-17 15:17:29 -04:00
[pgbouncer-exporter-charts]: https://docs.gitlab.com/charts/installation/deployment.html#postgresql
2019-09-18 10:02:45 -04:00
[gitlab-exporter-omnibus]: ../administration/monitoring/prometheus/gitlab_exporter.md
[gitlab-exporter-charts]: https://docs.gitlab.com/charts/charts/gitlab/gitlab-exporter/index.html
2019-05-19 19:27:22 -04:00
[node-exporter-omnibus]: ../administration/monitoring/prometheus/node_exporter.md
2019-09-03 00:36:02 -04:00
[node-exporter-charts]: https://gitlab.com/gitlab-org/charts/gitlab/issues/1332
2019-05-17 15:17:29 -04:00
[mattermost-omnibus]: https://docs.gitlab.com/omnibus/gitlab-mattermost/
[mattermost-charts]: https://docs.mattermost.com/install/install-mmte-helm-gitlab-helm.html
[minio-omnibus]: https://min.io/download
2019-05-19 19:27:22 -04:00
[minio-charts]: https://docs.gitlab.com/charts/charts/minio/
2019-05-24 12:16:51 -04:00
[minio-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/object_storage.md
2019-05-17 15:17:29 -04:00
[runner-omnibus]: https://docs.gitlab.com/runner/
[runner-charts]: https://docs.gitlab.com/runner/install/kubernetes.html
2019-05-24 12:16:51 -04:00
[runner-source]: https://docs.gitlab.com/runner/
[runner-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/runner.md
2019-05-17 15:17:29 -04:00
[database-migrations-omnibus]: https://docs.gitlab.com/omnibus/settings/database.html#disabling-automatic-database-migration
2019-05-19 19:27:22 -04:00
[database-migrations-charts]: https://docs.gitlab.com/charts/charts/gitlab/migrations/
2019-06-19 09:10:07 -04:00
[database-migrations-source]: ../update/upgrading_from_source.md#13-install-libs-migrations-etc
2019-05-17 15:17:29 -04:00
[certificate-management-omnibus]: https://docs.gitlab.com/omnibus/settings/ssl.html
[certificate-management-charts]: https://docs.gitlab.com/charts/installation/tls.html
2019-05-19 19:27:22 -04:00
[certificate-management-source]: ../install/installation.md#using-https
2019-05-24 12:16:51 -04:00
[certificate-management-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/https.md
2019-05-19 19:27:22 -04:00
[geo-omnibus]: ../administration/geo/replication/index.md#setup-instructions
2019-09-03 00:36:02 -04:00
[geo-charts]: https://gitlab.com/gitlab-org/charts/gitlab/issues/8
2019-05-24 12:16:51 -04:00
[geo-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/geo.md
2019-05-19 19:27:22 -04:00
[ldap-omnibus]: ../administration/auth/ldap.md
2019-05-17 15:17:29 -04:00
[ldap-charts]: https://docs.gitlab.com/charts/charts/globals.html#ldap
2019-05-24 12:16:51 -04:00
[ldap-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/ldap.md
2019-05-17 15:17:29 -04:00
[outbound-email-omnibus]: https://docs.gitlab.com/omnibus/settings/smtp.html
[outbound-email-charts]: https://docs.gitlab.com/charts/installation/command-line-options.html#outgoing-email-configuration
2019-05-19 19:27:22 -04:00
[inbound-email-omnibus]: ../administration/incoming_email.md
2019-05-17 15:17:29 -04:00
[inbound-email-charts]: https://docs.gitlab.com/charts/installation/command-line-options.html#incoming-email-configuration
2019-05-19 19:27:22 -04:00
[elasticsearch-omnibus]: ../integration/elasticsearch.md
[elasticsearch-charts]: ../integration/elasticsearch.md
[elasticsearch-source]: ../integration/elasticsearch.md
2019-05-24 12:16:51 -04:00
[elasticsearch-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/elasticsearch.md
2019-05-19 19:27:22 -04:00
[sentry-integration]: ../user/project/operations/error_tracking.md
[jaeger-integration]: ../user/project/operations/tracing.md
[managed-k8s-apps]: ../user/project/clusters/index.md#installing-applications