Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bitnami/redis] "externalMaster" option doesn't work if redis/sentinels and externalMaster ports are different or exposed outside. #16922

Open
alehyarmalovich opened this issue May 26, 2023 · 4 comments · May be fixed by #16947
Assignees
Labels
on-hold Issues or Pull Requests with this label will never be considered stale redis tech-issues The user has a technical issue about an application

Comments

@alehyarmalovich
Copy link
Contributor

alehyarmalovich commented May 26, 2023

Name and Version

bitnami/redis 17.11.3

What architecture are you using?

amd64

What steps will reproduce the bug?

install helm chart with custom parameters

Are you using any custom parameters or values?

architecture: replication
useHostnames: false
sentinel:
  enabled: true
  quorum: 2
  masterSet: master
  downAfterMilliseconds: 2000
  failoverTimeout: 1000
  service:
    type: NodePort
    nodePorts:
      redis: 30310
      sentinel: 30420
  externalMaster:
    enabled: true
    host: xxx.xxx.xxx.xxx
    port: 30121
replica:
  externalMaster:
    enabled: true
    host: xxx.xxx.xxx.xxx
    port: 30111

What is the expected behavior?

 12:05:49.92 INFO  ==> about to run the command: timeout 220 redis-cli -h xxx.xxx.xxx.xxx -p 30420 sentinel get-master-addr-by-name master
Could not connect to Redis at xxx.xxx.xxx.xxx:30420: Connection refused
 12:06:09.97 INFO  ==> Configuring the node as master
1:C 25 May 2023 12:06:30.035 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 25 May 2023 12:06:30.035 # Redis version=7.0.11, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 25 May 2023 12:06:30.035 # Configuration loaded
1:M 25 May 2023 12:06:30.036 * monotonic clock: POSIX clock_gettime
1:M 25 May 2023 12:06:30.037 * Running mode=standalone, port=6379.
1:M 25 May 2023 12:06:30.037 # Server initialized
1:M 25 May 2023 12:06:30.038 * Ready to accept connections

What do you see instead?

instead of:

if [ -n "$REDIS_EXTERNAL_MASTER_HOST" ]; then
     REDIS_SERVICE="$REDIS_EXTERNAL_MASTER_HOST"
else
    REDIS_SERVICE="{{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
fi
SENTINEL_SERVICE_PORT=$(get_port "{{ include "common.names.fullname" . }}" "SENTINEL")

use:

if [ -n "$REDIS_EXTERNAL_MASTER_HOST" ]; then
     REDIS_SERVICE="$REDIS_EXTERNAL_MASTER_HOST"
     SENTINEL_SERVICE_PORT={{ .Values.sentinel.externalMaster.port | quote }}
else
    REDIS_SERVICE="{{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
    SENTINEL_SERVICE_PORT=$(get_port "{{ include "common.names.fullname" . }}" "SENTINEL")
fi

I'll do a PR

Additional information

The port of the current installation is substituted into quorum_info_command and if they don't match the externalMaster port than the node is configuring as master. In the same time Sentinels join to external as well.

@alehyarmalovich alehyarmalovich added the tech-issues The user has a technical issue about an application label May 26, 2023
@github-actions github-actions bot added the triage Triage is needed label May 26, 2023
@carrodher
Copy link
Member

Thanks for reporting this issue. Would you like to contribute by creating a PR to solve the issue? The Bitnami team will be happy to review it and provide feedback. Here you can find the contributing guidelines.

@github-actions
Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Jun 11, 2023
@github-actions
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@bitnami-bot bitnami-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
@github-actions github-actions bot removed the solved label Jul 13, 2023
@alehyarmalovich
Copy link
Contributor Author

Reopen

@carrodher carrodher reopened this Jul 13, 2023
@carrodher carrodher added on-hold Issues or Pull Requests with this label will never be considered stale and removed stale 15 days without activity triage Triage is needed labels Jul 13, 2023
@github-actions github-actions bot added triage Triage is needed and removed on-hold Issues or Pull Requests with this label will never be considered stale solved labels Jul 13, 2023
@github-actions github-actions bot added on-hold Issues or Pull Requests with this label will never be considered stale and removed triage Triage is needed labels Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-hold Issues or Pull Requests with this label will never be considered stale redis tech-issues The user has a technical issue about an application
Projects
None yet
4 participants