autopilotpattern / mysql

Implementation of the autopilot pattern for MySQL
Mozilla Public License 2.0
172 stars 68 forks source link

Not able to run cluster. #99

Open mbtamuli opened 6 years ago

mbtamuli commented 6 years ago

When doing docker-compose up, this error shows up in the logs

mysql_1   | 2017/12/03 22:47:20 check.mysql.Run start
mysql_1   | 2017/12/03 22:47:21 Traceback (most recent call last):
mysql_1   | 2017/12/03 22:47:21   File "/usr/local/bin/manage.py", line 407, in <module>
mysql_1   | 2017/12/03 22:47:21     main()
mysql_1   | 2017/12/03 22:47:21   File "/usr/local/bin/manage.py", line 399, in main
mysql_1   | 2017/12/03 22:47:21     manta = Manta()
mysql_1   | 2017/12/03 22:47:21   File "/usr/local/bin/manager/libmanta.py", line 36, in __init__
mysql_1   | 2017/12/03 22:47:21     signer=self.signer)
mysql_1   | 2017/12/03 22:47:21   File "/usr/local/lib/python2.7/dist-packages/manta/client.py", line 140, in __init__
mysql_1   | 2017/12/03 22:47:21     assert account, 'account'
mysql_1   | 2017/12/03 22:47:21 AssertionError: account
mysql_1   | 2017/12/03 22:47:21 check.mysql exited with error: check.mysql: exit status 1
mysql_1   | 2017/12/03 22:47:21 event: {ExitFailed check.mysql}
mysql_1   | 2017/12/03 22:47:21 event: {Error check.mysql: exit status 1}
mysql_1   | 2017/12/03 22:47:21 check.mysql.Run end
mysql_1   | 2017/12/03 22:47:21 check.mysql.kill
mysql_1   | 2017/12/03 22:47:21 killing command 'check.mysql' at pid: 378
mysql_1   | 2017/12/03 22:47:21 event: {StatusUnhealthy mysql}

When I tried running the tests(./tests/compose.sh), they too failed. Here are the logs

dfredell commented 6 years ago

It looks like it can't connect to Manta, that you are missing the MANTA_USER env. Did you run examples/triton/client.py that generates a _env file?

O I see from your other log that you are trying to use minio. Note that the latest docker build on dockerhub doesn't include the minio code. You will have to build the docker locally.

benyanke commented 5 years ago

I'm getting this as well, with the example minio config:

version: '2.1'

services:
  mysql:
    image: autopilotpattern/mysql:${TAG:-latest}
    mem_limit: 512m
    restart: always
    expose:
      - 3306
    network_mode: bridge
    environment:
      - MYSQL_USER=dbuser
      - MYSQL_PASSWORD=seekretPassword
      - MYSQL_REPL_USER=repluser
      - MYSQL_REPL_PASSWORD=seekretReplPassword
      - MYSQL_DATABASE=demodb
      - BACKUP_TTL=120
      - LOG_LEVEL=DEBUG
      - CONSUL=consul
      - SNAPSHOT_BACKEND=minio
      - MINIO_ACCESS_KEY=supersecretaccesskey
      - MINIO_SECRET_KEY=supersecretsecretkey
    volumes:
      # shared storage location for snapshots
      - ${WORK_DIR:-../..}/tmp:/tmp/snapshots
    links:
      - consul:consul
      - minio:minio

  consul:
    image: consul:0.8.4
    command: >
      agent -server -client=0.0.0.0 -dev -ui
    restart: always
    mem_limit: 128m
    ports:
      - 8500:8500
    expose:
      - 53
      - 8300
      - 8301
      - 8302
      - 8400
      - 8500
    network_mode: bridge
    dns:
      - 127.0.0.1

  minio:
    image: minio/minio
    command: server /export
    restart: always
    expose:
      - 9000
    network_mode: bridge
    environment:
      - MINIO_ACCESS_KEY=supersecretaccesskey
      - MINIO_SECRET_KEY=supersecretsecretkey
benyanke commented 5 years ago

Looks like as of commit b104eb2679f6fbd0a59a02beb061e41f72e620d8 the repo version of bin/manage.py reads in the main function:

    snapshot_backend = os.environ.get('SNAPSHOT_BACKEND', 'manta')
    if snapshot_backend == 'local':
        snaps = Local()
    elif snapshot_backend == 'minio':
        snaps = Minio()
    else:
        snaps = Manta()

    cp = ContainerPilot()
    cp.load()
    node = Node(mysql=my, consul=consul, snaps=snaps, cp=cp)

Whereas the one inside the mysql container reads:


    my = MySQL()
    manta = Manta()
    cp = ContainerPilot()
    cp.load()
    node = Node(mysql=my, consul=consul, manta=manta, cp=cp)

Note the lack of handling for minio. Does the container need to be rebuild on dockerhub?

benyanke commented 5 years ago

Looks like percona:5.6 also switched away from apt-get and moved to yum, so the build fails.

Is there any updates to this project to have it working again, or is it now abandoned? I'd love to be able to use this!

dfredell commented 5 years ago

I talked with Joyent, the company that started autopilotpattern, and they have dropped the project. I think because the main autopilotpattern dude, tgross, left the company. The containerpilot project is still alive and works well.

I moved out of docker onto a SmartOS zone and am using pxc in a 3 node cluster.

benyanke commented 5 years ago

well, darn.