What is my problem?
I want to use Docker to deploy the web analytics tool Piwik on my CentOs 7 Server.
To achieve this I have followed this page, which states that in order to run the piwik container, a mysql container must be running. So I ran the mysql-docker-container first in this fashion:
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest
After that I ran the piwik-docker-container like so:
docker run --name some-piwik --link some-mysql:mysql -p 6969:9000 -d piwik
According to the site it should now be possible to browse to http://localhost:6969
to see the Piwik Login page.
Unfortunately using my browser of choice (lynx
), I get this error message:
[root@localhost /]# lynx localhost:6969
Looking up localhost first
Looking up localhost:6969
Making HTTP connection to localhost:6969
Sending HTTP request.
HTTP request sent; waiting for response.
Alert!: Unexpected network read error; connection aborted.
Can't Access `http://localhost:6969/'
Alert!: Unable to access document.
lynx: Can't access startfile
What have I done to debug it?
To debug this behaviour I listed all running containers:
[root@localhost /]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
091d56f024f7 piwik "/entrypoint.sh php-f" About an hour ago Up About an hour 0.0.0.0:6969->9000/tcp some-piwik
0d869ba11123 mysql:latest "/entrypoint.sh mysql" About an hour ago Up About an hour 3306/tcp some-mysql
Conclusion: It seems like the ports are mapped and both containers are running.
In search of another possible hint to the source of my problem I checked the logs of the containers:
[root@localhost gitlab]# docker logs some-piwik
[22-Mar-2016 14:53:08] NOTICE: fpm is running, pid 1
[22-Mar-2016 14:53:08] NOTICE: ready to handle connections
Conclusion: It seems like the piwik container is ready.
[root@localhost gitlab]# docker logs some-mysql
Initializing database
2016-03-22T14:31:30.234530Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-03-22T14:31:30.715480Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-03-22T14:31:30.803664Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: c4f82d8d-f03a-11e5-b9ab-0242ac110003.
2016-03-22T14:31:30.807955Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-03-22T14:31:30.808521Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2016-03-22T14:31:32.217007Z 1 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:32.217054Z 1 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:32.217074Z 1 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:32.217092Z 1 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:32.217148Z 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
Database initialized
MySQL init process in progress...
2016-03-22T14:31:34.152405Z 0 [Note] mysqld (mysqld 5.7.11) starting as process 45 ...
2016-03-22T14:31:34.157555Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-03-22T14:31:34.157593Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-22T14:31:34.157601Z 0 [Note] InnoDB: Uses event mutexes
2016-03-22T14:31:34.157608Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-03-22T14:31:34.157617Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-03-22T14:31:34.157623Z 0 [Note] InnoDB: Using Linux native AIO
2016-03-22T14:31:34.157969Z 0 [Note] InnoDB: Number of pools: 1
2016-03-22T14:31:34.158117Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-03-22T14:31:34.171400Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-03-22T14:31:34.183239Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-03-22T14:31:34.186125Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2016-03-22T14:31:34.198794Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-03-22T14:31:34.212704Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-03-22T14:31:34.212824Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2016-03-22T14:31:34.543252Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2016-03-22T14:31:34.544661Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-03-22T14:31:34.544685Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-03-22T14:31:34.545567Z 0 [Note] InnoDB: Waiting for purge to start
2016-03-22T14:31:34.595786Z 0 [Note] InnoDB: 5.7.11 started; log sequence number 2492554
2016-03-22T14:31:34.595979Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2016-03-22T14:31:34.596205Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-03-22T14:31:34.597885Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160322 14:31:34
2016-03-22T14:31:34.598226Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-03-22T14:31:34.622636Z 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:34.622697Z 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:34.622731Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:34.622762Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:34.624174Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:34.631086Z 0 [Note] Event Scheduler: Loaded 0 events
2016-03-22T14:31:34.631311Z 0 [Note] mysqld: ready for connections.
Version: '5.7.11' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
Warning: Unable to load '/usr/share/zoneinfo/Factory' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/posix/Factory' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/right/Factory' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
2016-03-22T14:31:40.318193Z 4 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:40.318230Z 4 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:40.318272Z 4 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
/entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2016-03-22T14:31:40.319867Z 0 [Note] Giving 0 client threads a chance to die gracefully
2016-03-22T14:31:40.319901Z 0 [Note] Shutting down slave threads
2016-03-22T14:31:40.319912Z 0 [Note] Forcefully disconnecting 0 remaining clients
2016-03-22T14:31:40.319921Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2016-03-22T14:31:40.320014Z 0 [Note] Binlog end
2016-03-22T14:31:40.322853Z 0 [Note] Shutting down plugin 'ngram'
2016-03-22T14:31:40.322884Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2016-03-22T14:31:40.322895Z 0 [Note] Shutting down plugin 'partition'
2016-03-22T14:31:40.322903Z 0 [Note] Shutting down plugin 'ARCHIVE'
2016-03-22T14:31:40.322909Z 0 [Note] Shutting down plugin 'MEMORY'
2016-03-22T14:31:40.322923Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2016-03-22T14:31:40.322931Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-03-22T14:31:40.322940Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-03-22T14:31:40.322946Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-03-22T14:31:40.322953Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-03-22T14:31:40.322959Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-03-22T14:31:40.322965Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-03-22T14:31:40.322970Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-03-22T14:31:40.322976Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-03-22T14:31:40.322982Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-03-22T14:31:40.322987Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-03-22T14:31:40.322995Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-03-22T14:31:40.323002Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-03-22T14:31:40.323008Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-03-22T14:31:40.323014Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-03-22T14:31:40.323022Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-03-22T14:31:40.323028Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2016-03-22T14:31:40.323035Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2016-03-22T14:31:40.323041Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-03-22T14:31:40.323046Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-03-22T14:31:40.323051Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-03-22T14:31:40.323056Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-03-22T14:31:40.323062Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-03-22T14:31:40.323070Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-03-22T14:31:40.323077Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-03-22T14:31:40.323083Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-03-22T14:31:40.323089Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2016-03-22T14:31:40.323097Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-03-22T14:31:40.323104Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-03-22T14:31:40.323111Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2016-03-22T14:31:40.323117Z 0 [Note] Shutting down plugin 'InnoDB'
2016-03-22T14:31:40.323250Z 0 [Note] InnoDB: FTS optimize thread exiting.
2016-03-22T14:31:40.323446Z 0 [Note] InnoDB: Starting shutdown...
2016-03-22T14:31:40.423749Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2016-03-22T14:31:40.424428Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 160322 14:31:40
2016-03-22T14:31:42.259424Z 0 [Note] InnoDB: Shutdown completed; log sequence number 11991678
2016-03-22T14:31:42.263166Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2016-03-22T14:31:42.263192Z 0 [Note] Shutting down plugin 'MyISAM'
2016-03-22T14:31:42.263204Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2016-03-22T14:31:42.263211Z 0 [Note] Shutting down plugin 'CSV'
2016-03-22T14:31:42.263217Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-03-22T14:31:42.263290Z 0 [Note] Shutting down plugin 'sha256_password'
2016-03-22T14:31:42.263306Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-03-22T14:31:42.263311Z 0 [Note] Shutting down plugin 'keyring_file'
2016-03-22T14:31:42.263600Z 0 [Note] Shutting down plugin 'binlog'
2016-03-22T14:31:42.264545Z 0 [Note] mysqld: Shutdown complete
MySQL init process done. Ready for start up.
2016-03-22T14:31:42.543163Z 0 [Note] mysqld (mysqld 5.7.11) starting as process 1 ...
2016-03-22T14:31:42.548164Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-03-22T14:31:42.548207Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-22T14:31:42.548216Z 0 [Note] InnoDB: Uses event mutexes
2016-03-22T14:31:42.548225Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-03-22T14:31:42.548234Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-03-22T14:31:42.548250Z 0 [Note] InnoDB: Using Linux native AIO
2016-03-22T14:31:42.548634Z 0 [Note] InnoDB: Number of pools: 1
2016-03-22T14:31:42.548800Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-03-22T14:31:42.563003Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-03-22T14:31:42.574946Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-03-22T14:31:42.578836Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2016-03-22T14:31:42.591488Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-03-22T14:31:42.605952Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-03-22T14:31:42.606098Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2016-03-22T14:31:42.935219Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2016-03-22T14:31:42.936243Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-03-22T14:31:42.936261Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-03-22T14:31:42.937391Z 0 [Note] InnoDB: Waiting for purge to start
2016-03-22T14:31:42.987575Z 0 [Note] InnoDB: 5.7.11 started; log sequence number 11991678
2016-03-22T14:31:42.988186Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2016-03-22T14:31:42.988381Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-03-22T14:31:42.990760Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-03-22T14:31:42.990791Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2016-03-22T14:31:42.990873Z 0 [Note] IPv6 is available.
2016-03-22T14:31:42.990895Z 0 [Note] - '::' resolves to '::';
2016-03-22T14:31:42.990909Z 0 [Note] Server socket created on IP: '::'.
2016-03-22T14:31:42.993822Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160322 14:31:42
2016-03-22T14:31:43.027560Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:43.027600Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:43.030086Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2016-03-22T14:31:43.037089Z 0 [Note] Event Scheduler: Loaded 0 events
2016-03-22T14:31:43.037341Z 0 [Note] mysqld: ready for connections.
Version: '5.7.11' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
Conclusion: Strangely, the mysql-container log does not contain any messages that the piwik container somehow connected to it. So this suggests the linking between those containers did not happen, despite the fact that the piwik-container was run with the --link some-mysql:mysql
flag.
All of this leads to the questions:
- How can I make the browsing to the Piwik Login Page work?
- What can I do to find other clues on why its not working?
- Have I totally misunderstood the usage of the docker-Piwik conatiner?