Shopify / ghostferry

The swiss army knife of live data migrations
https://shopify.github.io/ghostferry
MIT License
693 stars 65 forks source link

Cannot follow tutorial due to incompatible docker-compose.yml #304

Closed marlowpayne closed 2 years ago

marlowpayne commented 2 years ago

Looking at current issues, this may be part of #290, but requires code changes, so I'm logging here.

Note: I was using the internal dev tool, but as far as I can tell this issue will occur for external users too.

Machine setup:

Docker Desktop version 3.6.0 (67351) Screen Shot 2021-08-19 at 10 22 49 AM

Steps

  1. Clone the repo and cd to it
  2. Run dev up, docker-compose up -d, or docker-compose up -d mysql-1 mysql-2 as part of first tutorial step ("Setup and Seed MySQL")

Result

Nothing happens. Error displayed: (root) Additional property mysql-1 is not allowed

Expected

mysql-1 and mysql-2 pulled and containers started. Tutorial can proceed.

Findings + Workaround

This issue looks like it may be caused by a deprecated docker-compose.yml format/syntax: https://docs.docker.com/compose/compose-file/compose-versioning/#version-1-deprecated

I was able to workaround and proceed by minimally changing docker-compose.yml to nest all entries under a top-level services: key:

services:
  mysql-1:
    image: percona:5.7
    command: --server-id=1
      --log-bin=mysql-bin
      --max-binlog-size=4096
      --binlog-format=ROW
      --sync-binlog=1
      --log-slave-updates=ON
      --gtid-mode=ON
      --enforce-gtid-consistency=ON
      --character-set-server=utf8mb4
      --collation-server=utf8mb4_unicode_ci
      --max-connections=1000
      --read-only=OFF
      --binlog-rows-query-log-events=ON
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
    volumes:
      - /var/lib/mysql
    ports:
      - "29291:3306"

  mysql-2:
    image: percona:5.7
    command: --server-id=2
      --log-bin=mysql-bin
      --binlog-format=ROW
      --max-binlog-size=4096
      --sync-binlog=1
      --log-slave-updates=ON
      --gtid-mode=ON
      --enforce-gtid-consistency=ON
      --character-set-server=utf8mb4
      --collation-server=utf8mb4_unicode_ci
      --max-connections=1000
      --binlog-rows-query-log-events=ON
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
    volumes:
      - /var/lib/mysql
    ports:
      - "29292:3306"

  mysql-3:
    image: percona:5.7
    command: --server-id=3
      --log-bin=mysql-bin
      --binlog-format=ROW
      --max-binlog-size=4096
      --sync-binlog=1
      --log-slave-updates=ON
      --gtid-mode=ON
      --enforce-gtid-consistency=ON
      --character-set-server=utf8mb4
      --collation-server=utf8mb4_unicode_ci
      --max-connections=1000
      --binlog-rows-query-log-events=ON
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
    volumes:
      - /var/lib/mysql
    ports:
      - "29293:3306"
coding-chimp commented 2 years ago

Should be fixed with #239.