meolu / walle-web

walle - 瓦力 Devops开源项目代码部署平台
https://walle-web.io
Apache License 2.0
11.85k stars 2.76k forks source link

docker启动报错 #613

Open huangshaoming1995 opened 5 years ago

huangshaoming1995 commented 5 years ago

一键启动docker-compose build && docker-compose up -d && docker-compose logs -f报以下错误,登陆报网络异常,请大神分析一下,不胜感激 OperationalError: (_mysql_exceptions.OperationalError) (1045, "Access denied for user 'root'@'172.21.0.3' (using password: YES)") (Background on this error at: http://sqlalche.me/e/e3q8)

sicher123 commented 5 years ago

大概率是密码错了。你用root 试下能不能登陆mysql ,默认密码是walle

huangshaoming1995 commented 5 years ago

创建了一个walle用户和密码walle都不行,还是报此错误,感觉是docker-compose.yml中配置有问题,请大神分析一下

hupinxiao commented 5 years ago

你的docker-compose.yml 贴出来看看

huangshaoming1995 commented 5 years ago

你的docker-compose.yml 贴出来看看

version: '3.7' services: web: image: alenx/walle-web:2.0 container_name: walle-nginx hostname: nginx-web ports:

如果宿主机80端口被占用,可自行修改为其他port(>=1024)

# 0.0.0.0:要绑定的宿主机端口:docker容器内端口80
  - "80:80"
links:
  - python
depends_on:
  - python
networks:
  - walle-net
restart: always

python: image: alenx/walle-python:2.0 container_name: walle-python hostname: walle-python volumes:

networks: walle-net: driver: bridge

AlenxHai commented 5 years ago

你好,MYSQL_ROOT_PASSWORD: root,这里是初始MySQL的的root密码,你修改了这里,可你使用的alenx/walle-python:2.0镜像中是使用默认的密码(walle).

AlenxHai commented 5 years ago

后面会做这方面的优化,人性化些

huangshaoming1995 commented 5 years ago

后面会做这方面的优化,人性化些

但是改回了walle也是报这个错误

huangshaoming1995 commented 5 years ago

后面会做这方面的优化,人性化些 我打算重启系统

huangshaoming1995 commented 5 years ago

后面会做这方面的优化,人性化些 改了也不能运行

huangshaoming1995 commented 5 years ago

后面会做这方面的优化,人性化些 下面的ip都在变化 "Access denied for user 'root'@'172.19.0.3'

huangshaoming1995 commented 5 years ago

后面会做这方面的优化,人性化些

下面的ip都在变化 "Access denied for user 'root'@'172.19.0.3'

Lu-Lucifer commented 5 years ago

"Access denied for user 'root'@'172.19.0.3'这个问题解决了嘛

huangshaoming1995 commented 5 years ago

嗯,我觉得不是设置密码错误

------------------ 原始邮件 ------------------ 发件人: "Alenx"notifications@github.com; 发送时间: 2019年4月22日(星期一) 下午4:37 收件人: "meolu/walle-web"walle-web@noreply.github.com; 抄送: "与天同乐"1828610680@qq.com; "Author"author@noreply.github.com; 主题: Re: [meolu/walle-web] docker启动报错 (#613)

"Access denied for user 'root'@'172.19.0.3'这个问题解决了嘛

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

AlenxHai commented 5 years ago

@LuciferJun1227 更新最新版本

Lu-Lucifer commented 5 years ago

@Alenx58 用了新的版本还是有问题啊

AlenxHai commented 5 years ago

@LuciferJun1227 什么问题,截图看下

Lu-Lucifer commented 5 years ago

@Alenx58 walle-python | sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'db' ([Errno 111] Connection refused)") (Background on this error at: http://sqlalche.me/e/e3q8) walle-python | Migration: [ fail ] 还是连不上数据库的问题

huangshaoming1995 commented 5 years ago

应该没问题了

------------------ 原始邮件 ------------------ 发件人: "Alenx"notifications@github.com; 发送时间: 2019年4月24日(星期三) 中午11:17 收件人: "meolu/walle-web"walle-web@noreply.github.com; 抄送: "与天同乐"1828610680@qq.com; "Author"author@noreply.github.com; 主题: Re: [meolu/walle-web] docker启动报错 (#613)

@LuciferJun1227 什么问题,截图看下

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

huangshaoming1995 commented 5 years ago

连接数据按照文档配置就行

------------------ 原始邮件 ------------------ 发件人: "Alenx"notifications@github.com; 发送时间: 2019年4月24日(星期三) 中午11:20 收件人: "meolu/walle-web"walle-web@noreply.github.com; 抄送: "与天同乐"1828610680@qq.com; "Author"author@noreply.github.com; 主题: Re: [meolu/walle-web] docker启动报错 (#613)

@Alenx58 walle-python | sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'db' ([Errno 111] Connection refused)") (Background on this error at: http://sqlalche.me/e/e3q8) walle-python | Migration: [ fail ] 还是连不上数据库的问题

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Lu-Lucifer commented 5 years ago

@Alenx58 @huangshaoming1995 界面是能开出来了,但是登录的时候显示网络异常请刷新重试

AlenxHai commented 5 years ago

@LuciferJun1227 数据库连接错误是你配置有问题,登录网络异常 看下日志

huangshaoming1995 commented 5 years ago

打印窗口是不是显示无法连接数据库?

------------------ 原始邮件 ------------------ 发件人: "Alenx"notifications@github.com; 发送时间: 2019年4月24日(星期三) 中午11:28 收件人: "meolu/walle-web"walle-web@noreply.github.com; 抄送: "与天同乐"1828610680@qq.com; "Mention"mention@noreply.github.com; 主题: Re: [meolu/walle-web] docker启动报错 (#613)

@Alenx58 @huangshaoming1995 界面是能开出来了,但是登录的时候显示网络异常请刷新重试

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Lu-Lucifer commented 5 years ago

u"Access denied for user 'root'@'172.31.0.3' (using password: YES)" 就是显示这个错误

------------------ 原始邮件 ------------------ 发件人: "huangshaoming1995"notifications@github.com; 发送时间: 2019年4月24日(星期三) 中午11:30 收件人: "meolu/walle-web"walle-web@noreply.github.com; 抄送: "Lucifer"690699341@qq.com; "Mention"mention@noreply.github.com; 主题: Re: [meolu/walle-web] docker启动报错 (#613)

打印窗口是不是显示无法连接数据库?

------------------ 原始邮件 ------------------ 发件人: "Alenx"notifications@github.com; 发送时间: 2019年4月24日(星期三) 中午11:28 收件人: "meolu/walle-web"walle-web@noreply.github.com; 抄送: "与天同乐"1828610680@qq.com; "Mention"mention@noreply.github.com;
主题: Re: [meolu/walle-web] docker启动报错 (#613)

@Alenx58 @huangshaoming1995 界面是能开出来了,但是登录的时候显示网络异常请刷新重试

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

AlenxHai commented 5 years ago

你的配置文件和docker-compose文件贴出来

Lu-Lucifer commented 5 years ago

@Alenx58

docker version: 18.06.0+

docker-compose version: 1.23.2+

OpenSSL version: OpenSSL 1.1.0h

version: "3.7" services: web: image: alenx/walle-web:2.1 container_name: walle-nginx hostname: nginx-web ports:

如果宿主机80端口被占用,可自行修改为其他port(>=1024)

  # 0.0.0.0:要绑定的宿主机端口:docker容器内端口80
  - "1180:80"
depends_on:
  - python
networks:
  - walle-net
restart: always

python: image: alenx/walle-python:2.1 container_name: walle-python hostname: walle-python env_file:

walle.env需和docker-compose在同级目录

  - ./walle.env
command: bash -c "cd /opt/walle_home/ && /bin/bash admin.sh migration &&  python waller.py"
expose:
  - "5000"
volumes:
  - /opt/walle_home/plugins/:/opt/walle_home/plugins/
  - /opt/walle_home/codebase/:/opt/walle_home/codebase/
  - /opt/walle_home/logs/:/opt/walle_home/logs/
  - /root/.ssh:/root/.ssh/
depends_on:
  - db
networks:
  - walle-net
restart: always

db: image: mysql container_name: walle-mysql hostname: walle-mysql env_file:

networks: walle-net: driver: bridge

Set MySQL/Rails environment

MYSQL_USER=root MYSQL_PASSWORD=walle MYSQL_DATABASE=walle MYSQL_ROOT_PASSWORD=walle MYSQL_HOST=db MYSQL_PORT=3306

AlenxHai commented 5 years ago

@LuciferJun1227 停止mysql镜像服务,删除这个文件/data/walle/mysql,重新启动

Lu-Lucifer commented 5 years ago

@Alenx58 可以了

AlenxHai commented 5 years ago

@LuciferJun1227 好的