istio.io/archive/v1.1/zh/help/faq/mixer/index.html

85 lines
27 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html><html lang=zh itemscope itemtype=https://schema.org/WebPage><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=theme-color content=#466BB0><meta name=title content="Mixer FAQ"><meta name=description content="Mixer Q &amp; A。"><meta name=keywords content=microservices,services,mesh><meta property=og:title content="Mixer FAQ"><meta property=og:type content=website><meta property=og:description content="Mixer Q &amp; A。"><meta property=og:url content=/v1.1/zh/help/faq/mixer/><meta property=og:image content=/v1.1/img/istio-whitelogo-bluebackground-framed.svg><meta property=og:image:alt content="Istio Logo"><meta property=og:image:width content=112><meta property=og:image:height content=150><meta property=og:site_name content=Istio><meta name=twitter:card content=summary><meta name=twitter:site content=@IstioMesh><title>Istioldie 1.1 / Mixer FAQ</title><script async src="https://www.googletagmanager.com/gtag/js?id=UA-98480406-2"></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}
gtag('js',new Date());gtag('config','UA-98480406-2');</script><link rel=alternate type=application/rss+xml title="Istio Blog" href=/v1.1/feed.xml><link rel="shortcut icon" href=/v1.1/favicons/favicon.ico><link rel=apple-touch-icon href=/v1.1/favicons/apple-touch-icon-180x180.png sizes=180x180><link rel=icon type=image/png href=/v1.1/favicons/favicon-16x16.png sizes=16x16><link rel=icon type=image/png href=/v1.1/favicons/favicon-32x32.png sizes=32x32><link rel=icon type=image/png href=/v1.1/favicons/android-36x36.png sizes=36x36><link rel=icon type=image/png href=/v1.1/favicons/android-48x48.png sizes=48x48><link rel=icon type=image/png href=/v1.1/favicons/android-72x72.png sizes=72x72><link rel=icon type=image/png href=/v1.1/favicons/android-96x96.png sizes=96xW96><link rel=icon type=image/png href=/v1.1/favicons/android-144x144.png sizes=144x144><link rel=icon type=image/png href=/v1.1/favicons/android-192x192.png sizes=192x192><link rel=manifest href=/v1.1/manifest.json><meta name=apple-mobile-web-app-title content=Istio><meta name=application-name content=Istio><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Work+Sans:400|Chivo:400|Work+Sans:500,300,600,300italic,400italic,500italic,600italic|Chivo:500,300,600,300italic,400italic,500italic,600italic"><link rel=stylesheet href=/v1.1/css/all.css></head><body class="language-unknown archive-site"><script src=/v1.1/js/themes_init.min.js></script><script>const branchName="release-1.1";const docTitle="Mixer FAQ";const iconFile="\/v1.1/img/icons.svg";const buttonCopy='复制到剪切板';const buttonPrint='打印';const buttonDownload='下载';</script><script src="https://www.google.com/cse/brand?form=search-form" defer></script><script src=/v1.1/js/all.min.js data-manual defer></script><header><nav><a id=brand href=/v1.1/zh/><span class=logo><svg viewBox="0 0 300 300"><circle cx="150" cy="150" r="146" stroke-width="2" /><path d="M65 240H225L125 270z"/><path d="M65 230l60-10V110z"/><path d="M135 220l90 10L135 30z"/></svg></span><span class=name>Istioldie 1.1</span></a><div id=hamburger><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#hamburger"/></svg></div><div id=header-links><a title="了解如何部署、使用和运维 Istio。" href=/v1.1/zh/docs/>文档</a>
<a title="关于使用 Istio 的博客文章。" href=/v1.1/zh/blog/2019/root-transition/>博客</a>
<span title="一堆帮助您部署、配置和使用 Istio 的资源。">帮助</span>
<a title=关于Istio的说明。 href=/v1.1/zh/about/>关于</a><div class=menu><button id=gearDropdownButton class=menu-trigger title=选项和设置 aria-label="Options and Settings" aria-controls=gearDropdownContent><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#gear"/></svg></button><div id=gearDropdownContent class=menu-content aria-labelledby=gearDropdownButton role=menu><a tabindex=-1 role=menuitem lang=en id=switch-lang-en>English</a>
<a tabindex=-1 role=menuitem lang=zh id=switch-lang-zh class=active>中文</a><div role=separator></div><a tabindex=-1 role=menuitem class=active id=light-theme-item>亮主题</a>
<a tabindex=-1 role=menuitem id=dark-theme-item>暗主题</a><div role=separator></div><a tabindex=-1 role=menuitem id=syntax-coloring-item>代码高亮</a><div role=separator></div><h6>本站的其它版本</h6><a tabindex=-1 role=menuitem onclick="navigateToUrlOrRoot('https://istio.io/help\/faq\/mixer\/');return false;">当前版本</a>
<a tabindex=-1 role=menuitem onclick="navigateToUrlOrRoot('https://preliminary.istio.io/help\/faq\/mixer\/');return false;">下个版本</a>
<a tabindex=-1 role=menuitem href=https://archive.istio.io>旧版本</a></div></div><button id=search-show title=搜索istio.io aria-label=Search><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#magnifier"/></svg></button></div><form id=search-form name=cse role=search><input type=hidden name=cx value=013699703217164175118:iwwf17ikgf4>
<input type=hidden name=ie value=utf-8>
<input type=hidden name=hl value=en>
<input type=hidden id=search-page-url value=/v1.1/search.html>
<input id=search-textbox class=form-control name=q type=search aria-label=搜索istio.io>
<button id=search-close title="Cancel search" type=reset aria-label="Cancel search"><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#cancel-x"/></svg></button></form></nav></header><main class="primary notoc"><div id=sidebar-container class="sidebar-container sidebar-offcanvas"><nav id=sidebar aria-label="Section Navigation"><div class=directory><div class=card><div id=header0 class=header title="一堆帮助您部署、配置和使用 Istio 的资源。"><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#help"/></svg>需要帮助吗?</div><div class="body default" aria-labelledby=header0><ul role=tree aria-expanded=true aria-labelledby=header0><li role=treeitem aria-label=运维指南><button aria-hidden=true></button><a title="关于运行 Istio 网格的提示、技巧和窍门。" href=/v1.1/zh/help/ops/>运维指南</a><ul role=group aria-expanded=false><li role=none><a role=treeitem title=描述如何使用组件日志来深入了解运行组件的行为。 href=/v1.1/zh/help/ops/component-logging/>组件日志</a></li><li role=none><a role=treeitem title="描述如何使用 ControlZ 检测查看单个组件的运行状态。" href=/v1.1/zh/help/ops/controlz/>组件内检</a></li><li role=none><a role=treeitem title="如何从底层调试 Istio 组件。" href=/v1.1/zh/help/ops/component-debugging/>组件调试</a></li><li role=treeitem aria-label=流量管理><button aria-hidden=true></button><a title=帮助管理服务网格中的网络。 href=/v1.1/zh/help/ops/traffic-management/>流量管理</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="介绍 Istio 网络操作方面知识。" href=/v1.1/zh/help/ops/traffic-management/introduction/>网络运维介绍</a></li><li role=none><a role=treeitem title=提供特定的部署和配置指南。 href=/v1.1/zh/help/ops/traffic-management/deploy-guidelines/>部署和配置指南</a></li><li role=none><a role=treeitem title=常见网络相关问题的识别和处理。 href=/v1.1/zh/help/ops/traffic-management/troubleshooting/>网络问题排查</a></li><li role=none><a role=treeitem title=有关如何启用和理解本地负载均衡的信息。 href=/v1.1/zh/help/ops/traffic-management/locality-load-balancing/>本地负载均衡</a></li><li role=none><a role=treeitem title="用于对流量管理方面的 Envoy 配置问题进行检测的工具和技术。" href=/v1.1/zh/help/ops/traffic-management/proxy-cmd/>调试 Envoy 和 Pilot</a></li><li role=none><a role=treeitem title=介绍一些工具和技术,用来针对流量管理方面的配置问题进行诊断。 href=/v1.1/zh/help/ops/traffic-management/observing/>配置问题诊断</a></li></ul></li><li role=treeitem aria-label=安全><button aria-hidden=true></button><a title=帮助你管理运行中的网格的安全性方面问题。 href=/v1.1/zh/help/ops/security/>安全</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title=展示授权功能的调试过程。 href=/v1.1/zh/help/ops/security/debugging-authorization/>调试授权</a></li><li role=none><a role=treeitem title="如果 Citadel 表现不正常该怎么办。" href=/v1.1/zh/help/ops/security/repairing-citadel/>修复 Citadel</a></li><li role=none><a role=treeitem title="如果您怀疑 Istio 密钥和证书有问题该怎么办。" href=/v1.1/zh/help/ops/security/keys-and-certs/>密钥和证书</a></li><li role=none><a role=treeitem title="如何处理 TLS 认证的失效问题。" href=/v1.1/zh/help/ops/security/mutual-tls/>双向 TLS</a></li><li role=none><a role=treeitem title="如何在启用双向 TLS 的情况下运行健康检查。" href=/v1.1/zh/help/ops/security/health-checks-and-mtls/>健康检查和双向 TLS</a></li><li role=none><a role=treeitem title=已经启用了授权,但是无论如何请求还是会通过。 href=/v1.1/zh/help/ops/security/authorization-permissive/>授权太过宽松</a></li><li role=none><a role=treeitem title=启用了授权然后任何请求都无法到达服务。 href=/v1.1/zh/help/ops/security/authorization-restrictive/>授权过于严格</a></li><li role=none><a role=treeitem title=如果终端用户身份验证不起作用,该怎么办。 href=/v1.1/zh/help/ops/security/end-user-auth/>终端用户身份验证</a></li><li role=none><a role=treeitem title="学习如何延长 Istio 自签发根证书的有效期。" href=/v1.1/zh/help/ops/security/root-transition/>延长自签发证书的有效期</a></li></ul></li><li role=treeitem aria-label=遥测><button aria-hidden=true></button><a title=帮助您在一个运行的服务网格中管理遥测数据的采集和可视化。 href=/v1.1/zh/help/ops/telemetry/>遥测</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem href=/v1.1/zh/help/ops/telemetry/missing-metrics/>查看不到指标</a></li><li role=none><a role=treeitem title="处理 Grafana 相关问题。" href=/v1.1/zh/help/ops/telemetry/grafana/>Grafana</a></li><li role=none><a role=treeitem title="Envoy 统计数据的细粒度控制。" href=/v1.1/zh/help/ops/telemetry/envoy-stats/>Envoy 统计数据</a></li></ul></li><li role=treeitem aria-label=安装和设置><button aria-hidden=true></button><a title="帮助诊断和修复 Isto 安装问题。" href=/v1.1/zh/help/ops/setup/>安装和设置</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="概述了 Istio 使用 Kubernetes Webhook 及可能出现的相关问题。" href=/v1.1/zh/help/ops/setup/webhook/>动态准入 Webhook 概述</a></li><li role=none><a role=treeitem title="Istio 使用 Kubernetes webhook 进行服务器端配置验证的方式。" href=/v1.1/zh/help/ops/setup/validation/>配置验证 Webhook</a></li><li role=none><a role=treeitem title="描述了 Istio 如何使用 Kubernetes webhooks 进行自动 sidecar 注入。" href=/v1.1/zh/help/ops/setup/injection/>Sidecar 注入 Webhook</a></li><li role=none><a role=treeitem title="如何检查 Pod 中被许可的功能。" href=/v1.1/zh/help/ops/setup/required-pod-capabilities/>Pod 的必要功能</a></li><li role=none><a role=treeitem title="展示如何对 Istio service 进行健康检查。" href=/v1.1/zh/help/ops/setup/app-health-check/>Istio Service 健康检查</a></li></ul></li><li role=none><a role=treeitem title="关于解决 Istio 常见问题的建议。" href=/v1.1/zh/help/ops/misc/>杂项</a></li></ul></li><li role=treeitem aria-label=FAQ><button class=show aria-hidden=true></button><a title=关于Istio的常见问题。 href=/v1.1/zh/help/faq/>FAQ</a><ul role=group aria-expanded=true class=leaf-section><li role=none><a role=treeitem title=常见问题。 href=/v1.1/zh/help/faq/general/>常见问题</a></li><li role=none><a role=treeitem title="安装 Q &amp; A。" href=/v1.1/zh/help/faq/setup/>安装</a></li><li role=none><a role=treeitem title=安全方面的常见问题。 href=/v1.1/zh/help/faq/security/>安全</a></li><li role=none><span role=treeitem class=current title="Mixer Q &amp; A。">Mixer</span></li><li role=none><a role=treeitem title=度量和日志的常见问题。 href=/v1.1/zh/help/faq/metrics-and-logs/>度量和日志</a></li><li role=none><a role=treeitem title="遥测 Q &amp; A." href=/v1.1/zh/help/faq/telemetry/>遥测</a></li><li role=none><a role=treeitem title=分布式追踪问答。 href=/v1.1/zh/help/faq/distributed-tracing/>分布式追踪</a></li><li role=none><a role=treeitem title="流量管理 Q &amp; A。" href=/v1.1/zh/help/faq/traffic-management/>流量管理</a></li></ul></li><li role=none><a role=treeitem title="Istio 常见的术语表。" href=/v1.1/zh/help/glossary/>术语表</a></li></ul></div></div></div></nav></div><div class=article-container><button tabindex=-1 id=sidebar-toggler title=折叠导航栏><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#pull"/></svg></button><nav aria-label=Breadcrumb><ol><li><a href=/v1.1/zh/>Istio</a></li><li><a href=/v1.1/zh/help/ title="一堆帮助您部署、配置和使用 Istio 的资源。">帮助</a></li><li><a href=/v1.1/zh/help/faq/ title=关于Istio的常见问题。>FAQ</a></li><li>Mixer</li></ol></nav><article aria-labelledby=title><div class=title-area><i class=title-icon><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#faq"/></svg></i><div><h1 id=title>Mixer FAQ</h1></div></div><nav class="toc-inlined toc-forced"><hr><div class=directory role=directory><nav id=InlineTableOfContents><ol><li role=none aria-label="为什么 Istio 需要 Mixer"><a href=#why-mixer>为什么 Istio 需要 Mixer</a></li><li role=none aria-label="如何查看 Mixer 配置?"><a href=#seeing-mixer-config>如何查看 Mixer 配置?</a></li><li role=none aria-label="Mixer 支持的全部属性表达式有哪些?"><a href=#attribute-expressions>Mixer 支持的全部属性表达式有哪些?</a></li><li role=none aria-label="Mixer 是否提供内部监控?"><a href=#mixer-self-monitoring>Mixer 是否提供内部监控?</a></li><li role=none aria-label="如何为 Mixer 编写自定义适配器?"><a href=#writing-custom-adapters>如何为 Mixer 编写自定义适配器?</a></li><li role=none aria-label=为什么我的规则无法匹配?><a href=#header-rules>为什么我的规则无法匹配?</a></li></ol></nav></div><hr></nav><div class=faq><h5 id=why-mixer class=question>为什么 Istio 需要 Mixer</h5><div class=answer><p>Mixer 为 Istio 组件和服务之间提供了丰富的中介层Mixer 作为基础设施后端服务可用于访问控制检查控制和遥测数据采集。Mixer 提供的中介层可在不修改服务二进制的情况下,帮助运维人员获得对服务内部机制的洞悉力和控制力。</p><p>Mixer 被设计为独立组件,这与 Envoy 不同。这样的设计有很多好处:</p><ul><li><em>可伸缩性</em>
Mixer 和 Envoy 的功能本质上不同,这也导致了对于可伸缩性要求不同。保持组件分离可实现独立的组件适当扩展。</li><li><em>资源使用</em>
Istio 依赖于部署代理的实例,因此最小化代理的成本是非常重要的。将 Mixer 的复杂逻辑移动到独立的组件中实现可以保证 Envoy 功能的轻量和灵活。</li><li><em>可靠性</em>
Mixer 及其开放式扩展性模型代表了数据路径处理流水线最复杂部分。在 Mixer 而不是 Envoy 中实现此功能,是因为这样可以达到故障域隔离,使得 Envoy 在 Mixer 失败的情况下也能正常运行,避免宕机。</li><li><em>隔离性</em>
Mixer 在 Istio 和 基础设施后端之间提供了一定程度的隔离。每个 Envoy 实例都可配置为非常小范围内的互动操作,限制了潜在攻击的影响。</li><li><em>可扩展性</em>
为使得 Istio 进行互操作的后端保持足够的健壮性必须要求模型的简单和可扩展性。归功于其设计和语言选择Mixer 比 Envoy 具备更好的扩展性。功能点的分离也使得 Istio 策略和遥测处理的功能可以采用不同的代理实现,例如 Envoy 和 NGINX 的混合。</li></ul><p>Envoy 实现了复杂的缓存,批处理和预取策略,从而在很大程度上减轻了在请求路径上与 Mixer 交互的延迟影响。</p></div><h5 id=seeing-mixer-config class=question>如何查看 Mixer 配置?</h5><div class=answer><p><em>instances、</em> <em>handlers</em><em>rules</em> 的相关配置以 Kubernetes <a href=https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/>Custom Resources</a> 的方式进行存储。相关配置可以通过 <code>kubectl</code> 命令从 Kubernetes API server 查询获取。</p><h2 id=rules>Rules</h2><p>查看所有 <code>rule</code> 的列表,执行以下命令:</p><pre><code class=language-bash data-expandlinks=true>$ kubectl get rules --all-namespaces
NAMESPACE NAME AGE
istio-system kubeattrgenrulerule 20h
istio-system promhttp 20h
istio-system promtcp 20h
istio-system stdiohttp 20h
istio-system stdiotcp 20h
istio-system tcpkubeattrgenrulerule 20h
</code></pre><p>查看单个 <code>rule</code> 配置,执行以下命令:</p><pre><code class=language-bash data-expandlinks=true>$ kubectl -n &lt;namespace&gt; get rules &lt;name&gt; -o yaml
</code></pre><h2 id=handlers>Handlers</h2><p><code>Handlers</code> 是基于 <code>adapter</code> 的 Kubernetes <a href=https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions>CRD</a> 定义的。</p><p>首先,查看 <code>adapter</code> 类型列表:</p><pre><code class=language-bash data-expandlinks=true>$ kubectl get crd -listio=mixer-adapter
NAME AGE
adapters.config.istio.io 20h
bypasses.config.istio.io 20h
circonuses.config.istio.io 20h
deniers.config.istio.io 20h
fluentds.config.istio.io 20h
kubernetesenvs.config.istio.io 20h
listcheckers.config.istio.io 20h
memquotas.config.istio.io 20h
noops.config.istio.io 20h
opas.config.istio.io 20h
prometheuses.config.istio.io 20h
rbacs.config.istio.io 20h
servicecontrols.config.istio.io 20h
signalfxs.config.istio.io 20h
solarwindses.config.istio.io 20h
stackdrivers.config.istio.io 20h
statsds.config.istio.io 20h
stdios.config.istio.io 20h
</code></pre><p>然后,对列表中的每个 <code>adapter</code> 类型,执行以下命令:</p><pre><code class=language-bash data-expandlinks=true>$ kubectl get &lt;adapter kind name&gt; --all-namespaces
</code></pre><p><code>stdios</code> 的输出类似于:</p><pre><code class=language-plain data-expandlinks=true>NAMESPACE NAME AGE
istio-system handler 20h
</code></pre><p>查看单个 <code>handler</code> 配置,执行以下命令:</p><pre><code class=language-bash data-expandlinks=true>$ kubectl -n &lt;namespace&gt; get &lt;adapter kind name&gt; &lt;name&gt; -o yaml
</code></pre><h2 id=instances>Instances</h2><p><code>Instances</code> 是基于 <code>instance</code> 的 Kubernetes <a href=https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions>CRD</a> 定义的。</p><p>首先,查看 <code>instance</code> 类型列表:</p><pre><code class=language-bash data-expandlinks=true>$ kubectl get crd -listio=mixer-instance
NAME AGE
apikeys.config.istio.io 20h
authorizations.config.istio.io 20h
checknothings.config.istio.io 20h
edges.config.istio.io 20h
instances.config.istio.io 20h
kuberneteses.config.istio.io 20h
listentries.config.istio.io 20h
logentries.config.istio.io 20h
metrics.config.istio.io 20h
quotas.config.istio.io 20h
reportnothings.config.istio.io 20h
servicecontrolreports.config.istio.io 20h
tracespans.config.istio.io 20h
</code></pre><p>然后,对列表中的每个 instance 类型,执行以下命令:</p><pre><code class=language-bash data-expandlinks=true>$ kubectl get &lt;instance kind name&gt; --all-namespaces
</code></pre><p><code>metrics</code> 的输出类似于:</p><pre><code class=language-plain data-expandlinks=true>NAMESPACE NAME AGE
istio-system requestcount 20h
istio-system requestduration 20h
istio-system requestsize 20h
istio-system responsesize 20h
istio-system tcpbytereceived 20h
istio-system tcpbytesent 20h
</code></pre><p>查看单个 <code>instance</code> 配置,执行以下命令:</p><pre><code class=language-bash data-expandlinks=true>$ kubectl -n &lt;namespace&gt; get &lt;instance kind name&gt; &lt;name&gt; -o yaml
</code></pre></div><h5 id=attribute-expressions class=question>Mixer 支持的全部属性表达式有哪些?</h5><div class=answer><p>Mixer 支持的全部属性表达式参见<a href=/v1.1/zh/docs/reference/config/policy-and-telemetry/expression-language/>表达式语言参考</a></p></div><h5 id=mixer-self-monitoring class=question>Mixer 是否提供内部监控?</h5><div class=answer><p>Mixer 提供了监控端点(默认端口:<code>10514</code>。Mixer 提供的性能和审计功能的服务路径如下:</p><ul><li><code>/metrics</code> 提供有关 Mixer 处理的 Prometheus 指标、 API 调用相关的 gRPC 指标和 adapter 调度指标。</li><li><code>/debug/pprof</code> 提供了性能剖析相关的数据,格式为 <a href=https://golang.org/pkg/net/http/pprof/>pprof</a></li><li><code>/debug/vars</code> 提供了服务器指标,数据为 JSON 格式。</li></ul><p>可通过 <code>kubectl logs</code> 命令访问 Mixer 的日志,如下所示:</p><ul><li>关于 <code>istio-policy</code> 服务:</li></ul><pre><code class=language-bash data-expandlinks=true>$ kubectl -n istio-system logs -lapp=policy -c mixer
</code></pre><ul><li>关于 <code>istio-telemetry</code> 服务:</li></ul><pre><code class=language-bash data-expandlinks=true>$ kubectl -n istio-system logs -lapp=telemetry -c mixer
</code></pre><p>Mixer 追踪功能由以下命令行参数控制:<code>trace_zipkin_url</code><code>trace_jaeger_url</code><code>trace_log_spans</code>。如果设置了以上参数中的任何一个,则追踪数据将上报至配置的相关服务地址。如果未提供追踪相关设置参数,则 Mixer 将不会产生应用程序级别的追踪信息。</p></div><h5 id=writing-custom-adapters class=question>如何为 Mixer 编写自定义适配器?</h5><div class=answer><p>了解如何为 Mixer 实现新的 adapter可参考 <a href=https://github.com/istio/istio/wiki/Mixer-Compiled-In-Adapter-Dev-Guide>Adapter Developer&rsquo;s Guide</a></p><div><aside class="callout idea"><div class=type><svg class="large-icon"><use xlink:href="/v1.1/img/icons.svg#callout-idea"/></svg></div><div class=content>Istio 1.0 引入了对 out-of-process adapters 的支持。这是与 Mixer 集成的推荐方法。<a href=https://github.com/istio/istio/wiki/Mixer-Out-Of-Process-Adapter-Dev-Guide>Out Of Process Adapter Dev Guide</a><a href=https://github.com/istio/istio/wiki/Mixer-Out-Of-Process-Adapter-Walkthrough>Out of Process Adapter Walk-through</a> 提供了有关如何构建 out-of-process adapters 的入门文档。</div></aside></div></div><h5 id=header-rules class=question>为什么我的规则无法匹配?</h5><div class=answer><p>Mixer 在运行时必须通过验证才能生效。这就要求匹配条件需要是一个有效的<a href=/v1.1/zh/docs/reference/config/policy-and-telemetry/expression-language/>表达式</a>,其中需要用到的属性定义在<a href=/v1.1/zh/docs/reference/config/policy-and-telemetry/attribute-vocabulary/>属性词汇表</a>中,同时 Rule 中包含的 Handler 和 Instance 引用也必须是有效的。</p><p>在表达式运行之前通畅会对属性值进行预处理。例如 <code>request.headers</code><code>response.headers</code> 中包含的 HTTP 头的键会被转换为小写。表达式 <code>request.headers[&quot;X-Forwarded-Proto&quot;] == &quot;http&quot;</code> 是不会完成匹配的,而应该修改成 <code>request.headers[&quot;x-forwarded-proto&quot;] == &quot;http&quot;</code></p></div></div></article><nav class=pagenav><div class=left><a title=安全方面的常见问题。 href=/v1.1/zh/help/faq/security/><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#left-arrow"/></svg>安全</a></div><div class=right><a title=度量和日志的常见问题。 href=/v1.1/zh/help/faq/metrics-and-logs/>度量和日志<svg class="icon"><use xlink:href="/v1.1/img/icons.svg#right-arrow"/></svg></a></div></nav><div id=endnotes-container aria-hidden=true><h2>链接</h2><ol id=endnotes></ol></div></div></main><footer><div class=user-links><a class=channel title="Go download Istio 1.1.9 now" href=https://github.com/istio/istio/releases/tag/1.1.9 aria-label="Download Istio"><span>download</span><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#download"/></svg>
</a><a class=channel title="加入 Istio discussion board 参与讨论获取帮助" href=https://discuss.istio.io aria-label="Istio discussion board"><span>discuss</span><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#discourse"/></svg></a>
<a class=channel title="Stack Overflow 中列举了针对实际问题以及部署、配置和使用 Istio 的各项回答" href=https://stackoverflow.com/questions/tagged/istio aria-label="Stack Overflow"><span>stack overflow</span><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#stackoverflow"/></svg></a>
<a class=channel title="关注我们的 Twitter 来获取最新信息" href=https://twitter.com/IstioMesh aria-label=Twitter><span>twitter</span><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#twitter"/></svg></a><div class=tag>对于用户</div></div><div class=info><p class=copyright>中文内容由 ServiceMesher 社区维护,部分文档可能稍微滞后于英文版本,同步工作持续进行中<br>Istio 归档
1.1.9<br>&copy; 2019 Istio Authors, <a href=https://policies.google.com/privacy>隐私政策</a><br>归档于 2019年6月18日</p></div><div class=dev-links><a class=channel title="Istio 的代码在 GitHub 上开发" href=https://github.com/istio/community aria-label=GitHub><span>github</span><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#github"/></svg></a>
<a class=channel title="在 Slack 上与 Istio 社区交互讨论开发问题(仅限邀请)" href=https://istio.slack.com aria-label=slack><span>slack</span><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#slack"/></svg></a>
<a class=channel title="如果您想深入了解 Istio 的技术细节,请查看我们日益完善的设计文档" href=https://groups.google.com/forum/#!forum/istio-team-drive-access aria-label="team drive"><span>drive</span><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#drive"/></svg></a>
<a class=channel title="如果您想为 Istio 项目做出贡献,请考虑加入我们的工作组" href=https://github.com/istio/community/blob/master/WORKING-GROUPS.md aria-label="working groups"><span>working groups</span><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#working-groups"/></svg></a><div class=tag>对于开发者</div></div></footer><div id=scroll-to-top-container aria-hidden=true><button id=scroll-to-top title=回到顶部><svg class="icon"><use xlink:href="/v1.1/img/icons.svg#top"/></svg></button></div></body></html>