简体   繁体   English

AWS Lightail Ubuntu 18.04服务器上的Docker mysql 5.7继续重启

[英]Docker mysql 5.7 on AWS lightsail ubuntu 18.04 server keep restarting

I have a script to install docker wordpress along with mysql server on ubuntu server. 我有一个脚本在ubuntu服务器上安装docker wordpress和mysql服务器。 This script works perfectly OK on both ubuntu server 16.04 and 18.04 on VMWare on my local machine. 此脚本在本地计算机上的VMWare上的ubuntu服务器16.04和18.04上均可正常运行。 This same script works on AwS lightsail ubuntu server 16.04 instance but not on 18.04. 此脚本适用于AwS lightail ubuntu服务器16.04实例,但不适用于18.04。 i don't get any error on script commands. 我在脚本命令上没有任何错误。 entire process complete sucessfully but when i check runnign containers i see mysql container is keep rerstarting. 整个过程成功完成,但是当我检查运行容器时,我看到mysql容器正在重新启动。 This only happens on AWS lightsail ubuntu 18.04 instance. 这仅在AWS lightail ubuntu 18.04实例上发生。 Can't figure out why. 不知道为什么。 can anybody help please. 有人可以帮忙吗? script is as follows: 脚本如下:

#!/bin/bash
apt-get -y update
apt-get -y install apt-transport-https ca-certificates curl software- 
properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] 
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get -y update
apt-get -y install docker-ce docker-compose

mkdir wordpress
cd wordpress

echo "file_uploads = On
memory_limit = 500M
upload_max_filesize = 500M
post_max_size = 500M
max_execution_time = 600" >> uploads.ini

echo "version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: user
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: user123

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - "80:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: user123
     volumes:
       - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
volumes:
    db_data: {}" >> docker-compose.yml

docker-compose up -d --build

I found issue with WORDPRESS_DB_HOST: db:3306 in db environment. 我在数据库环境中发现了WORDPRESS_DB_HOST:db:3306的问题。 i bring my yml script down to basic minimum and it worked. 我把我的yml脚本降低到基本最低要求,并且有效。 I also think mysql has issues with AWS lightsail ubuntu 18.04 server. 我也认为mysql与AWS Lightail ubuntu 18.04服务器存在问题。 Mariadb works perfectly OK. Mariadb正常运行。 My final docker-compose.yml script on AWS lightsail ubuntu server 18.04 is: 我在AWS lightail ubuntu服务器18.04上最终的docker-compose.yml脚本是:

wordpress:
  image: wordpress
  links:
    - wordpress_db:mysql
  ports:
    - 80:80
  volumes:
    - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
wordpress_db:
  image: mariadb
  environment:
    MYSQL_ROOT_PASSWORD: user123

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么在 AWS(Lightsail 和 EC2)上运行的 Ubuntu 18.04 服务器上安装 MYSQL 服务器后出现 ssh 连接错误? - Why do I get ssh connection error after installing MYSQL server on Ubuntu 18.04 running on AWS (Lightsail and EC2)? 尝试在 Ubuntu 18.04 上将 MySQL 服务器从 5.7 升级到 8.0 时出错 - Errors while trying to upgrade MySQL server from 5.7 to 8.0 on Ubuntu 18.04 如何在Ubuntu 18.04上从MySQL 5.7升级到8.0? - How to upgrade from MySQL 5.7 to 8.0 on Ubuntu 18.04? 无法在Ubuntu 18.04中启动MySQL Community Server - Failed to start MySQL Community Server in Ubuntu 18.04 如何保持wordpress的两个MySQL MySQL数据库,AWS lightail同步? - How to keep two MySQL databases of wordpress , AWS lightsail in sync? 在 Ubuntu 16.04 上重新安装 MySQL 5.7 服务器的问题 - Issues on reinstalling MySQL 5.7 server on Ubuntu 16.04 如何在ubuntu-18.04 mariadb mysql 5.7上设置lower_case_table_names = 1 - how to set lower_case_table_names = 1 on ubuntu-18.04 mariadb mysql 5.7 Hetzner 云服务器上的 Ubuntu 18.04 仿生和 MySQL 服务器安装问题 - Ubuntu 18.04 bionic and MySQL server installation problems at Hetzner cloud server 无法在 ubuntu 16.04 上安装 mysql-server 5.7 - Cannot install mysql-server 5.7 on ubuntu 16.04 MySQL无法在Ubuntu中重新启动 - Mysql not restarting in ubuntu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM