From 2a5ca84995d8e1318e91f0a45c4802f9f7428da2 Mon Sep 17 00:00:00 2001 From: SolidNerd Date: Sat, 23 Apr 2016 15:05:40 +0200 Subject: [PATCH] Possibility to change the redis database number --- README.md | 1 + assets/runtime/config/gitlabhq/resque.yml | 2 +- assets/runtime/env-defaults | 1 + assets/runtime/functions | 5 +++-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b1b4632e..13b78e1e 100644 --- a/README.md +++ b/README.md @@ -831,6 +831,7 @@ Below is the complete list of available options that can be used to customize yo - **NGINX_X_FORWARDED_PROTO**: Advanced configuration option for the `proxy_set_header X-Forwarded-Proto` setting in the gitlab nginx vHost configuration. Defaults to `https` when `GITLAB_HTTPS` is `true`, else defaults to `$scheme`. - **REDIS_HOST**: The hostname of the redis server. Defaults to `localhost` - **REDIS_PORT**: The connection port of the redis server. Defaults to `6379`. +- **REDIS_DB_NUMBER**: The redis database number. Defaults to '0'. - **UNICORN_WORKERS**: The number of unicorn workers to start. Defaults to `3`. - **UNICORN_TIMEOUT**: Sets the timeout of unicorn worker processes. Defaults to `60` seconds. - **SIDEKIQ_CONCURRENCY**: The number of concurrent sidekiq jobs to run. Defaults to `25` diff --git a/assets/runtime/config/gitlabhq/resque.yml b/assets/runtime/config/gitlabhq/resque.yml index 7dc6662b..7303d570 100644 --- a/assets/runtime/config/gitlabhq/resque.yml +++ b/assets/runtime/config/gitlabhq/resque.yml @@ -1,4 +1,4 @@ # If you change this file in a Merge Request, please also create # a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests # -production: redis://{{REDIS_HOST}}:{{REDIS_PORT}} +production: redis://{{REDIS_HOST}}:{{REDIS_PORT}}/{{REDIS_DB_NUMBER}} diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index c5939b37..8a0d7a05 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -50,6 +50,7 @@ esac ## REDIS REDIS_HOST=${REDIS_HOST:-} REDIS_PORT=${REDIS_PORT:-} +REDIS_DB_NUMBER=${REDIS_DB_NUMBER:-0} ## SIDEKIQ SIDEKIQ_SHUTDOWN_TIMEOUT=${SIDEKIQ_SHUTDOWN_TIMEOUT:-4} diff --git a/assets/runtime/functions b/assets/runtime/functions index 4bd5c7d4..44def750 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -241,7 +241,7 @@ gitlab_finalize_redis_parameters() { gitlab_check_redis_connection() { timeout=60 - while ! redis-cli -h ${REDIS_HOST} -p ${REDIS_PORT} ping >/dev/null 2>&1 + while ! redis-cli -h ${REDIS_HOST} -p ${REDIS_PORT} -n ${REDIS_DB_NUMBER} ping >/dev/null 2>&1 do timeout=$(expr $timeout - 1) if [[ $timeout -eq 0 ]]; then @@ -263,7 +263,8 @@ gitlab_configure_redis() { update_template ${GITLAB_RESQUE_CONFIG} \ REDIS_HOST \ - REDIS_PORT + REDIS_PORT \ + REDIS_DB_NUMBER } gitlab_configure_gitlab_workhorse() {