
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
本镜像提供基于Apache Geode的配置服务器功能,用于集中管理应用配置数据。通过Geode的分布式缓存能力实现配置的持久化存储和高可用性,支持客户端通过标准HTTP API或Spring Cloud Config规范访问配置信息,适用于微服务架构中的配置集中管理需求。
启动定位器与缓存服务器
shell# 启动定位器 start locator --name=locator # 配置PDX序列化 configure pdx --read-serialized=true --disk-store=DEFAULT # 启动缓存服务器 start server --name=server1
创建配置存储区域
shell# 创建分区冗余持久化区域用于存储配置 create region --name=Properties --type=PARTITION_REDUNDANT_PERSISTENT
提交配置数据
通过HTTP API提交配置数据:
shellcurl -d '{"propertySources": [{"name" : "name", "source" : {"prop1" : "value1" } }]}' -H 'Content-Type: application/json' http://localhost:8888/environment/bank-acct-cdc-source/default/null
访问配置数据
通过浏览器或HTTP客户端访问配置:
shellopen http://localhost:8888/bank-acct-cdc-source/default
添加依赖
Maven
xml<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency>
Gradle
kotlindependencies { implementation 'org.springframework.cloud:spring-cloud-starter-config' }
配置客户端属性
在Spring应用配置文件中设置配置服务器地址:
propertiesspring.cloud.config.uri=http://localhost:8888
构建镜像
shellgradle clean build :applications:geode-config-server:bootBuildImage
标记与推送镜像
shelldocker tag geode-config-server:0.0.1-SNAPSHOT cloudnativedata/apache-geode-config-server:0.0.1-SNAPSHOT docker login docker push cloudnativedata/apache-geode-config-server:0.0.1-SNAPSHOT
通过命令行参数加载多应用配置:
shelljava -jar applications/geode-config-server/build/libs/geode-config-server-0.0.1-SNAPSHOT.jar --environment.json.array='[{ "name": "geode-config-server1", "propertySources": [ {"name" : "application.properties", "source" : { "server.port" : 8888, "spring.application.name" : "geode-config-server" } } ], "profiles": ["profiles"] }, { "name": "atm-rest-service", "propertySources": [ {"name" : "application.properties", "source" : { "server.port" : 4002, "spring.data.gemfire.pool.locators" : "localhost[10334]" } } ], "profiles": ["default"] }, { "name": "atm-geode-sink", "propertySources": [ {"name" : "application.properties", "source" : { "server.port" : 0, "spring.data.gemfire.pool.locators" : "localhost[10334]", "spring.rabbitmq.stream.host" : "localhost", "spring.rabbitmq.host" : "localhost", "spring.rabbitmq.username" : "guest", "spring.rabbitmq.password" : "guest", "spring.cloud.stream.bindings.atmConsumer-in-0.consumer.declareExchange" : "false" } } ], "profiles": ["default"] } ]'
生成JKS密钥库用于安全配置:
shellkeytool -genkeypair -alias changemekey -keyalg RSA \ -dname "CN=Web Server,OU=Unit,O=Organization,L=City,S=State,C=US" \ -keypass changeme -keystore server.jks -storepass changeme
JSON格式的配置示例:
json{ "id": "***", "propertySources": [ {"name" : "application.properties", "source" : { "server.port" : 8888, "spring.application.name" : "geode-config-server" } } ], "profiles": ["profiles"], "name": "geode-config-server" }
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

来自真实用户的反馈,见证轩辕镜像的优质服务