- 浏览: 1444318 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
### 安装
[centos7上consul的安装](http://www.cnblogs.com/wang2650/p/5473881.html)
wget https://releases.hashicorp.com/consul/0.6.4/consul_0.6.4_linux_amd64.zip
consul -v
json格式化
```shell
yum -y install epel-release
yum install jq -y
consul agent -server -bootstrap-expect 2 -data-dir /tmp/consul -node=n1 -bind=192.168.139.194 -dc=dc1
consul agent -server -bootstrap-expect 2 -data-dir /tmp/consul -node=n2 -bind=192.168.139.218 -dc=dc1
consul agent -server -bootstrap-expect 2 -data-dir /tmp/consul -node=n2 -bind=192.168.139.193 -dc=dc1
consul agent -server -bootstrap-expect 2 -data-dir /tmp/consul -node=n2 -bind=192.168.139.161 -dc=dc1
```
在第一个节点上
consul join 192.168.139.218
#######################################
如果发现集群有问题,就 rm -rf /tmp/consul
mkdir /tmp/consul
#####################################
[consul入门](http://blog.csdn.net/viewcode/article/details/45915179)
[服务发现系统consul介绍](http://www.codeweblog.com/%E6%9C%8D%E5%8A%A1%E5%8F%91%E7%8E%B0%E7%B3%BB%E7%BB%9Fconsul%E4%BB%8B%E7%BB%8D/)
# 例子1
mkdir /etc/consul.d/
echo '{"service": {"name": "web", "tags": ["rails"], "port": 80}}' >/etc/consul.d/web.json
consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul -bind=192.168.139.218 -config-dir /etc/consul.d
dig @127.0.0.1 -p 8600 web.service.consul
dig @127.0.0.1 -p 8600 web.service.consul SRV
curl http://localhost:8500/v1/catalog/service/web |jq
curl http://localhost:8500/v1/catalog/nodes |python -m json.tool
dig @127.0.0.1 -p 8600 mcompute616.node.consul
健康检查
echo '{"check": {"name": "ping", "script": "ping -c1 www.baidu.com >/dev/null", "interval": "30s"}}' >/etc/consul.d/ping.json
echo '{"service": {"name": "web", "tags": ["rails"], "port": 80 ,"check": {"script": "curl localhost:80 >/dev/null 2>&1", "interval": "10s"}}}' >/etc/consul.d/web.json
curl -s http://localhost:8500/v1/health/state/any | python -m json.tool
查看所有
curl -v http://127.0.0.1:8500/v1/kv/?recurse | python -m json.tool
curl -X PUT -d 'test' http://127.0.0.1:8500/v1/kv/web/key1
curl -X PUT -d 'test' http://127.0.0.1:8500/v1/kv/web/key2?flags=42
curl -X PUT -d 'test' http://127.0.0.1:8500/v1/kv/web/web/sub/key3
查看一个
curl -s http://127.0.0.1:8500/v1/kv/web/key1|python -m json.tool
删除所有
curl -X DELETE http://127.0.0.1:8500/v1/kv/web/sub?recurse
修改(不好使呀)
curl -X PUT -d 'newval' http://127.0.0.1:8500/v1/kv/web/key1?cas=106
curl -X PUT -d 'newval' http://127.0.0.1:8500/v1/kv/web/key1?cas=106
curl -s http://127.0.0.1:8500/v1/kv/web/key1|python -m json.tool
### 例子2
consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul -node=agent-one -bind=192.168.139.218
#consul agent -data-dir /tmp/consul -node=agent-one -bind=192.168.139.218
consul agent -server -data-dir /tmp/consul
consul agent -data-dir /tmp/consul -node=agent-two -bind=192.168.139.194
consul agent -data-dir /tmp/consul -node=agent-three -bind=192.168.139.193
第一个节点
consul join 192.168.139.194 192.168.139.193
consul members
consul info
### 例子3
consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul -bind=192.168.139.218 -config-dir /etc/consul.d
consul agent -data-dir /tmp/consul -join=192.168.139.218 -bind=192.168.139.194
### 三台机器的测试
https://blog.coding.net/blog/intro-consul?type=hot
http://www.bubuko.com/infodetail-800623.html
consul agent -server -bootstrap -data-dir /tmp/consul -bind=192.168.139.218
consul agent -server -data-dir /tmp/consul -bind=192.168.139.194
consul agent -server -data-dir /tmp/consul -bind=192.168.139.193
第一个节点
consul join 192.168.139.194 192.168.139.193
ctl+c 断开第一个节点,之后
consul agent -server -data-dir /tmp/consul -bind=192.168.139.218
consul join 192.168.139.194 192.168.139.193
curl -X PUT -d '{"Datacenter": "dc1", "Node": "mysql-1", "Address": "mysql-1.node.consul","Service": {"Service": "mysql", "tags": ["master","v1"], "Port": 3306}}' http://127.0.0.1:8500/v1/catalog/register
curl -X PUT -d '{"Datacenter": "dc1", "Node": "mysql-2", "Address": "mysql-2.node.consul","Service": {"Service": "mysql", "tags": ["slave","v1"], "Port": 3306}}' http://127.0.0.1:8500/v1/catalog/register
curl http://127.0.0.1:8500/v1/catalog/service/mysql
curl http://127.0.0.1:8500/v1/catalog/service/mysql|python -m json.tool
curl 127.0.0.1:8500/v1/catalog/nodes |python -m json.tool
dig @127.0.0.1 -p 8600 mysql.service.consul SRV
### 健康检查
kill掉一个节点,consul members处于fail状态
curl http://localhost:8500/v1/health/state/critical
### K/V存储
curl -v http://localhost:8500/v1/kv/?recurse |python -m json.tool
curl -X PUT -d 'test' http://localhost:8500/v1/kv/mysql/key2?flags=43
curl -X DELETE http://localhost:8500/v1/kv/mysql/key2?recurse
curl -X PUT -d 'newval' http://localhost:8500/v1/kv/mysql/key1?flags=100
更新index:
curl "http://localhost:8500/v1/kv/mysql/key1?index=101&wait=5s"
##################################
consul agent -atlas-join -atlas=ATLAS_USERNAME/infrastructure -atlas-token="YOUR_ATLAS_TOKEN"
curl https://mysql.service.consul/v1/kv/my-key
{"service": {"name" : "test","port" : 9999,"check":{ "tcp": "127.0.0.1:9999", "interval": "10s" }} }
[consul-template入门篇](http://blog.csdn.net/daiyudong2020/article/details/53559008)
docker run -d --name=consul --net=host gliderlabs/consul-server -bootstrap -bind=192.168.0.149
docker run -d --name=registrator --net=host --volume=/var/run/docker.sock:/tmp/docker.sock gliderlabs/registrator:latest consulkv://localhost:8500/hello
consul-template -consul 127.0.0.1:8500 -template /root/nginx_web.ctmpl:/usr/local/nginx/conf/nginx.conf:"/usr/local/nginx/sbin/nginx -s reload"
curl -X PUT -d 'test' http://localhost:8500/v1/kv/hello/hehe?flags=43
curl -v http://localhost:8500/v1/kv/?recurse |python -m json.tool
### nginx的例子 ###
模板语言https://book-consul-guide.vnzmi.com/11_consul_template.html
删除所有
curl -X DELETE http://127.0.0.1:8500/v1/kv/?recurse
curl --request PUT --data "192.168.139.161" http://localhost:8500/v1/kv/myserver/mcontroller605
curl --request PUT --data "192.168.139.193" http://localhost:8500/v1/kv/myserver/mcompute605
curl -s http://localhost:8500/v1/kv/myserver?recurse | jq
consul-template -consul-addr 127.0.0.1:8500 -template /root/nginx_web.ctmpl:/usr/local/nginx/conf/nginx.conf:"/usr/local/nginx/sbin/nginx -s reload" -once
consul-template -config ./tmpl.json -once
nginx_web.ctmpl
```go
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream app {
{{range ls "myserver/" }}
server {{.Value}} weight=5;{{end}}
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://app;
}
}
}
```
tmpl.json
```javascript
consul = "127.0.0.1:8500"
template {
source = "./nginx_web.ctmpl"
destination = "/usr/local/nginx/conf/nginx.conf"
command = "/usr/local/nginx/sbin/nginx -s reload"
}
```
### consul-template 的helloword:
ls
config.ctmpl tmpl.json
tmpl.json
```javascript
consul = "127.0.0.1:8500"
template {
source = "./config.ctmpl"
destination = "./config.py"
command = "python ./config.py"
}
···
config.ctmpl
```python
#!/usr/bin/python
#coding:utf-8
#bottle
iplist = [ {{range service "web"}} "{{.Address}}",{{end}} ]
port = 8080
for ip in iplist:
print ip
```
consul-template -config ./tmpl.json -once
生成config.py
```shell
cat /etc/consul.d/web.json
{"service": {"name": "web", "tags": ["rails"], "port": 80 ,"check": {"script": "curl localhost:80", "interval": "10s"}}}
curl http://127.0.0.1:8500/v1/catalog/service/web|python -m json.tool
```
### kv的例子 ###
https://python-consul.readthedocs.io/en/latest/#consul-status
yum install python-virtualenv
virtualenv mysite
source mysite/bin/activate
pip install python-consul
a.py
```python
import consul
c = consul.Consul()
# poll a key for updates
index = None
while True:
index, data = c.kv.get('foo', index=index)
print data['Value']
# in another process
c.kv.put('foo', 'bar')
```
### 基本使用 ###
curl -v 是显示详细, -s是只显示结果
设置值
curl --request PUT --data "hello" http://localhost:8500/v1/kv/my-key
查所有值
curl -v http://localhost:8500/v1/kv/?recurse |python -m json.tool
查某个值
curl -v http://localhost:8500/v1/kv/my-key |python -m json.tool
显示值的value
curl -s http://127.0.0.1:8500/v1/kv/my-key| jq -r .[0]'.Value'|base64 -d
curl -s http://127.0.0.1:8500/v1/kv/foo| jq -r .[0]'.Value'|base64 -d
删除所有
curl -X DELETE http://127.0.0.1:8500/v1/kv/?recurse
[centos7上consul的安装](http://www.cnblogs.com/wang2650/p/5473881.html)
wget https://releases.hashicorp.com/consul/0.6.4/consul_0.6.4_linux_amd64.zip
consul -v
json格式化
```shell
yum -y install epel-release
yum install jq -y
consul agent -server -bootstrap-expect 2 -data-dir /tmp/consul -node=n1 -bind=192.168.139.194 -dc=dc1
consul agent -server -bootstrap-expect 2 -data-dir /tmp/consul -node=n2 -bind=192.168.139.218 -dc=dc1
consul agent -server -bootstrap-expect 2 -data-dir /tmp/consul -node=n2 -bind=192.168.139.193 -dc=dc1
consul agent -server -bootstrap-expect 2 -data-dir /tmp/consul -node=n2 -bind=192.168.139.161 -dc=dc1
```
在第一个节点上
consul join 192.168.139.218
#######################################
如果发现集群有问题,就 rm -rf /tmp/consul
mkdir /tmp/consul
#####################################
[consul入门](http://blog.csdn.net/viewcode/article/details/45915179)
[服务发现系统consul介绍](http://www.codeweblog.com/%E6%9C%8D%E5%8A%A1%E5%8F%91%E7%8E%B0%E7%B3%BB%E7%BB%9Fconsul%E4%BB%8B%E7%BB%8D/)
# 例子1
mkdir /etc/consul.d/
echo '{"service": {"name": "web", "tags": ["rails"], "port": 80}}' >/etc/consul.d/web.json
consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul -bind=192.168.139.218 -config-dir /etc/consul.d
dig @127.0.0.1 -p 8600 web.service.consul
dig @127.0.0.1 -p 8600 web.service.consul SRV
curl http://localhost:8500/v1/catalog/service/web |jq
curl http://localhost:8500/v1/catalog/nodes |python -m json.tool
dig @127.0.0.1 -p 8600 mcompute616.node.consul
健康检查
echo '{"check": {"name": "ping", "script": "ping -c1 www.baidu.com >/dev/null", "interval": "30s"}}' >/etc/consul.d/ping.json
echo '{"service": {"name": "web", "tags": ["rails"], "port": 80 ,"check": {"script": "curl localhost:80 >/dev/null 2>&1", "interval": "10s"}}}' >/etc/consul.d/web.json
curl -s http://localhost:8500/v1/health/state/any | python -m json.tool
查看所有
curl -v http://127.0.0.1:8500/v1/kv/?recurse | python -m json.tool
curl -X PUT -d 'test' http://127.0.0.1:8500/v1/kv/web/key1
curl -X PUT -d 'test' http://127.0.0.1:8500/v1/kv/web/key2?flags=42
curl -X PUT -d 'test' http://127.0.0.1:8500/v1/kv/web/web/sub/key3
查看一个
curl -s http://127.0.0.1:8500/v1/kv/web/key1|python -m json.tool
删除所有
curl -X DELETE http://127.0.0.1:8500/v1/kv/web/sub?recurse
修改(不好使呀)
curl -X PUT -d 'newval' http://127.0.0.1:8500/v1/kv/web/key1?cas=106
curl -X PUT -d 'newval' http://127.0.0.1:8500/v1/kv/web/key1?cas=106
curl -s http://127.0.0.1:8500/v1/kv/web/key1|python -m json.tool
### 例子2
consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul -node=agent-one -bind=192.168.139.218
#consul agent -data-dir /tmp/consul -node=agent-one -bind=192.168.139.218
consul agent -server -data-dir /tmp/consul
consul agent -data-dir /tmp/consul -node=agent-two -bind=192.168.139.194
consul agent -data-dir /tmp/consul -node=agent-three -bind=192.168.139.193
第一个节点
consul join 192.168.139.194 192.168.139.193
consul members
consul info
### 例子3
consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul -bind=192.168.139.218 -config-dir /etc/consul.d
consul agent -data-dir /tmp/consul -join=192.168.139.218 -bind=192.168.139.194
### 三台机器的测试
https://blog.coding.net/blog/intro-consul?type=hot
http://www.bubuko.com/infodetail-800623.html
consul agent -server -bootstrap -data-dir /tmp/consul -bind=192.168.139.218
consul agent -server -data-dir /tmp/consul -bind=192.168.139.194
consul agent -server -data-dir /tmp/consul -bind=192.168.139.193
第一个节点
consul join 192.168.139.194 192.168.139.193
ctl+c 断开第一个节点,之后
consul agent -server -data-dir /tmp/consul -bind=192.168.139.218
consul join 192.168.139.194 192.168.139.193
curl -X PUT -d '{"Datacenter": "dc1", "Node": "mysql-1", "Address": "mysql-1.node.consul","Service": {"Service": "mysql", "tags": ["master","v1"], "Port": 3306}}' http://127.0.0.1:8500/v1/catalog/register
curl -X PUT -d '{"Datacenter": "dc1", "Node": "mysql-2", "Address": "mysql-2.node.consul","Service": {"Service": "mysql", "tags": ["slave","v1"], "Port": 3306}}' http://127.0.0.1:8500/v1/catalog/register
curl http://127.0.0.1:8500/v1/catalog/service/mysql
curl http://127.0.0.1:8500/v1/catalog/service/mysql|python -m json.tool
curl 127.0.0.1:8500/v1/catalog/nodes |python -m json.tool
dig @127.0.0.1 -p 8600 mysql.service.consul SRV
### 健康检查
kill掉一个节点,consul members处于fail状态
curl http://localhost:8500/v1/health/state/critical
### K/V存储
curl -v http://localhost:8500/v1/kv/?recurse |python -m json.tool
curl -X PUT -d 'test' http://localhost:8500/v1/kv/mysql/key2?flags=43
curl -X DELETE http://localhost:8500/v1/kv/mysql/key2?recurse
curl -X PUT -d 'newval' http://localhost:8500/v1/kv/mysql/key1?flags=100
更新index:
curl "http://localhost:8500/v1/kv/mysql/key1?index=101&wait=5s"
##################################
consul agent -atlas-join -atlas=ATLAS_USERNAME/infrastructure -atlas-token="YOUR_ATLAS_TOKEN"
curl https://mysql.service.consul/v1/kv/my-key
{"service": {"name" : "test","port" : 9999,"check":{ "tcp": "127.0.0.1:9999", "interval": "10s" }} }
[consul-template入门篇](http://blog.csdn.net/daiyudong2020/article/details/53559008)
docker run -d --name=consul --net=host gliderlabs/consul-server -bootstrap -bind=192.168.0.149
docker run -d --name=registrator --net=host --volume=/var/run/docker.sock:/tmp/docker.sock gliderlabs/registrator:latest consulkv://localhost:8500/hello
consul-template -consul 127.0.0.1:8500 -template /root/nginx_web.ctmpl:/usr/local/nginx/conf/nginx.conf:"/usr/local/nginx/sbin/nginx -s reload"
curl -X PUT -d 'test' http://localhost:8500/v1/kv/hello/hehe?flags=43
curl -v http://localhost:8500/v1/kv/?recurse |python -m json.tool
### nginx的例子 ###
模板语言https://book-consul-guide.vnzmi.com/11_consul_template.html
删除所有
curl -X DELETE http://127.0.0.1:8500/v1/kv/?recurse
curl --request PUT --data "192.168.139.161" http://localhost:8500/v1/kv/myserver/mcontroller605
curl --request PUT --data "192.168.139.193" http://localhost:8500/v1/kv/myserver/mcompute605
curl -s http://localhost:8500/v1/kv/myserver?recurse | jq
consul-template -consul-addr 127.0.0.1:8500 -template /root/nginx_web.ctmpl:/usr/local/nginx/conf/nginx.conf:"/usr/local/nginx/sbin/nginx -s reload" -once
consul-template -config ./tmpl.json -once
nginx_web.ctmpl
```go
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream app {
{{range ls "myserver/" }}
server {{.Value}} weight=5;{{end}}
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://app;
}
}
}
```
tmpl.json
```javascript
consul = "127.0.0.1:8500"
template {
source = "./nginx_web.ctmpl"
destination = "/usr/local/nginx/conf/nginx.conf"
command = "/usr/local/nginx/sbin/nginx -s reload"
}
```
### consul-template 的helloword:
ls
config.ctmpl tmpl.json
tmpl.json
```javascript
consul = "127.0.0.1:8500"
template {
source = "./config.ctmpl"
destination = "./config.py"
command = "python ./config.py"
}
···
config.ctmpl
```python
#!/usr/bin/python
#coding:utf-8
#bottle
iplist = [ {{range service "web"}} "{{.Address}}",{{end}} ]
port = 8080
for ip in iplist:
print ip
```
consul-template -config ./tmpl.json -once
生成config.py
```shell
cat /etc/consul.d/web.json
{"service": {"name": "web", "tags": ["rails"], "port": 80 ,"check": {"script": "curl localhost:80", "interval": "10s"}}}
curl http://127.0.0.1:8500/v1/catalog/service/web|python -m json.tool
```
### kv的例子 ###
https://python-consul.readthedocs.io/en/latest/#consul-status
yum install python-virtualenv
virtualenv mysite
source mysite/bin/activate
pip install python-consul
a.py
```python
import consul
c = consul.Consul()
# poll a key for updates
index = None
while True:
index, data = c.kv.get('foo', index=index)
print data['Value']
# in another process
c.kv.put('foo', 'bar')
```
### 基本使用 ###
curl -v 是显示详细, -s是只显示结果
设置值
curl --request PUT --data "hello" http://localhost:8500/v1/kv/my-key
查所有值
curl -v http://localhost:8500/v1/kv/?recurse |python -m json.tool
查某个值
curl -v http://localhost:8500/v1/kv/my-key |python -m json.tool
显示值的value
curl -s http://127.0.0.1:8500/v1/kv/my-key| jq -r .[0]'.Value'|base64 -d
curl -s http://127.0.0.1:8500/v1/kv/foo| jq -r .[0]'.Value'|base64 -d
删除所有
curl -X DELETE http://127.0.0.1:8500/v1/kv/?recurse
发表评论
-
xl2tp 备份
2019-09-24 16:25 5752019年9月24日更新: 注意,需要开启firewall ... -
sdl笔记
2019-01-31 17:19 684sdl教程教程 https://github.com/Twin ... -
tinyemu
2019-01-24 17:59 1397参考https://bellard.org/jslinux/t ... -
aws搭建xl2tp给iphone使用
2018-12-26 21:37 18062019年12月26日 可以参考原来的配置 https:// ... -
lvs的helloworld
2017-06-13 20:36 560###################lvs######### ... -
系统调用的helloworld
2017-05-04 16:14 558《2.6内核标准教程》 p293 #include < ... -
bitcoin和cgminer的安装
2017-04-05 22:45 1920参考 http://blog.csdn.net/rion_ch ... -
ceph安装和常用命令
2017-03-21 21:55 912/etc/hosts ssh-keygen ssh-copy- ... -
mobile terminal 笔记
2016-12-02 15:35 546找出旧的iphone4 越狱之后可以变个小操作系统 mobi ... -
socket基础和select(python)
2016-06-14 17:21 1761上接 c语言的socket基础ht ... -
socket基础(c语言)
2016-06-14 16:45 939不使用select 普通的基础socket连接,对多个客户端的 ... -
ffmpeg+nginx 的直播(2,直播摄像头和麦克风)
2016-05-28 20:21 4256假设我的服务器是centos7 192.168.139.117 ... -
ffmpeg+nginx 的直播(1,直播播放的视频文件)
2016-05-26 17:11 651864位操作系统centos7 ############ 1.一 ... -
socat和netcat(nc)
2016-04-29 22:36 1674转 原文链接: http://www.wenquan.name ... -
neutron基础九(qemu nat网络)
2016-02-06 17:21 1556接上基础八,kvm透传nested忽略 1.在主机ce ... -
neutron基础八(qemu 桥接网络)
2016-02-06 13:13 1486qemu的桥接和nat的qemu启动命令是一样的,但是后续的脚 ... -
neutron基础七(qemu tap)
2016-02-02 17:02 969使用qemu 建立个虚拟机 然后用tap设备, 根据基础六,t ... -
neutron基础六(bridge fdb)
2016-01-28 18:30 2134转发表 在三台机器上建立三个namespace 192.16 ... -
南北流量
2016-01-23 23:26 1763一、三层网络架构: 接入层:负责服务器的接入和隔离 汇聚层:汇 ... -
neutron基础五(vxlans)
2016-01-19 16:01 2012架构图画的有点屎,凑合看 架构就是两台服务器 192.168 ...
相关推荐
不同于翻译自官方文档 的Consul 简介和快速入门,官网的文档太难懂了。 这个是来源于http://www.liangxiansen.cn/2017/04/06/consul/的文章。 看完基本的操作就很容易上手了。
Consul支持基本硬件资源方面的检查,如:CPU、内存、硬盘等 5.Key/Value存储 Consul支持Key/Value存储功能,可以将Consul作为配置中心使用,可以将一些公共配置信息配置到Consul,然后通过Consul提供的 HTTP API来...
也就是说,如果两次使用中间件的时间间隔比较长,那基本上等于要重新学习使用。 所以,我觉得学习中间件的文章,越详细越好;因为,这对作者而言也是一份珍贵的备忘资料。 Consul简介 Consul一个什么,我想大家通过...
设置consul_alerts 影响什么将特定版本的 consul-alerts 安装到您的系统用法puppet 模块安装 jlondon-consul_alerts 还支持包含在图书管理员木偶中该模块的使用非常基本,除了默认运行之外不需要太多: class { '...
领事 KV 缓存将存储在 consul 的 kv... 如果 watch 为基本名称为__sync的键触发,那么缓存将完全从 consul 重新填充。 此外,在缓存上使用 Delete 函数将设置__sync以便其他地方的其他缓存知道执行数据的完整重新读取。
本入门项目假设您对 Consul 的键值管理操作有基本的了解。 Spring Boot 自动配置 如果您正在开发 Spring Boot 应用程序,您可以在应用程序启动的引导阶段将属性注入到应用程序上下文中。 此时注入属性允许您利用...
PIP上下载太慢,提供以下下载地址。 consul是做服务发现的框架。 它是分布式的、高可用、横向扩展的。 consul提供的一些关键特性: service discovery:... 我们这里会介绍服务发现,健康检查,还有一些基本KV存储。
- 基本配置 使用环境变量! Consul 提供键/值存储 使用为进程设置环境变量 监控 consul,刷新进程 如何? - 文件模板 允许你编写配置文件(类似于 confd) 监控 consul,写入新文件 可选地将触发命令,例如重新...
$ docker run --name consul-exporter bitnami/consul-exporter:latest 为什么要使用Bitnami Images? Bitnami密切跟踪上游源变化,并使用我们的自动化系统及时发布该图像的新版本。 对于Bitnami映像,将尽快提供...
consul的基本入门,安装集群搭建,健康检查,web管理,键值存储等.
安装使用只需执行以下操作: cd ~/.vim/bundlegit clone git://github.com/markcornick/vim-consul.git如果您更喜欢使用病原体以外的其他东西,请继续。学分由 Mark Cornick 通过改编我之前的插件编写。 在 MIT 许可...
负载均衡基本概念有:实服务、实服务组、虚服务、调度算法、持续性等,其常用应用场景主要是服务器负载均衡,链路负载均衡。这篇文章主要介绍了SpringCloud与Consul集成实现负载均衡 ,需要的朋友可以参考下
贵宾经理根据etcd或Consul中保存的状态管理虚拟IP。 监视etcd中的状态目录建造确保至少具有Golang 1.14版本才能获得适当的模块支持。 您可以通过go 1.12或1.13获得成功,但是可以使用YMMV。 为确保内部包含...
使用Micronaut框架的微服务快速指南 可以在这里找到详细的描述: 可以在这里找到详细的描述:
对于Consul来说,内置的UI不错,但是缺少各种基本功能: 实时更新服务,节点和键/值列表(没人喜欢刷新) 完成更多的API(例如,直接从UI取消注册服务和服务检查) KV的“写入”和“删除”操作均支持CAS(“检查并...
此仓库包含一个使用Puppet,Docker,Consul和Vagrant的相当高级的示例。用法vagrant up --provider virtualboxvagrant provision启动三个虚拟机并为其下载大量软件将花费一些时间。发生了什么? 一旦建立,您应该...
克维特 Kvit帮助您轻松地在HashiCorp Consul和文件系统之间同步密钥和值对。 它是作为开源CLI应用程序开发的。“ Kvit”是什么意思? Kvit名称来自领事键值+ Git用法= KV + Git = kvit如何安装? .NET 5运行时是先决...
我们将从Feign的基本原理讲起,然后逐步展开使用Feign的完整流程和步骤,包括代码示例和详细注释。通过本文,读者将能够轻松掌握Feign在Spring Boot微服务架构中的应用。 Feign是一个声明式的Web Service客户端,它...
1、前言 为什么我们要隐藏部分接口? 因为我们在用swagger代替接口的时候,难免有些接口会直观的暴露出来,比如我们结合Consul一起...swagger的基本使用这里将不再赘述,可以阅读微软官方文档,即可基本使用 2、swagge
Go-Micro 是一个基于微服务库的可插拔 RPC,为编写分布式应用程序提供基本构件。它是 Micro 工具包的一部分,支持 Proto-RPC 和 JSON-RPC 的请求/响应协议,默认设置Consul为探索。示例服务可以在 examples/...