redis / docker-library-redis

Docker Official Image packaging for Redis
http://redis.io
BSD 3-Clause "New" or "Revised" License
1.11k stars 560 forks source link

Only startup a redis container, why does the redis auto request replica ? #361

Closed jdyuankai closed 6 months ago

jdyuankai commented 1 year ago

docker compose config below:

  redis:
    image: redis:6.2-alpine
    ports:
      - 6379:6379
    volumes:
      - redisdata:/data
    networks:
      - mynetwork

this is the log:

1:S 30 May 2023 13:17:01.179 * Connecting to MASTER 130.61.151.86:27000
1:S 30 May 2023 13:17:01.180 * MASTER <-> REPLICA sync started
1:S 30 May 2023 13:17:01.393 * Non blocking connect for SYNC fired the event.
1:S 30 May 2023 13:17:01.576 # Error reply to PING from master: '-Reading from master: Connection reset by peer'
1:S 30 May 2023 13:17:02.184 * Connecting to MASTER 130.61.151.86:27000
1:S 30 May 2023 13:17:02.185 * MASTER <-> REPLICA sync started
1:S 30 May 2023 13:17:02.400 * Non blocking connect for SYNC fired the event.
1:S 30 May 2023 13:17:02.557 # Error reply to PING from master: '-Reading from master: Connection reset by peer'
1:S 30 May 2023 13:17:03.190 * Connecting to MASTER 130.61.151.86:27000
1:S 30 May 2023 13:17:03.190 * MASTER <-> REPLICA sync started
1:S 30 May 2023 13:17:03.373 * Non blocking connect for SYNC fired the event.
1:S 30 May 2023 13:17:03.534 # Error reply to PING from master: '-Reading from master: Connection reset by peer'
tianon commented 1 year ago

You're exposing 6379 outside your host, and Redis doesn't implement authentication by default, so it's very likely that it wasn't you who requested replication and you should shut that down immediately and treat that volume as compromised. :grimacing: