Centos7中Docker Seafile容易无法启动问题

Centos7重启后seafile docker容易无法启动。docker logs seafile错误如下:

*** Running /etc/my_init.d/01_create_data_links.sh...
*** Running /etc/my_init.d/10_syslog-ng.init...
Nov  6 05:57:40 ba2d6be4430d syslog-ng[23]: syslog-ng starting up; version='3.5.6'
Nov  6 05:57:41 ba2d6be4430d syslog-ng[23]: EOF on control channel, closing connection;
*** Running /etc/my_init.d/99_mysql_setup.sh...
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 30
*** Running /scripts/start.py...
Nov  6 05:57:41 ba2d6be4430d cron[37]: (CRON) INFO (pidfile fd = 3)
Nov  6 05:57:41 ba2d6be4430d cron[37]: (CRON) INFO (Skipping @reboot jobs -- not system startup)
[2018-11-06 05:57:41] Skip running setup-seafile-mysql.py because there is existing seafile-data folder.
failed to run "ccnet-server -t"
[11/06/18 05:57:44] ../common/session.c(132): using config file /opt/seafile/conf/ccnet.conf
[11/06/18 05:57:44] ../common/ccnet-db.c(124): Failed to get database connection: Failed to connect to MySQL: Can't connect to MySQL server on '127.0.0.1' (111).
[11/06/18 05:57:44] user-mgr.c(769): Failed to create user db tables.
Traceback (most recent call last):
  File "/scripts/start.py", line 85, in <module>
    main()
  File "/scripts/start.py", line 71, in main
    call('{} start'.format(get_script('seafile.sh')))
  File "/scripts/utils/__init__.py", line 68, in call
    return subprocess.check_call(*a, **kw)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/opt/seafile/seafile-server-6.3.3/seafile.sh start' returned non-zero exit status 1
*** /scripts/start.py exited with status 1.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111 "Connection refused")'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
*** Shutting down runit daemon (PID 30)...
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...

 

解决方法:

找了很久,没有找到解决方法。

暂时用以下方法,假装解决了这个问题。

 

/home/tools/seafile.sh
docker stop seafile
docker pull seafileltd/seafile:latest
docker rm -f seafile
docker run -d --name seafile -e SEAFILE_SERVER_HOSTNAME=seafile.abc.com --restart always -v /mnt/vdb/opt/seafile-data:/shared -p 9001:80 seafileltd/seafile:latest

 

分享到:更多 ()