Valkey Replication Sync Failure
search cancel

Valkey Replication Sync Failure

book

Article ID: 447724

calendar_today

Updated On:

Products

VMware Tanzu for Valkey

Issue/Introduction

Valkey nodes fail to synchronize with the following error in replica logs:

* PRIMARY <-> REPLICA sync started
* Connecting to PRIMARY ###.##.###.#:0 # Error condition on socket for SYNC: Connection refused

Environment

  • VMware Tanzu Valkey 9.0.0+

Cause

While it is possible to use non-TLS, TLS, or a mix of the two in Valkey, this issue can occur when ports are not configured correctly in the valkey.conf file:

port 0

The above configuration disables the non-TLS port but lacked the configuration for an active TLS port, so Valkey cannot establish synchronization resulting in an immediate connection refusal.

Resolution

Ensure ports are explicitly set to a valid listener port:

  1. Verify the Valkey service instance configuration is accurate.
  2. Decide if you want non-TLS, TLS, or both:
    1. non-TLS:
      port 6379
      tls-port 0
    2. TLS:
      port 0
      tls-port 6379
      1. If using TLS, ensure replication is also encrypted:
        tls-replication yes
    3. non-TLS and TLS:
      port 6379
      tls-port 6380
  3. Restart nodes to make the configuration change take effect.
  4. Verify the fix by checking info replication for master_link_status:up.