consul使用

新增注册服务

consul services register --name=your-service-name --address=your-service-ip --port=your-service-port

 删除服务

consul services deregister -id=your-service-id
http方式
curl --location --request PUT 'http://ip:8500/v1/catalog/deregister' \
--header 'Content-Type: application/json' \
--data-raw '{
  "Datacenter": "dc-name",
  "Node": "node-name",
  "ServiceID": "your-service-id"
}'

 

问题:删除可能不生效,删了还在?

posted @ 2023-05-08 15:06  szcj~  阅读(10)  评论(0编辑  收藏  举报