Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问集成客户端到自己应用时,fat_meta的地址可以配置在哪里? #591

Closed
myfreeway opened this issue Apr 12, 2017 · 5 comments

Comments

@myfreeway
Copy link

您好!
我已集成客户端到自己应用,在部署的时候,需要配置2个东西:
evn=fat
fat_meta=http://fat.config:8080
evn我用的方式是写入/opt/settings/server.properties文件。
但是fat_meta除了可以放在startup.sh脚本里,还能放在哪里呢?我不想修改startup.sh脚本。
我尝试过etc/profiles,发现没用。
谢谢!

@nobodyiam
Copy link
Member

可以作为system property传进来,比如-Dfat_meta=http://fat.config:8080

@nobodyiam
Copy link
Member

另外fat_meta不是放在startup.sh脚本的,是maven打包到apollo-core.jar中的apollo-env.properties,所以一次打包就后顾无忧啦

@myfreeway
Copy link
Author

顺序有点小问题。
1、首先mvn clean deploy,打包放进maven仓库。这时apollo-core.jar中的apollo-env.properties是原始的“fat.meta=${fat_meta}”。
2、修改build.sh,设置fat_meta=http://fat.config:8080。执行build.sh,打出部署Apollo的包。
3、开发应用A,集成Apollo client。关键来了。这时从maven仓库拉回来的apollo-core.jar,apollo-env.properties是原始的“fat.meta=${fat_meta}”。
4、发布应用A,这时fat.meta=${fat_meta}。so这时只能修改tomcat的startup.sh,放-Dfat_meta=http://fat.config:8080进去。不然启动失败。

@nobodyiam
Copy link
Member

倒不是顺序问题,我们的文档没有说过要自己mvn clean deploy吧。。都是通过build.sh打出apollo-core.jar,然后上传到nexus仓库的。

@myfreeway
Copy link
Author

写死到jar包也有好处。减少配置。
不然还得每个服务器,设置环境变量。(如果修改代码,让他支持从环境变量覆盖这些值的话)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants