-
Stan Hu authored
For some installations, the default 1-second Redis connect timeout may not be sufficient. Just as PostgreSQL has the ability to configure the connection timeout, add the same for Redis. Include read and write timeout options for completness. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/466271 Changelog: added
Stan Hu authoredFor some installations, the default 1-second Redis connect timeout may not be sufficient. Just as PostgreSQL has the ability to configure the connection timeout, add the same for Redis. Include read and write timeout options for completness. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/466271 Changelog: added
stage: Systems
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
Configuring Redis
DETAILS: Tier: Free, Premium, Ultimate Offering: Self-managed
Using an alternate local Redis instance
Linux package installations include Redis by default. To direct the GitLab application to your own locally running Redis instance:
-
Edit
/etc/gitlab/gitlab.rb
:# Disable the bundled Redis redis['enable'] = false # Redis via TCP gitlab_rails['redis_host'] = '127.0.0.1' gitlab_rails['redis_port'] = 6379 # OR Redis via Unix domain sockets gitlab_rails['redis_socket'] = '/tmp/redis.sock' # defaults to /var/opt/gitlab/redis/redis.socket # Password to Authenticate to alternate local Redis if required gitlab_rails['redis_password'] = '<redis_password>'
-
Reconfigure GitLab for the changes to take effect:
sudo gitlab-ctl reconfigure
Making the bundled Redis reachable via TCP
Use the following settings if you want to make the Redis instance managed by the Linux package reachable via TCP:
-
Edit
/etc/gitlab/gitlab.rb
:redis['port'] = 6379 redis['bind'] = '127.0.0.1' redis['password'] = 'redis-password-goes-here'
-
Save the file and reconfigure GitLab for the changes to take effect:
sudo gitlab-ctl reconfigure
Setting up a Redis-only server using the Linux package
If you'd like to set up Redis in a separate server than the GitLab application, you can use the bundled Redis from a Linux package installation.
Running with multiple Redis instances
Redis Sentinel
See https://docs.gitlab.com/ee/administration/redis/replication_and_failover.html.
Using Redis in a failover setup
See https://docs.gitlab.com/ee/administration/redis/replication_and_failover.html.
Using Google Cloud Memorystore
Google Cloud Memorystore does not support the Redis CLIENT
command.
By default, Sidekiq will attempt to set the CLIENT
for debugging
purposes. This can be disabled via the following configuration setting:
gitlab_rails['redis_enable_client'] = false