1.克隆源码到机器

[root@cx-- ~]# git clone https://github.com/envoyproxy/envoy
Cloning into 'envoy'...
remote: Enumerating objects: , done.
remote: Counting objects: % (/), done.
remote: Compressing objects: % (/), done.
remote: Total (delta ), reused (delta ), pack-reused
Receiving objects: % (/), 35.16 MiB | 601.00 KiB/s, done.
Resolving deltas: % (/), done.
[root@cx-- ~]# ls
anaconda-ks.cfg envoy wordpress-mysql
[root@cx-- ~]# ls envoy/
api ci configs DEPRECATED.md examples include NOTICE PULL_REQUEST_TEMPLATE.md REPO_LAYOUT.md SECURITY_RELEASE_PROCESS.md support VERSION
bazel CODE_OF_CONDUCT.md CONTRIBUTING.md DEVELOPER.md EXTENSION_POLICY.md ISSUE_TEMPLATE.md OWNERS.md README.md restarter source test windows
BUILD CODEOWNERS DCO docs GOVERNANCE.md LICENSE PULL_REQUESTS.md repokitteh.star security STYLE.md tools WORKSPACE
[root@cx-- ~]# cd envoy/examples/redis/
[root@cx-- redis]# ls
docker-compose.yaml Dockerfile-proxy Dockerfile-redis envoy.yaml README.md

2.安装docker-compose

[root@cx-- redis]# curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
--:--:-- --:--:-- --:--:--
15.4M 15.4M 1353k :: :: --:--:-- 2355k
[root@cx-- redis]# chmod +x /usr/local/bin/docker-compose
[root@cx-- redis]# docker-compose ps
Name Command State Ports
------------------------------

3.创建redis沙箱

[root@cx-- redis]# docker-compose up -d
Creating network "redis_envoymesh" with the default driver
Building proxy
Step / : FROM envoyproxy/envoy-dev:latest
Trying to pull repository docker.io/envoyproxy/envoy-dev ...
latest: Pulling from docker.io/envoyproxy/envoy-dev
35b42117c431: Already exists
ad9c569a8d98: Already exists
293b44f45162: Already exists
0c175077525d: Already exists
720b18d7211c: Pull complete
7e82cb71a605: Pull complete
8dd5fbb71c59: Pull complete
cd8d5f15933d: Pull complete
e7e9de9472a4: Pull complete
Digest: sha256:5d558d699eeb219f672e771d9ab7d455f0c23ecf8cbe81e2fed2bcc4d16fbe21
Status: Downloaded newer image for docker.io/envoyproxy/envoy-dev:latest
---> 66dad96a6e23
Step / : CMD /usr/local/bin/envoy -c /etc/envoy.yaml -l debug --service-cluster proxy
---> Running in 91d0aa4af229
---> 939322cd01f3
Removing intermediate container 91d0aa4af229
Successfully built 939322cd01f3
WARNING: Image for service proxy was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Building redis
Step / : FROM redis
Trying to pull repository docker.io/library/redis ...
latest: Pulling from docker.io/library/redis
fc7181108d40: Already exists
3e0ac67cad82: Pull complete
6ee495cb7235: Pull complete
9f7206d08b9d: Pull complete
a8354ef8cccb: Pull complete
53afb10d81c2: Pull complete
Digest: sha256:ca2d9251c2818df48c6598e01a5bdeab46040dc7ab236abe075d7c7343465177
Status: Downloaded newer image for docker.io/redis:latest
---> 3c41ce05add9
Successfully built 3c41ce05add9
WARNING: Image for service redis was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating redis_proxy_1 ... done
Creating redis_redis_1 ... done
[root@cx-- redis]# docker-compose build
Building proxy
Step / : FROM envoyproxy/envoy-dev:latest
---> 66dad96a6e23
Step / : CMD /usr/local/bin/envoy -c /etc/envoy.yaml -l debug --service-cluster proxy
---> Using cache
---> 939322cd01f3
Successfully built 939322cd01f3
Building redis
Step / : FROM redis
---> 3c41ce05add9
Successfully built 3c41ce05add9 [root@cx-- redis]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ef3799105b89 redis_redis "docker-entrypoint..." About a minute ago Up About a minute 0.0.0.0:->/tcp redis_redis_1
d851feb8d172 redis_proxy "/docker-entrypoin..." About a minute ago Up About a minute 0.0.0.0:->/tcp, 0.0.0.0:->/tcp, /tcp redis_proxy_1

4.使用redis-cli发出一些Redis命令,并验证它们是否通过envoy路由

//注意端口号
> redis-cli -h localhost -p set foo foo
OK
> redis-cli -h localhost -p set bar bar
OK
> redis-cli -h localhost -p get foo
"foo"
> redis-cli -h localhost -p get bar
"bar"

转到http://localhost:8001/stats?usedonly&filter=redis.egress_redis.command并验证以下统计信息

redis.egress_redis.command.get.total:
redis.egress_redis.command.set.total:

其他链接可查看帮助

