Skip to content

Fix Sentinel configuration rewrite.#8480

Merged
yossigo merged 1 commit into
redis:unstablefrom
yossigo:fix-sentinel-rewrite-config
Feb 10, 2021
Merged

Fix Sentinel configuration rewrite.#8480
yossigo merged 1 commit into
redis:unstablefrom
yossigo:fix-sentinel-rewrite-config

Conversation

@yossigo

@yossigo yossigo commented Feb 10, 2021

Copy link
Copy Markdown
Collaborator

The resolve-hostnames and announce-hostnames parameters were not
specified correctly according to the new convention introduced by
1aad55b.

The `resolve-hostnames` and `announce-hostnames` parameters were not
specified correctly according to the new convention introduced by
1aad55b.
@oranagra oranagra added the release-notes indication that this issue needs to be mentioned in the release notes label Feb 10, 2021
@oranagra

Copy link
Copy Markdown
Member

@yossigo that needs to be mentioned in the release notes, right?

@bofm

bofm commented Feb 10, 2021

Copy link
Copy Markdown

Hi. Got this error on sentinel restart on 6.2-rc3. May be related to the issue.

'sentinel known-replica redis redis1 6379'
Duplicate hostname and port for replica.

@yossigo yossigo merged commit 29ac9ae into redis:unstable Feb 10, 2021
@yossigo yossigo deleted the fix-sentinel-rewrite-config branch February 10, 2021 16:38
@yossigo

yossigo commented Feb 10, 2021

Copy link
Copy Markdown
Collaborator Author

@bofm I don't think it's related, but can you provide the full configuration? Thanks

@bofm

bofm commented Feb 10, 2021

Copy link
Copy Markdown
root@redis1-2:/data# cat sentinel.conf
bind 0.0.0.0
port 26379
daemonize no
dir "/data"
protected-mode no
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel announce-ip "redis1-2.redis1"
sentinel announce-port 26379

sentinel monitor redis1 redis1-2.redis1 6379 2

sentinel down-after-milliseconds redis1 3000
sentinel failover-timeout redis1 3000

# Generated by CONFIG REWRITE
user default on nopass ~* &* +@all
sentinel myid 3861b8df62bf3d896e444ca10c1b61ff15d1ba0f
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel config-epoch redis1 3
sentinel leader-epoch redis1 3
sentinel current-epoch 3
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel known-replica redis1 redis1-0.redis1 6379
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel known-replica redis1 redis1-0.redis1 6379
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel known-sentinel redis1 redis1-1.redis1 26379 5696a1065d9cd0fd06b86fdf95f7a43ee669310c
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel known-sentinel redis1 redis1-0.redis1 26379 f411ed110162f05990500086f05fa9543ce25e0b
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel announce-hostnames yes
sentinel known-replica redis1 redis1-1.redis1 6379

The line sentinel known-replica redis1 redis1-0.redis1 6379 has been dumped twice by config rewrite.

The error was

*** FATAL CONFIG FILE ERROR (Redis 6.1.242) ***
Reading the configuration file, at line 29
>>> 'sentinel known-replica redis1 redis1-0.redis1 6379'
Duplicate hostname and port for replica.

This happened when I restarted one pair of sentinel and redis on another IP but on the same DNS hostname.

@yossigo

yossigo commented Feb 10, 2021

Copy link
Copy Markdown
Collaborator Author

@bofm Thanks, I'll look into that

@oranagra oranagra mentioned this pull request Feb 22, 2021
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Mar 2, 2021
The `resolve-hostnames` and `announce-hostnames` parameters were not
specified correctly according to the new convention introduced by
1aad55b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes indication that this issue needs to be mentioned in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants