“noauth authentication required”azure缓存出现gitlab错误

db2dz4w8  于 2021-06-09  发布在  Redis
关注(0)|答案(1)|浏览(390)

我已经为redis创建了一个azure缓存,我正在尝试将它用作gitlab的外部redis。
我的 gitlab.rb 这是:


# external_url "https://ci.example.com"

nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/gitlab/ssl/ci.example.com.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/ci.example.com.key"

### The duration in seconds to keep backups before they are allowed to be deleted

gitlab_rails['backup_keep_time'] = 604800

### External postgres settings

postgresql['enable'] = false
gitlab_rails['db_adapter'] = "postgresql"
gitlab_rails['db_encoding'] = "unicode"
gitlab_rails['db_database'] = "cisomething"

# username string for AWS

# gitlab_rails['db_username'] = "gitlab"

# username string for Azure

gitlab_rails['db_username'] = "gitlab@ci-something.postgres.database.azure.com"
gitlab_rails['db_password'] = "really long password"
gitlab_rails['db_host'] = "ci-something.postgres.database.azure.com"
gitlab_rails['db_port'] = 5432
gitlab_rails['auto_migrate'] = false

### External redis settings

redis['enable'] = false
gitlab_rails['redis_host'] = "ci.redis.cache.windows.net"
gitlab_rails['redis_port'] = 6379
gitlab_rails['redis_password'] = "azure-redis-primary-access-key"

### Whitelist VPC cidr for access to health checks

gitlab_rails['monitoring_whitelist'] = ['XX.XXX.X.X/24']

### Default Theme

gitlab_rails['gitlab_default_theme'] = 2

### Enable or disable automatic database migrations

gitlab_rails['auto_migrate'] = false

### GitLab email server settings

... other settings here

我可以通过
redis-cli redis-cli -h ci.redis.cache.windows.net -p 6379 -a azure-redis-primary-access-key 执行命令。
当我执行 gitlab-ctl tail 我看到这个错误:

==> /var/log/gitlab/gitlab-workhorse/current <==
{"error":"keywatcher: pubsub receive: NOAUTH Authentication required.","level":"error","msg":"unknown error","time":"2020-02-21T10:26:08Z"}
{"address":"ci.redis.cache.windows.net","level":"info","msg":"redis: dialing","scheme":"redis","time":"2020-02-21T10:26:08Z"}
{"error":"keywatcher: pubsub receive: NOAUTH Authentication required.","level":"error","msg":"unknown error","time":"2020-02-21T10:26:08Z"}
{"address":"ci.redis.cache.windows.net","level":"info","msg":"redis: dialing","scheme":"redis","time":"2020-02-21T10:26:08Z"}
{"error":"keywatcher: pubsub receive: NOAUTH Authentication required.","level":"error","msg":"unknown error","time":"2020-02-21T10:26:08Z"}
{"address":"ci.redis.cache.windows.net","level":"info","msg":"redis: dialing","scheme":"redis","time":"2020-02-21T10:26:08Z"}
{"error":"keywatcher: pubsub receive: NOAUTH Authentication required.","level":"error","msg":"unknown error","time":"2020-02-21T10:26:08Z"}
{"address":"ci.redis.cache.windows.net","level":"info","msg":"redis: dialing","scheme":"redis","time":"2020-02-21T10:26:08Z"}

我在网上搜索了一下,但找不到解决这个问题的方法。

System information
System:     Ubuntu 16.04
Current User:   git
Using RVM:  no
Ruby Version:   2.6.5p114
Gem Version:    2.7.10
Bundler Version:1.17.3
Rake Version:   12.3.3
Redis Version:  5.0.7
Git Version:    2.24.1
Sidekiq Version:5.2.7

GitLab information
Version:    12.7.6
Revision:   61654d25b20
Directory:  /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 9.5.20,
flseospp

flseospp1#

所以,我想出来了。
供将来参考。 gitlab.rb ```

External redis settings

redis['enable'] = false
gitlab_rails['redis_host'] = "ci.redis.cache.windows.net"
gitlab_rails['redis_port'] = 6380
gitlab_rails['redis_password'] = "azure-primary-access-key"
gitlab_rails['redis_ssl'] = true

用于redis配置的azure缓存[azure门户]
![](https://i.stack.imgur.com/Hfa8J.png)
最后说明:
部署gitlab vm时,请使用检查日志 `gitlab-ctl tail` . 如果您看到redis默认端口 `6379` 意味着sidekiq有旧的配置,正如我所观察到的,它没有更新 `gitlab-ctl reconfigure` . 删除vm并重新部署它。

相关问题