ERD-Online
ERD-Online copied to clipboard
使用docker启动起来了,只是无法接口报502
: 502 Bad Gateway 请求网址: http://192.168.144.16:9669/ncnb/project/recent?page=1&limit=6&order=updateTime 请求方法: GET 状态代码: 502 Bad Gateway 远程地址: 192.168.144.16:9669
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7740a720ad03 erdonline/erd-auth:latest "/bin/sh -c './xjar …" 49 minutes ago Up 31 seconds 9400/tcp erd-auth 4b8025242296 erdonline/erd-gateway:latest "/bin/sh -c './xjar …" 49 minutes ago Up 14 minutes 0.0.0.0:9502->9502/tcp, :::9502->9502/tcp, 9527/tcp erd-gateway 5a9162d36489 erdonline/erd-zerocode:latest "/bin/sh -c './xjar …" 49 minutes ago Up 8 seconds 9606/tcp erd-zerocode 9dc13190ae19 erdonline/erd-system:latest "/bin/sh -c './xjar …" 49 minutes ago Up 27 seconds 9404/tcp erd-system 03c252bf7734 erdonline/erd-nacos:latest "/docker-entrypoint.…" 49 minutes ago Up 14 minutes 0.0.0.0:8848->8848/tcp, :::8848->8848/tcp, 80/tcp, 0.0.0.0:9555->9555/tcp, :::9555->9555/tcp, 9669/tcp, 0.0.0.0:9848->9848/tcp, :::9848->9848/tcp erd-nacos 69fb6e75c1d4 erdonline/erd-mysql:latest "docker-entrypoint.s…" 50 minutes ago Up 14 minutes 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp erd-mysql d489fc331001 erdonline/erd-redis:latest "docker-entrypoint.s…" 50 minutes ago Up 14 minutes 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp erd-redis c9bf6fcadb60 erdonline/erd-ui:latest "/docker-entrypoint.…" 50 minutes ago Up 14 minutes 80/tcp, 0.0.0.0:9669->9669/tcp, :::9669->9669/tcp erd-ui 18ac09217a92 erdonline/erd-minio:latest "/usr/bin/docker-ent…" 50 minutes ago Up 14 minutes 0.0.0.0:9000-9001->9000-9001/tcp, :::9000-9001->9000-9001/tcp minio
使用下面命令,获取实时日志最后50行: docker-compose logs -f -t --tail=50 再次刷新功能,看下日志有没有错误记录! 另外,可以参看这篇文章,https://www.zerocode.net.cn/thread/57
java.net.ConnectException: [NACOS HTTP-GET] The maximum number of tolerable server reconnection errors has been reached
erd-system | Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. erd-system | erd-system | Reason: Failed to determine a suitable driver class erd-system | erd-system | erd-system | Action: erd-system | erd-system | Consider the following: erd-system | If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. erd-system | If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active). erd-system | erd-system | panic: exit status 1
看起来像是服务没有连接到nacos,导致获取不到数据库配置
检查下mysql、nacos是否正常。http://192.168.144.16:8848/nacos,可以访问你本地的nacos。
进入docker容器后什么命令都不识别,如何查看? 刚接触docker
[root@k1 docker]# docker exec -it erd-nacos sh
ip addr
sh: 3: ip: not found
ps
sh: 4: ps: not found
yum
sh: 6: yum: not found
不用进docker排查,在外面用docker-compose命令基本上就可以排查出问题了
mysql远程都可以连接,不知道nacos容器在哪里,就是好多连接不上nacos异常。哎。
你这模块nacos镜像和nacos有什么关系吗?没有看出来。
[yujikuan@hadoop1 docker]$ docker history erdonline/erd-nacos
\IMAGE CREATED CREATED BY SIZE COMMENT
ad0e5bff0de0 2 weeks ago CMD ["/bin/bash" "-c" "/usr/share/nginx/html… 0B buildkit.dockerfile.v0
搭了好几遍 ,都是这个问题 502 nacos 问题
搭了好几遍 ,都是这个问题 502 nacos 问题
需要更多的日志信息,才能帮助你排查问题
可以按照以下顺序,逐步定位: 1、只启动erd-mysql:docker-compose up erd-mysql 2、只启动erd-mysql、erd-nacos:docker-compose up erd-mysql erd-nacos 3、只启动erd-mysql、erd-nacos、erd-auth:docker-compose up erd-mysql erd-nacos erd-auth
erd-mysql |
erd-mysql | 2023-04-22 10:29:26+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/1schema.sql
erd-mysql |
erd-mysql |
erd-mysql | 2023-04-22 10:29:26+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/2erd.sql
erd-mysql |
erd-mysql |
erd-mysql | 2023-04-22 10:29:27+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/3martin.sql
erd-mysql |
erd-mysql |
erd-mysql | 2023-04-22 10:29:28+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/4nacos.sql
erd-mysql |
erd-mysql |
erd-mysql | 2023-04-22 10:29:29+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/5privileges.sql
erd-mysql |
erd-mysql |
erd-mysql | 2023-04-22 10:29:29+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/install_db.sh
erd-mysql | /docker-entrypoint-initdb.d/install_db.sh: line 6: warning: here-document at line 1 delimited by end-of-file (wanted `EOF')
erd-mysql | mysql: [Warning] Using a password on the command line interface can be insecure.
erd-mysql | ERROR 1007 (HY000) at line 2 in file: '/usr/local/work/1schema.sql': Can't create database 'erd'; database exists
ERROR 1007 (HY000) at line 2 in file: '/usr/local/work/1schema.sql': Can't create database 'erd'; database exists
单独启动mysql报这个错误
erd-mysql | erd-mysql | 2023-04-22 10:29:26+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/1schema.sql erd-mysql | erd-mysql | erd-mysql | 2023-04-22 10:29:26+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/2erd.sql erd-mysql | erd-mysql | erd-mysql | 2023-04-22 10:29:27+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/3martin.sql erd-mysql | erd-mysql | erd-mysql | 2023-04-22 10:29:28+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/4nacos.sql erd-mysql | erd-mysql | erd-mysql | 2023-04-22 10:29:29+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/5privileges.sql erd-mysql | erd-mysql | erd-mysql | 2023-04-22 10:29:29+08:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/install_db.sh erd-mysql | /docker-entrypoint-initdb.d/install_db.sh: line 6: warning: here-document at line 1 delimited by end-of-file (wanted `EOF') erd-mysql | mysql: [Warning] Using a password on the command line interface can be insecure. erd-mysql | ERROR 1007 (HY000) at line 2 in file: '/usr/local/work/1schema.sql': Can't create database 'erd'; database exists
ERROR 1007 (HY000) at line 2 in file: '/usr/local/work/1schema.sql': Can't create database 'erd'; database exists
单独启动mysql报这个错误
1、应该是重复创建erd数据库了,解决办法如下,注意命令后面有个点: docker cp 容器ID:/usr/local/work/1schema.sql . 2、修改1schema.sql ,删除新建erd的重复命令,下面命令应该有两行,删掉一行: CREATE DATABASE test; 3、将文件重新放回容器: docker cp 1schema.sql 容器ID:/usr/local/work/1schema.sql
nacos数据库连接需要在URL中加上参数 &serverTimezone=UTC,否则nacos一直报No DataSource set