-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
=charlie
committed
Nov 15, 2021
1 parent
8d2d1d4
commit 2990300
Showing
10 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
consul 启动 | ||
服务编排的方式 | ||
sudo docker-compose -f docker/docker-compose.yml up | ||
|
||
或者用最简单的容器,启动 | ||
docker run -d --name=cs -p 8500:8500 consul agent -server -bootsrap -ui -client 0.0.0.0 | ||
-ui 内置web 界面 | ||
-clent | ||
-bootsrap 指定自己为leader | ||
|
||
之间查看服务列表 | ||
http://192.168.1.124:8500/v1/agent/services | ||
|
||
手动注册服务提交 | ||
|
||
curl \ | ||
--request PUT \ | ||
http://127.0.0.1:8500/v1/agent/service/deregister/redis1 | ||
|
||
curl \ | ||
--request PUT \ | ||
--data @p.json \ | ||
http://127.0.0.1:8500/v1/agent/service/register?replace-existing-checks=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: '2' | ||
|
||
services: | ||
consul: | ||
image: progrium/consul:latest | ||
ports: | ||
- 8400:8400 | ||
- 8500:8500 | ||
- 8600:53/udp | ||
hostname: consulserver | ||
command: -server -bootstrap -ui-dir /ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"ID": "userservice1", | ||
"Name": "userservice", | ||
"Tags": ["primary", "v1"], | ||
"Address": "192.168.1.124", | ||
"Port": 8080, | ||
"Meta": { | ||
"userservice_version": "4.0" | ||
}, | ||
"EnableTagOverride": false, | ||
"Check": { | ||
"HTTP": "http://192.168.1.124:8080/health", | ||
"Interval": "10s" | ||
}, | ||
"Weights": { | ||
"Passing": 10, | ||
"Warning": 1 | ||
} | ||
} |