Comments (9)
已经指定了DEV_DB
,就不要指定DEV_URL
,Portal
的环境参数里已经说明了.
from docker-apollo.
from docker-apollo.
MetaServer的地址就是Config服务,假设你想起来dev环境的,那就指定DEV_DB
,DEV_DB_USER
,DEV_DB_PWD
,并把端口暴露出来,可以使用host网络模式,然后你访问ip+port(没指定那就是默认的8080)
from docker-apollo.
dev_meta和数据库不在服务器,这样改是不是只有dev_meta和数据库在同一个服务器才启效果呢?我现在的compose是:
version: '2'
services:
apollo:
image: idoop/docker-apollo:latest
# portal若出现504错误,则将网络模式改为host. host模式下如果想改端口,参考下方修改端口的环境变量
#network_mode: "host"
# 如果需要查看日志,挂载容器中的/opt路径出来即可.
volumes:
- /data/apollo/logs:/opt
ports:
- "8070:8070"
- "8080:8080"
- "8090:8090"
environment:
# 开启Portal,默认端口: 8070
PORTAL_DB: jdbc:mysql://192.168.1.249:3306/ApolloPortalDB?characterEncoding=utf8
PORTAL_DB_USER: root
PORTAL_DB_PWD: hurongbao123456
#DEV_URL: http://192.168.1.240:8080
# 开启dev环境, 默认端口: config 8080, admin 8090
DEV_DB: jdbc:mysql://192.168.1.249:3306/ApolloConfigDBDev?characterEncoding=utf8
DEV_DB_USER: root
DEV_DB_PWD: hurongbao123456
DEV_LB: 192.168.1.240
# 开启dev环境, 默认端口: config 8080, admin 8090
#FAT_DB: jdbc:mysql://192.168.1.249:3306/ApolloConfigDBFAT?characterEncoding=utf8
#FAT_DB_USER: root
#FAT_DB_PWD: hurongbao123456
#FAT_LB: 192.168.1.240
networks:
default:
external:
name: net-spring-db
启动之后报:
from docker-apollo.
你的docker-compose没问题,应该是数据库配置问题,确认ApolloPortalDB
库中ServerConfig
表的apollo.portal.envs
字段已中填上dev
,确认ApolloConfigDBDev
库中ServerConfig
表的eureka.service.url
字段为http://localhost:8080/eureka/
.因为你是在同一个容器中起来portal和dev环境,所以可以填localhost
.然后可以先用host
网络模式,方便排除网络问题,没问题了再用NAT网络和指定端口.
version: '2'
services:
apollo:
image: idoop/docker-apollo:latest
network_mode: "host"
volumes:
- /data/apollo/logs:/opt
environment:
PORTAL_DB: jdbc:mysql://192.168.1.249:3306/ApolloPortalDB?characterEncoding=utf8
PORTAL_DB_USER: root
PORTAL_DB_PWD: hurongbao123456
DEV_DB: jdbc:mysql://192.168.1.249:3306/ApolloConfigDBDev?characterEncoding=utf8
DEV_DB_USER: root
DEV_DB_PWD: hurongbao123456
from docker-apollo.
如果把DEV_LB去掉就没问题了,但是其它服务就获取不了配置。
from docker-apollo.
LB是给分布式的时候用的.
是第一次用Apollo吗?是的话,建议你还是按官方手动部署完用段时间,了解Apollo大概用法了,再来使用这个镜像吧.
from docker-apollo.
问题解决了,是网络原因,谢谢解答,顺便提一个问题:apollo系统信息中Meta server一直是地址: http://localhost:8080/,有什么办法可以设置真实IP或者域名,就像您提到的使用了DEV_URL就不能设置DEV_DB了,有什么办法可以两者不相互影响?
from docker-apollo.
建议你看一下wiki,里面有几种用法,可能会有所帮助.
from docker-apollo.
Related Issues (20)
- k8s部署了一个开发环境,protal报错,登录页面没有可以添加项目 HOT 10
- wiki的部署portal中部署有问题 HOT 4
- docker-compose.yaml 部署/启动失败 HOT 4
- k8s部署dev,启用了admin,但portal访问不到apollo-dev HOT 4
- invalid config port env in Dockerfile HOT 1
- Cannot execute request on any known server. HOT 19
- K8S部署了portal之后外网如何访问 HOT 3
- 1.4.0了 求更新 HOT 1
- 外网访问怎么配置 HOT 3
- 是否可以支持jvm参数优化 HOT 3
- eureka返回内网地址,导致本地测试无法连接 HOT 4
- config server地址问题 HOT 8
- EUREKA_INSTANCE_HOME_PAGE_URL环境变量设置 HOT 2
- how to config eureka.instance.ip-address in yml HOT 1
- 是否有文件包含漏洞
- please add the latest version
- 不支持自定义环境 HOT 1
- 启动之后,无法访问,且没有端口占用 HOT 3
- 什么时候升级到1.8.1啊? HOT 1
- 启用[访问密钥后],客户端不加验证依然可以访问 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-apollo.