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. Linux 下工作用户及环境

    交叉工具的安装 工具链的编译过程请参考第三部分. 1. 下载交叉工具 2.95.3 下载地址:ftp://ftp.arm.linux.org.uk/pub/armlinux/toolchain/cro ...

  2. python3添加requests库

    1.资源下载 https://codeload.github.com/psf/requests/zip/master https://www.python.org/ https://files.pyt ...

  3. 笔记53 Mybatis快速入门(四)

    动态SQL 1.if 假设需要对Product执行两条sql语句,一个是查询所有,一个是根据名称模糊查询.那么按照现在的方式,必须提供两条sql语句:listProduct和listProductBy ...

  4. Effective C++之条款1:视C++为一个语言联邦

    C++中的sub-languages有如下四种: C Object-Oriented C++:   (classes ,encapsulation(封装),inheritance(继承),polymo ...

  5. vue实现京东动态楼层效果

    页面效果如下 <template> <div> <h1>首页</h1> <section class="floor-nav" ...

  6. vue 学习一 组件生命周期

    先上一张vue组件生命周期的流程图 以上就是一个组件完整的生命周期,而在组件处于每个阶段时又会提供一些周期钩子函数以便我们进行一些逻辑操作,而总体来讲 vue的组件共有8个生命周期钩子 beforeC ...

  7. python模块:typing

    很多人在写完代码一段时间后回过头看代码,很可能忘记了自己写的函数需要传什么参数,返回什么类型的结果,就不得不去阅读代码的具体内容,降低了阅读的速度,加上Python本身就是一门弱类型的语言,这种现象就 ...

  8. 【基础】Hint控制语句执行

    mysql常用的hint对于经常使用oracle的朋友可能知道,oracle的hint功能种类很多,对于优化sql语句提供了很多方法.同样,在mysql里,也有类似的hint功能.下面介绍一些常用的. ...

  9. ionic-CSS:ionic 按钮

    ylbtech-ionic-CSS:ionic 按钮 1.返回顶部 1. onic 按钮 按钮是移动app不可或缺的一部分,不同风格的app,需要的不同按钮的样式. 默认情况下,按钮显示样式为:dis ...

  10. LeetCode 175. Combine Two Tables (组合两个表)

    题目标签: 题目给了我们两个table,让我们合并,根据Person为主. 因为题目说了 提供person 信息,不管这个人有没有地址.所以这里用Left Join. Java Solution: R ...