1,在基於 RPM 的發行版上安裝 Envoy
1.官方地址:
https://www.envoyproxy.io/docs/envoy/latest/start/install#install
#Install Envoy on RPM-based distros
sudo yum install yum-utils
sudo rpm --import 'https://rpm.dl.getenvoy.io/public/gpg.CF716AF503183491.key'
curl -sL 'https://rpm.dl.getenvoy.io/public/config.rpm.txt?distro=el&codename=7' > /tmp/tetrate-getenvoy-rpm-stable.repo
sudo yum-config-manager --add-repo '/tmp/tetrate-getenvoy-rpm-stable.repo'
sudo yum makecache --disablerepo='*' --enablerepo='tetrate-getenvoy-rpm-stable'
sudo yum install getenvoy-envoy
2.查看版本
]# envoy --version
envoy version: d362e791eb9e4efa8d87f6d878740e72dc8330ac/1.18.2/clean-getenvoy-76c310e-envoy/RELEASE/BoringSSL
3.配置文件檢查:
]# envoy --mode validate -c envoy-demo.yaml
[2022-03-04 10:24:57.502][6242][info][main] [external/envoy/source/server/server.cc:667] runtime: layers:
- name: base
static_layer:
{}
- name: admin
admin_layer:
{}
[2022-03-04 10:24:57.502][6242][info][config] [external/envoy/source/server/configuration_impl.cc:128] loading tracing configuration
[2022-03-04 10:24:57.502][6242][info][config] [external/envoy/source/server/configuration_impl.cc:88] loading 0 static secret(s)
[2022-03-04 10:24:57.502][6242][info][config] [external/envoy/source/server/configuration_impl.cc:94] loading 1 cluster(s)
[2022-03-04 10:24:57.503][6242][info][config] [external/envoy/source/server/configuration_impl.cc:98] loading 1 listener(s)
[2022-03-04 10:24:57.505][6242][info][config] [external/envoy/source/server/configuration_impl.cc:110] loading stats configuration
configuration 'envoy-demo.yaml' OK
4.添加啟動日志
mkdir logs
envoy -c envoy-demo.yaml --log-path logs/custom.log
#官方參考示例配置:
https://github.com/envoyproxy/envoy/tree/main/examples
#其他參考
https://www.servicemesher.com/envoy/intro/arch_overview/redis.html
https://blog.gmem.cc/envoy-study-note
安裝插件方便排錯