Skip to content
Snippets Groups Projects
redis.md 11.11 KiB
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:

  1. 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>'
  2. 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:

  1. Edit /etc/gitlab/gitlab.rb:

    redis['port'] = 6379
    redis['bind'] = '127.0.0.1'
    redis['password'] = 'redis-password-goes-here'
  2. 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

See https://docs.gitlab.com/ee/administration/redis/replication_and_failover.html#running-multiple-redis-clusters.

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