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. android中的Handler消息传输机制

    android平台不允许Activity新启动的线程访问该Activity里的界面组件,这样就导致新启动的线程无法动态的改变界面组件的属性值.但是实际android应用开发中,需要新启动的线程周期性地 ...

  2. 框架_mybatis2使用注解

    在dao中使用注解: package cn.dao; import cn.mepu.User; import org.apache.ibatis.annotations.Select; import ...

  3. mysql的各种锁简单总结

    表总体上分为三种: 1.表锁 Myisam 开销小,并发低,加锁快,不会出现死锁问题:锁粒度大,发生锁冲突的概率最高. 2.行锁 innodb  开销大,并发高,加锁慢,会出现死锁问题:锁粒度小,发生 ...

  4. 文件IO 例子

    例子1: 测试最多打开多少个文件 #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> # ...

  5. 链表vector

    根据逻辑次序的复杂程度,大致可以将各种数据结构划分为线性结构.半线性结构与非线性结构三大类. 在线性结构中,各数据项按照一个线性次序构成一个整体.最为基本的线性结构统称为序列(sequence),根据 ...

  6. php 即点即改

    html代码 <td><span id="list_order">{$vo.list_order}</span> </td> < ...

  7. jQuery方法判断checkbox是否选中以及改变checkbox的选中状态

    jquery判断checked的三种方法: .attr('checked):   //看版本1.6+返回:”checked”或”undefined” ;1.5-返回:true或false .prop( ...

  8. NX二次开发-UFUN编辑添加哪些图层UF_LAYER_edit_category_layer

    1 NX11+VS2013 2 3 #include <uf.h> 4 #include <uf_layer.h> 5 6 7 UF_initialize(); 8 9 //创 ...

  9. Vue-cli中使用vConsole,以及设置JS连续点击控制vConsole按钮显隐功能实现

    最近发现了一个鹅厂的仓库,实现起来比我这个方便[捂脸].https://github.com/AlloyTeam/AlloyLever 一.vue-cli脚手架中搭建的项目引入vConsole调试 1 ...

  10. Spring-Security (学习记录四)--配置权限过滤器,采用数据库方式获取权限

    目录 1. 需要在spring-security.xml中配置验证过滤器,来取代spring-security.xml的默认过滤器 2. 配置securityMetadataSource,可以通过ur ...