Comments (5)
Hey @starsky20, back for more Apollo adventures, I see! 🚀
Based on the error log you provided, it seems that the Apollo service is trying to resolve a hostname (apollo.meta
) that is not defined in your environment or DNS settings. This typically happens when the application tries to connect to a server with a hostname that cannot be resolved to an IP address.
In the Apollo codebase, the apollo.meta
hostname is referenced in the context of loading meta server addresses. This is done by looking for keys that end with "_meta" (for system properties and OS environment variables) and ".meta" (for user's configuration files) in a case-insensitive manner. The relevant code segments are found in the DefaultPortalMetaServerProvider
class, specifically in the methods getDomainsFromSystemProperty()
, getDomainsFromOSEnvironment()
, and getDomainsFromPropertiesFile()
. These methods are responsible for loading the meta server addresses from the system properties, OS environment variables, and properties file (apollo-env.properties
), respectively. You can find this in the DefaultPortalMetaServerProvider.java file.
To resolve this issue, you have a couple of options:
-
Define
apollo.meta
in your Hosts File: Ifapollo.meta
is supposed to point to a specific IP address, you can manually add an entry to your hosts file to resolve this hostname to the correct IP. This is done by editing thehosts
file on your system (/etc/hosts
on Linux/macOS,C:\Windows\System32\drivers\etc\hosts
on Windows) and adding a line like127.0.0.1 apollo.meta
(replace127.0.0.1
with the actual IP address if it's not meant to point to localhost). -
Update Your Application Configuration: If the usage of
apollo.meta
is a mistake or if it should be replaced with one of the defined meta server URLs (dev_meta
,fat_meta
,uat_meta
,pro_meta
), update your application's configuration to use the correct meta server URL based on your environment.
Without more specific details on where apollo.meta
is being referenced in your application, these are general approaches to resolve the java.net.UnknownHostException
. You'll need to identify where apollo.meta
is being used (e.g., in application properties, environment variables, or code) and apply one of the above solutions accordingly.
I also found a similar issue in the Apollo repository: apollo客户端无法获取项目下apollo-env.properties中的dev.meta地址. The suggested solution there is to ensure that the server.properties
file is correctly placed in the C:\opt\settings\
directory and that the file does not have a hidden extension like .txt
. Also, verify that the apollo-env.properties
file is placed in the correct location, which should be the resources
directory, and ensure that this directory is marked as a resource folder in your project settings. Lastly, make sure that the environment is set correctly, for example, env=DEV
or env=dev
, and that the apollo-env.properties
file contains the correct property for the environment, such as dev.meta
.
If the issue persists, consider debugging the com.ctrip.framework.apollo.core.internals.LegacyMetaServerProvider#getMetaServerAddress(com.ctrip.framework.apollo.core.enums.Env)
logic and the com.ctrip.framework.apollo.core.MetaDomainConsts#initMetaServerAddress
to find out why the dev.meta
is not being retrieved.
I hope this helps! If you need further assistance, please provide more details about your configuration and where apollo.meta
is being referenced in your application.
Sources
- apollo客户端无法获取项目下apollo-env.properties中的dev.meta地址
- scripts/build.bat
- apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/DefaultPortalMetaServerProvider.java
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from apollo.
按照您提供的解决办法,分别验证了以下几种办法:
1.在apollo-env.properties设置中设置dev.meta=http://192.168.3.174:8080、apollo.meta=http://192.168.3.174:8080
2.在C:\opt\settings\server.properties 文件中添加env=DEV
3.启动增加jvm参数 -Dapollo_profile=github -Denv=dev -Dapollo.meta=http://192.168.3.174:8080
以上三种方式都不可以,还是提示无法java.net.UnknownHostException: apollo.meta。调试代码后发现是env环境没有生效导致。
通过打成jar包后,修改application.yml的激活环境为github,dev,auth,然后在命令行直接执行 java -jar apollo-portal-2.3.0-SNAPSHOT.jar 启动无任务问题。
from apollo.
可以在系统信息页面看到详情
from apollo.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
from apollo.
This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.
from apollo.
Related Issues (20)
- Portal 模块 RestTemplate 支持配置 ConnectionTimeToLive
- apollo2.1.0集成pgsql,求给一份pgsql的sql文件。mysql的不可以用 HOT 4
- 无法删除旧的配置 HOT 7
- 在项目namespace数量比较多的情况下(大约1000个),打开页面加载速度很慢,比较影响用户体验,这个是否有什么优化改进方案? HOT 8
- Apollo是否可以支持按照key维度来发布? HOT 4
- 1.8.0,接入一个app.id 使用多个namespace的时候,多个namesapce均开启了accesskey.sercet,这时候接入的配置代码要怎么写呢 HOT 3
- OidcLocalUserService throw an Exception when executing createLocalUser in OIDC profile HOT 6
- 麻烦问下,有什么办法能同时读到多个环境同一个配置的值吗? HOT 4
- 使用客户端添加string类型的配置项时会报错 HOT 2
- 配置从 2.1.0导出,导入到 2.2.0,数据中时间解析失败 HOT 1
- 在 apollo-portal统一增加访问路径的前缀/apollo 时,导入配置的请求url 有部分没有添加前缀 HOT 2
- apollo-portal 使用统一前缀/apollo以后,创建集群失败 HOT 2
- k8s部署apollo 接入ldap报错 HOT 3
- 请问有大佬已经在2.2.0版本上,数据源由mysql切换至pg了嘛? HOT 1
- 脚本启动与停止的问题 HOT 3
- 删除App后,相似的AppID权限异常,并无法恢复 HOT 4
- dockerfile基础镜像漏洞 HOT 4
- 使用docker安装apollo 镜像里面的demo.sh缺少读取环境变量的逻辑 HOT 2
- yml读取k-v的值错误 HOT 2
- Beautify Portal TraceLog UI interface
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 apollo.