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.
Related Issues (20)
- OceanBase 兼容问题 HOT 10
- apollo python 客户端 HOT 4
- configservice内部的Eureka注册服务,如何删除失效的实例。 HOT 3
- 开启密钥认证后,不生效 HOT 3
- upload properties by openapi can not upload note HOT 4
- use apollo openapi create properties file, can not create explanatory note HOT 26
- 低版本升级最新版本 sql结构更新问题 HOT 5
- 关于使用yaml配置的问题 HOT 2
- 缺乏用户管理相关的开放 API HOT 5
- 删除项目后异常 HOT 5
- 怎么没有mapper.xml文件 HOT 3
- 使用 H2 内存数据库,自动初始化快速启动失败,日志并没有错误日志,请问这是什么原因? HOT 8
- The management platform has added a new global configuration search feature HOT 3
- Spring 中 ConfigurationProperties 配置热更新问题 HOT 5
- 2.1.0版本,非 properties 格式的公共配置文件如yml的继承是否依然是在整个文件内容粒度进行,如果是请明确告知用户 HOT 5
- 增加不同环境下所有namespace的一键同步 HOT 3
- Add more observability in apollo config client HOT 2
- 请教 Bash 脚本如何请求开启了访问密钥的配置项 HOT 6
- When is the 2.3.0 release scheduled? HOT 2
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.