ArgoCD 2.5.x ha install results in redis pods initializing issue - redis

We are trying to install the ha argocd of verser 2.5.x(current stable version) on Kubernetes: v1.23.13
But the argocd-redis-ha-server-0 pod does not finalize the Initialization because the config-init container fails with
Start...
Initializing config..
Copying default redis config..
to '/data/conf/redis.conf'
Copying default sentinel config..
to '/data/conf/sentinel.conf'
Identifying redis master (get-master-addr-by-name)..
using sentinel (argocd-redis-ha), sentinel group name (argocd)
Could not connect to Redis at argocd-redis-ha:26379: Try again
Could not connect to Redis at argocd-redis-ha:26379: Try again
Could not connect to Redis at argocd-redis-ha:26379: Try again
Did not find redis master ()
Identify announce ip for this pod..
using (argocd-redis-ha-announce-0) or (argocd-redis-ha-server-0)
identified announce ()
/readonly-config/init.sh: line 239: Error: Could not resolve the announce ip for this pod.: not found
Installed ArgoCD resource - https://github.com/argoproj/argo-cd/blob/master/manifests/ha/install.yaml
Does anyone have any idea on how to resolve the above issue?

Related

Sentinel auth-pass error when using redis 6.0.6

I don't want to set master redis password in the config file
So I found this command from the redis official website
sentinel auth-pass <master-group-name> <password>
but when i use the error occurs
like this
127.0.0.1:26378> sentinel auth-pass myMaster 123456
(error) ERR Unknown sentinel subcommand 'auth-user'
why!!!!
Search on Google
and
noting
Maybe I should upgrade to 6.2.0
Sentinel stated supporting auth-user from Redis version 6.2.x. So, it can not find the sub-command auth-user which is needed for the command sentinel auth-pass.
From Redis Sentinel Official Documentation :
Starting with Redis 6.2, the Access Control List (ACL) is available, whereas previous versions (starting with Redis 5.0.1) support password-only authentication.

Redis Sentinel Rename-Command Ignored

I am trying to limit the allowed privileges for external redis sentinel users by renaming critical commands as follow:
sentinel rename-command mymaster FAILOVER failover-secret
However, the configurations are being ignored, and I still can trigger the renamed command using the original name:
127.0.0.1:26379> sentinel failover mymaster
OK
Redis Version:
Redis server v=6.0.9 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=e874f7259751a389
The best option would be to put this in your Redis server's config file as opposed to setting it via CLI. It sounds like setting it this way either only applies to that connection (so other connections won't have that config change) or it only persists until the server restarts. Putting it in the config file would persist for all connections, and across restarts.
Another option if you're using Redis v6 (or can upgrade to v6) is to create separate users and specify the available commands per user. This option is discussed in this answer.

Unable to start Sidekiq on my local machine: Error connecting to Redis on redis:6379 (SocketError)

I have Redis running from a Rails app but when I try to start Sidekiq (bundle exec sidekiq), I am getting
INFO: Booting Sidekiq 6.0.4 with redis options {:url=>"redis://redis:6379/0", :id=>"Sidekiq-server-PID-49487"}
Error connecting to Redis on redis:6379 (SocketError)
I looked at my redis.conf file and I'm sure I haven't changed any of the defaults. What else could I check for?
sidekiq (6.0.4)
rails (6.0.2.1)
redis (4.1.3)
Turns out I was using the wrong Redis address in my Rails .env file as it was configured for Docker. Sidekiq was unable to find the right Redis port.
Changed from redis://redis:6379/0 to redis:6379/0.
The redis hostname doesn't exist (use localhost?) or you haven't started Redis.

should I handle the master redis ip by myself in redis single master multi slave cluster

I am using a single master multi slave redis cluster in kubernetes v1.16.0,but today I found the master ip changed(another node change to master and legacy master change to slave) and cause my cluster down. I am install my redis like this:
./helm install stable/redis-ha --generate-name -n middleware
and specify ip through the master service ip. what should I do to make it handle it automaticlly.This is service status:

How to switch redis master in sentinel configuration

I have a redis sentinel configuration with one master, two slaves and 3 sentinels running. I noticed that at some point the sentinels may switch the master electing one of the slaves as master. This is causing problems to an application which is connecting to the master node as a standalone client(I'm working on changing the code to use sentinels). I wanted to know if it is possible to switch the master by connecting to the sentinel client i.e. through 'redis-cli'
Can somebody let me know if there is a command that I can use to switch the master IP?
The client applications should use a client library that supports sentinel in the case where a redis master goes down and the sentinels select a new master. Not sure how beneficial it is to have sentinel setup if your client applications are not taking advantage of it. A client application that supports sentinel will query sentinel for the master ip and should be somewhat tolerant to faults occurring with the master connection. You can trigger a manual failover like the other answer states:
redis-cli -h {sentinel-ip} -p {26379 or sentinel port} sentinel failover {mastername}
But you will not be able to pick which node it fails over to. You can control a configuration value slave_priority in the redis.conf file so that it prefers a node over the rest. A description of the slave priority can be found here: https://redis.io/topics/sentinel
You can manually trigger a failover by running:
redis-cli -a {password} -p {sentinel_port} SENTINEL failover {cluster_name}
If you are using Lettuce Client you can use masterSlaveStatefulConnection and pass the sentinel URI it will perform auto discovery in the background and will refresh the master node internally.
https://github.com/lettuce-io/lettuce-core/wiki/Master-Replica