2019-09-30 21:07:59 +05:30
---
type: reference
---
2019-09-04 21:01:54 +05:30
# Configuring a Monitoring node for Scaling and High Availability
2020-06-23 00:09:42 +05:30
> [Introduced](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/3786) in GitLab 12.0.
2019-09-04 21:01:54 +05:30
2019-09-30 21:07:59 +05:30
You can configure a Prometheus node to monitor GitLab.
2020-05-24 23:13:21 +05:30
## Standalone Monitoring node using Omnibus GitLab
2019-09-04 21:01:54 +05:30
2020-05-24 23:13:21 +05:30
The Omnibus GitLab package can be used to configure a standalone Monitoring node running [Prometheus ](../monitoring/prometheus/index.md ) and [Grafana ](../monitoring/performance/grafana_configuration.md ).
The monitoring node is not highly available. See [Scaling and High Availability ](../reference_architectures/index.md )
2019-09-04 21:01:54 +05:30
for an overview of GitLab scaling and high availability options.
The steps below are the minimum necessary to configure a Monitoring node running Prometheus and Grafana with
Omnibus:
1. SSH into the Monitoring node.
2019-10-12 21:52:04 +05:30
1. [Download/install ](https://about.gitlab.com/install/ ) the Omnibus GitLab
2019-09-04 21:01:54 +05:30
package you want using **steps 1 and 2** from the GitLab downloads page.
- Do not complete any other steps on the download page.
2020-06-23 00:09:42 +05:30
1. Make sure to collect [`CONSUL_SERVER_NODES` ](../postgresql/replication_and_failover.md#consul-information ), which are the IP addresses or DNS records of the Consul server nodes, for the next step. Note they are presented as `Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z`
2019-09-30 21:07:59 +05:30
2019-09-04 21:01:54 +05:30
1. Edit `/etc/gitlab/gitlab.rb` and add the contents:
2019-09-30 21:07:59 +05:30
```ruby
external_url 'http://gitlab.example.com'
# Enable Prometheus
prometheus['enable'] = true
prometheus['listen_address'] = '0.0.0.0:9090'
prometheus['monitor_kubernetes'] = false
2019-12-21 20:55:43 +05:30
# Enable Login form
grafana['disable_login_form'] = false
2019-09-30 21:07:59 +05:30
# Enable Grafana
grafana['enable'] = true
grafana['admin_password'] = 'toomanysecrets'
# Enable service discovery for Prometheus
consul['enable'] = true
consul['monitoring_service_discovery'] = true
# Replace placeholders
# Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z
# with the addresses of the Consul server nodes
consul['configuration'] = {
retry_join: %w(Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z),
}
# Disable all other services
gitlab_rails['auto_migrate'] = false
alertmanager['enable'] = false
gitaly['enable'] = false
2019-12-04 20:38:33 +05:30
gitlab_exporter['enable'] = false
2019-09-30 21:07:59 +05:30
gitlab_workhorse['enable'] = false
nginx['enable'] = true
postgres_exporter['enable'] = false
postgresql['enable'] = false
redis['enable'] = false
redis_exporter['enable'] = false
sidekiq['enable'] = false
2020-05-24 23:13:21 +05:30
puma['enable'] = false
2019-09-30 21:07:59 +05:30
node_exporter['enable'] = false
2019-12-21 20:55:43 +05:30
gitlab_exporter['enable'] = false
2019-09-30 21:07:59 +05:30
```
2019-09-04 21:01:54 +05:30
1. Run `sudo gitlab-ctl reconfigure` to compile the configuration.
2020-07-28 23:09:34 +05:30
The next step is to tell all the other nodes where the monitoring node is:
1. Edit `/etc/gitlab/gitlab.rb` , and add, or find and uncomment the following line:
```ruby
gitlab_rails['prometheus_address'] = '10.0.0.1:9090'
```
Where `10.0.0.1:9090` is the IP address and port of the Prometheus node.
1. Save the file and [reconfigure GitLab ](../restart_gitlab.md#omnibus-gitlab-reconfigure ) for the changes to
take effect.
2019-09-04 21:01:54 +05:30
## Migrating to Service Discovery
Once monitoring using Service Discovery is enabled with `consul['monitoring_service_discovery'] = true` ,
2020-04-08 14:13:33 +05:30
ensure that `prometheus['scrape_configs']` is not set in `/etc/gitlab/gitlab.rb` . Setting both
`consul['monitoring_service_discovery'] = true` and `prometheus['scrape_configs']` in `/etc/gitlab/gitlab.rb`
2019-09-04 21:01:54 +05:30
will result in errors.
2019-09-30 21:07:59 +05:30
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X` .
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->