调研skydns
详解地址
搭建单机版的etcd+skynds
- 第一步
$go get github.com/coreos/etcd
$cd ~/etcd
$./bin/etcd (还有一些参数可以随etcd启动,后面详解)
- 第二步
$go get -u github.com/skynetservices/skydns
$cd $GOPATH/src/github.com/skynetservices/skydns
$go build -v
- 第三步
$curl -XPUT http://127.0.0.1:4001/v2/keys/skydns/config \
-d value='{"dns_addr":"127.0.0.1:53","ttl":3600, "nameservers": ["8.8.8.8:53","8.8.4.4:53"]}'
$./skydns (还有一些参数可以随skydns启动,后面详解)
- 第四步
$curl -XPUT http://127.0.0.1:4001/v2/keys/skydns/local/skydns/wtf/wtf1 \
-d value='{
"host":"192.168.0.1",
"port":12345,
"priority":20,
"weight":100,
"text":"it is a info for this machine",
"ttl":3600,
"targetstrip":1,
"group":"g1"
}'
$nslookup wtf1.wtf.skydns.local
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: wtf1.wtf.skydns.local
Address: 192.168.0.1
- 第五步
至此表示skydns可以正常解析手动存进etcd中域名信息
转载于:https://my.oschina.net/u/2504205/blog/615230