[root@cx-- ~]# curl http://localhost:8001/help
admin commands are:
/: Admin home page
/certs: print certs on machine
/clusters: upstream cluster status
/config_dump: dump current Envoy configs (experimental)
/contention: dump current Envoy mutex contention stats (if enabled)
/cpuprofiler: enable/disable the CPU profiler
/healthcheck/fail: cause the server to fail health checks
/healthcheck/ok: cause the server to pass health checks
/heapprofiler: enable/disable the heap profiler
/help: print out list of admin commands
/hot_restart_version: print the hot restart compatibility version
/listeners: print listener info
/logging: query/change logging levels
/memory: print current allocation/heap usage
/quitquitquit: exit the server
/ready: print server state, return if LIVE, otherwise return
/reset_counters: reset all counters to zero
/runtime: print runtime values
/runtime_modify: modify runtime values
/server_info: print server version/status information
/stats: print server stats
/stats/prometheus: print server stats in prometheus format

Redis过滤器如何与Envoy代理一起使用的更多相关文章

  1. Envoy 代理中的请求的生命周期

    Envoy 代理中的请求的生命周期 翻译自Envoy官方文档. 目录 Envoy 代理中的请求的生命周期 术语 网络拓扑 配置 高层架构 请求流 总览 1.Listener TCP连接的接收 2.监听 ...

  2. 记一次企业级爬虫系统升级改造(六):基于Redis实现免费的IP代理池

    前言: 首先表示抱歉,春节后一直较忙,未及时更新该系列文章. 近期,由于监控的站源越来越多,就偶有站源做了反爬机制,造成我们的SupportYun系统小爬虫服务时常被封IP,不能进行数据采集. 这时候 ...

  3. redis 6.0下redis-cluster-proxy代理尝试

    伴随着Redis6.0的发布,作为最令人怦然心动的特性之一,Redis官方同时推出Redis集群的proxy了:redis-cluster-proxy,https://github.com/Redis ...

  4. Envoy:经过envoy代理后获取客户端真实IP

    在envoy作为前端代理时,用户ip的获取很重要,一般获取ip的方式.都是通过Header中的 X-Forward-For. X-Real-IP或 Remote addr 等属性获取,但是如果确保En ...

  5. 161230、利用代理中间件实现大规模Redis集群

    前面在<大规模互联网应用Redis架构要点>和<Redis官方集群方案 Redis Cluster>两篇文章中分别介绍了多Redis服务器集群的两种方式,它们是基于客户端sha ...

  6. Envoy 部署类型

    目录 Envoy 网络拓扑及请求流程 1. 术语 2. 网络拓扑 3. 配置 4. 更高层的架构 5. 请求流程 1. Listener TCP 接收 2. 侦听器过滤器链和网络过滤器链匹配 3.TL ...

  7. Redis 集群缓存测试要点--关于 线上 token 失效 BUG 的总结

    在测试账户系统过程中遇到了线上大面积用户登录态失效的严重问题,事后对于其原因及测试盲点做了一些总结记录以便以后查阅,总结分为以下7点,其中原理性的解释有些摘自网络. 1.账户系统token失效问题复盘 ...

  8. 服务网格数据平面的关键:层层剖析Envoy配置

    Envoy是一种高性能C++分布式代理,专为单个服务和应用程序设计.作为Service Mesh中的重要组件,充分理解其配置就显得尤为重要.本文列出了使用Envoy而不用其他代理的原因.并给出了Env ...

  9. 看看赤裸的envoy是什么样子的?

    入门istio,envoy现在看来必不可少,花点时间了解一下吧. Envoy 是什么 我们援引一段官网的描述: Envoy is an L7 proxy and communication bus d ...

随机推荐

  1. 框架集 frameset

    框架集和内联框架的作用类似,都用于在一个页面中引入其他的外部的页面 框架集可以同时引入多个页面,而内联框架引入一个, 在h5标准中,推荐使用框架集,而不使用内联框架 使用 frameset 来创建一个 ...

  2. Python 文件名

  3. etimer

     Contiki包含一个时钟模型和5个定时器模型(timer, stimer, ctimer, etimer, and rtimer),先学习etimer吧. etimer是一个结构体,(个人用eve ...

  4. 【学术篇】规律选手再次证明自己(舒老师的胡策题 T2 LX还在迷路)

    只要你不强制在线, 我就能分块. --Reflash 就算你强制在线, 我还是要分块. --Enzymii 今天做了一波舒老师的毒瘤题, T1据说很水但是没思路所以直接放掉了.. 去看了看T2好像可以 ...

  5. 使用canvas绘制6X6调色盘

    <canvas id="canvas" height="150" width="150"></canvas> var ...

  6. look at me

    I would bet my life, like I bet my heart我以生命与真心担保That you were the one, baby你就是我的命中注定I've never been ...

  7. Oozie安装

    Oozie的安装与部署 1.解压Oozie $ tar -zxf /opt/softwares/oozie-4.0.0-cdh5.3.6.tar.gz -C /opt/modules/cdh/ 2.H ...

  8. NX-二次开发删除对象UF_OBJ_delete_object

    NX9+VS2012 #include <uf.h> #include <uf_curve.h> #include <uf_obj.h> UF_initialize ...

  9. NX二次开发-UFUN输入对象tag获得part名字UF_OBJ_ask_owning_part

    NX11+VS2013 #include <uf.h> #include <uf_modl.h> #include <uf_part.h> #include < ...

  10. Centos搭建http代理服务器(无密码验证)

    一.安装shadowsocks yum install python-setuptools && easy_install pip pip install shadowsocks 二. ...