搭建 etcd discovery 服务

栏目: 后端 · 发布时间: 4年前

内容简介:搭建单节点ETCD服务,如果已有ETCD服务,可以跳过搭建discovery服务,若使用已有ETCD服务,将搭建完成后检测服务是否正常

搭建单节点ETCD服务,如果已有ETCD服务,可以跳过

docker run -d -p 2479:2379 \
              -p 2480:2380 \
              -p 4401:4001 \
              -p 7401:7001 \
              --name etcd-discovery \
              elcolio/etcd:latest

搭建discovery服务,若使用已有ETCD服务,将 DISC_ETCD=http://<host_ip>:2479 改成 对应的ETCD服务地址和端口

# host_ip为运行discovery服务机子IP, port为相应的端口
docker run -d -p <port>:8087 \
           -e DISC_ETCD=http://<host_ip>:2479 \
           -e DISC_HOST=http://<host_ip>:<port> \
           --name discovery \
           quay.io/coreos/discovery.etcd.io:latest

搭建完成后检测服务是否正常

curl http://<host_ip>:<port>/new?size=1

# 正常输出
http://<host_ip>:<port>/b7e6f290697cb7b3c086956a257e9b8d

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Letting Go of the Words

Letting Go of the Words

Janice (Ginny) Redish / Morgan Kaufmann / 2007-06-11 / USD 49.95

"Redish has done her homework and created a thorough overview of the issues in writing for the Web. Ironically, I must recommend that you read her every word so that you can find out why your customer......一起来看看 《Letting Go of the Words》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试