快速入门:设置 Azure Spring Cloud Config ServerQuickstart: Set up Azure Spring Cloud configuration server

Azure Spring Cloud 配置服务器是分布式系统的集中式配置服务。Azure Spring Cloud Config server is a centralized configuration service for distributed systems. 它使用当前支持本地存储、Git 和 Subversion 的可插入存储库层。It uses a pluggable repository layer that currently supports local storage, Git, and Subversion. 在此快速入门中,你将设置配置服务器以从 Git 存储库获取数据。In this quickstart, you set up the config server to get data from a Git repository.

Azure Spring Cloud Config Server 是分布式系统的集中式配置服务。Azure Spring Cloud Config server is centralized configuration service for distributed systems. 它使用当前支持本地存储、Git 和 Subversion 的可插入存储库层。It uses a pluggable repository layer that currently supports local storage, Git, and Subversion. 设置 Config Server,将微服务应用部署到 Azure Spring Cloud。Set up the config server to deploy microservice apps to Azure Spring Cloud.

先决条件Prerequisites

Azure Spring Cloud Config Server 过程Azure Spring Cloud config server procedures

以下过程使用 Azure 门户设置 Config Server,以部署 Piggymetrics 示例The following procedure sets up the config server using the Azure portal to deploy the Piggymetrics sample.

  1. 转到服务的“概览”页,选择“配置服务器”。 Go to the service Overview page and select Config Server.

  2. 在“默认存储库”部分,将“URI”设置为“https://github.com/Azure-Samples/piggymetrics-config” 。In the Default repository section, set URI to "https://github.com/Azure-Samples/piggymetrics-config".

  3. 单击 “验证”Click Validate.

    导航到配置服务器

  4. 完成验证后,请单击“应用”以保存更改。When validation is complete, click Apply to save your changes.

    正在验证配置服务器

  5. 更新配置可能需要几分钟。Updating the configuration can take a few minutes.

    正在更新配置服务器

  6. 配置完成后,会收到通知。You should get a notification when the configuration is complete.

提示

如果将专用存储库用于配置服务器,请参阅介绍设置身份验证的教程If you are using a private repository for config server, please refer to our tutorial on setting up authentication.

Azure Spring Cloud Config Server 的故障排除Troubleshooting of Azure Spring Cloud config server

以下过程说明如何对 Config Server 设置进行故障排除。The following procedure explains how to troubleshoot config server settings.

  1. 在 Azure 门户中,转到服务“概览”页,然后选择“日志” 。In the Azure portal, go to the service Overview page and select Logs.

  2. 选择“查询”和“显示包含‘错误’或‘异常’术语的应用程序日志” 。Select Queries and Show the application logs that contain the "error" or "exception" terms".

  3. 单击 “运行”Click Run.

  4. 如果在日志中发现错误“java.lang.illegalStateException”,则表明 Spring Cloud Service 无法从 Config Server 中找到属性。If you find the error java.lang.illegalStateException in logs, this indicates that spring cloud service cannot locate properties from config server.

    ASC 门户运行查询 ASC portal run query

  5. 转到服务“概述”页。Go to the service Overview page.

  6. 选择“诊断并解决问题”。Select Diagnose and solve problems.

  7. 选择“Config Server”检测程序。Select Config Server detector.

    ASC 门户诊断问题 ASC portal diagnose problems

  8. 单击“Config Server 运行状况检查”。Click Config Server Health Check.

    ASC 门户精灵 ASC portal genie

  9. 单击“Config Server 状态”以查看来自检测程序的详细信息。Click Config Server Status to see more details from the detector.

    ASC 门户运行状况状态 ASC portal health status

后续步骤Next steps

在此快速入门中,你创建了 Azure 资源,如果这些资源保留在订阅中,将继续产生费用。In this quickstart, you created Azure resources that will continue to accrue charges if they remain in your subscription. 如果不打算继续学习下一个快速入门,请参阅清理资源If you don't intend to continue on to the next quickstart, see Clean up resources. 否则,请继续学习下一个快速入门:Otherwise, advance to the next quickstart: