openzipkin-attic / docker-zipkin

Docker images for OpenZipkin
Apache License 2.0
689 stars 330 forks source link

Error while add volumes for openzipkin/zipkin-mysql in yml filw #153

Open pateljayg opened 7 years ago

pateljayg commented 7 years ago

Without adding any volumes docker image run properly. But when I add volume I got and Error and openzipkin/zipkin-mysql not start.

yml file configuration:

services: storage: image: openzipkin/zipkin-mysql container_name: mysql volumes:

... ...

Error:

170828 06:42:46 mysqld_safe Starting mysqld daemon with databases from /mysql/data 2017-08-28 6:42:46 140577363340072 [Note] /usr/bin/mysqld (mysqld 10.1.22-MariaDB) starting as process 128 ... 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Using mutexes to ref count buffer pool pages 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: The InnoDB memory heap is disabled 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Compressed tables use zlib 1.2.8 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Using Linux native AIO 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Using SSE crc32 instructions 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Completed initialization of buffer pool 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Highest supported file format is Barracuda. 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 1600729 in the ib_logfiles! 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer... 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: 128 rollback segment(s) are active. 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Waiting for purge to start 2017-08-28 6:42:46 140577363340072 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.35-80.0 started; log sequence number 1600729 2017-08-28 6:42:46 140577160039088 [Note] InnoDB: Dumping buffer pool(s) not yet started 2017-08-28 6:42:46 140577363340072 [Note] Plugin 'FEEDBACK' is disabled. 2017-08-28 6:42:46 140577363340072 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded 2017-08-28 6:42:46 140577363340072 [Note] Recovering after a crash using mysql-bin 2017-08-28 6:42:46 140577363340072 [Note] Starting crash recovery... 2017-08-28 6:42:46 140577363340072 [Note] Crash recovery finished. 2017-08-28 6:42:46 140577157057200 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist 2017-08-28 6:42:46 140577363340072 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist 2017-08-28 6:42:46 140577363340072 [Note] Server socket created on IP: '::'. 2017-08-28 6:42:46 140577363340072 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 170828 06:42:46 mysqld_safe mysqld from pid file /mysql/data/25b1eb33379c.pid ended

codefromthecrypt commented 7 years ago

the image doesn't recreate the schema on startup, so what you are seeing is it failing to see tables etc. This image is really a test one. At the point where you are using volumes, might consider a real image?

pateljayg commented 7 years ago

@adriancole as you said the image doesn't recreate the schema on startup. So we don't need to add volume externally. right ? I am trying to mount data at "/home/jpatel/docker_files/zipkin/mysql_db" location. So we can use old data on startup image every time.

codefromthecrypt commented 7 years ago

sorry I don't know the most docker way to do this.. it might be that you copy the image data local first

pateljayg commented 7 years ago

Other way to define Volume. Its works for me.

services:
  storage:
    image: openzipkin/zipkin-mysql
    container_name: mysql
    # Uncomment to expose the storage port for testing
    ports:
       - 3306:3306
    volumes:
       - database:/mysql/data

...

volumes:
  database:
    driver: local

So when you run image , every time container use same volume.

mykytanikitenko commented 6 years ago

I have the same problem and moving volume to separate definition doesn't help. Any workaround?