# consul **Repository Path**: chenbool/consul ## Basic Information - **Project Name**: consul - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-28 - **Last Updated**: 2026-04-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Consul 快速入门 ## 简介 Consul 是 HashiCorp 公司开源的服务发现和配置中心工具,提供以下核心功能: - **服务发现**:支持 DNS 或 HTTP 接口注册和发现服务 - **健康检查**:提供健康检查机制,支持多种检查方式 - **键值存储**:分布式键值存储,用于配置共享 - **多数据中心**:支持多数据中心部署 ## Web UI 访问地址:http://127.0.0.1:8500/ui/dc1/services ## 常用命令 ### 启动服务(开发模式) ```bash consul agent -server -bootstrap -advertise 127.0.0.1 -data-dir ./data -ui ``` ### 启动服务(生产模式) ```bash consul.exe agent -server -bootstrap -bind=127.0.0.1 -client=0.0.0.0 -node=server1 -data-dir=./data -ui ``` ### 查看节点 ```bash consul members ``` ### 注册服务 ```bash consul services register -name=web -port=8080 ``` ### 注销服务 ```bash consul services deregister -id=web ``` ## 参考资料 https://www.cnblogs.com/angelyan/p/11157176.html