mirror of https://github.com/istio/istio.io.git
45 lines
16 KiB
HTML
45 lines
16 KiB
HTML
<!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="应用常见问题"><meta name=description content="特定应用问答。"><meta name=keywords content="microservices,services,mesh"><meta property="og:title" content="应用常见问题"><meta property="og:type" content="website"><meta property="og:description" content="特定应用问答。"><meta property="og:url" content="/v1.6/zh/faq/applications/"><meta property="og:image" content="/v1.6/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.6 / 应用常见问题</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.6/blog/feed.xml><link rel=alternate type=application/rss+xml title="Istio News" href=/v1.6/news/feed.xml><link rel=alternate type=application/rss+xml title="Istio Blog and News" href=/v1.6/feed.xml><link rel="shortcut icon" href=/v1.6/favicons/favicon.ico><link rel=apple-touch-icon href=/v1.6/favicons/apple-touch-icon-180x180.png sizes=180x180><link rel=icon type=image/png href=/v1.6/favicons/favicon-16x16.png sizes=16x16><link rel=icon type=image/png href=/v1.6/favicons/favicon-32x32.png sizes=32x32><link rel=icon type=image/png href=/v1.6/favicons/android-36x36.png sizes=36x36><link rel=icon type=image/png href=/v1.6/favicons/android-48x48.png sizes=48x48><link rel=icon type=image/png href=/v1.6/favicons/android-72x72.png sizes=72x72><link rel=icon type=image/png href=/v1.6/favicons/android-96x96.png sizes=96xW96><link rel=icon type=image/png href=/v1.6/favicons/android-144x144.png sizes=144x144><link rel=icon type=image/png href=/v1.6/favicons/android-192x192.png sizes=192x192><link rel=manifest href=/v1.6/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.6/css/all.css><script src=/v1.6/js/themes_init.min.js></script></head><body class="language-unknown archive-site"><script>const branchName="release-1.6";const docTitle="应用常见问题";const iconFile="\/v1.6/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.6/js/all.min.js data-manual defer></script><header><nav><a id=brand href=/v1.6/zh/><span class=logo><svg viewBox="0 0 300 300"><circle cx="150" cy="150" r="146" stroke-width="2"/><polygon points="65 240 225 240 125 270"/><polygon points="65 230 125 220 125 110"/><polygon points="135 220 225 230 135 30"/></svg></span><span class=name>Istioldie 1.6</span></a><div id=hamburger><svg class="icon"><use xlink:href="/v1.6/img/icons.svg#hamburger"/></svg></div><div id=header-links><a title="了解如何部署、使用和运维 Istio。" href=/v1.6/zh/docs/>文档</a>
|
||
<a title="关于使用 Istio 的博客文章。" href=/v1.6/zh/blog/2020/>博客<i class=dot data-prefix=/blog></i></a>
|
||
<a title="关于 Istio 项目的最新报道。" href=/v1.6/zh/news/>新闻<i class=dot data-prefix=/news></i></a>
|
||
<a class=current title="关于 Istio 的常见问题。" href=/v1.6/zh/faq/>FAQ</a>
|
||
<a title="关于 Istio 项目的说明。" href=/v1.6/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.6/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/faq\/applications\/');return false;">当前版本</a>
|
||
<a tabindex=-1 role=menuitem onclick="navigateToUrlOrRoot('https://preliminary.istio.io/faq\/applications\/');return false;">下个版本</a>
|
||
<a tabindex=-1 role=menuitem href=https://istio.io/archive>旧版本</a></div></div><button id=search-show title="搜索 istio.io" aria-label=搜索><svg class="icon"><use xlink:href="/v1.6/img/icons.svg#magnifier"/></svg></button></div><form id=search-form name=cse role=search><input type=hidden name=cx value=002184991200833970123: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.6/search>
|
||
<input id=search-textbox class=form-control name=q type=search aria-label="搜索 istio.io">
|
||
<button id=search-close title=取消搜索 type=reset aria-label=取消搜索><svg class="icon"><use xlink:href="/v1.6/img/icons.svg#cancel-x"/></svg></button></form></nav></header><div class=banner-container></div><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.6/img/icons.svg#faq"/></svg>FAQ</div><div class="body default" aria-labelledby=header0><ul role=tree aria-expanded=true class=leaf-section aria-labelledby=header0><li role=none><a role=treeitem title=常见问题。 href=/v1.6/zh/faq/general/>常见问题</a></li><li role=none><a role=treeitem title=安装相关问答。 href=/v1.6/zh/faq/setup/>安装</a></li><li role=none><a role=treeitem title=安全常见问题。 href=/v1.6/zh/faq/security/>安全</a></li><li role=none><span role=treeitem class=current title=特定应用问答。>应用</span></li><li role=none><a role=treeitem title="Mixer Q & A." href=/v1.6/zh/faq/mixer/>Mixer</a></li><li role=none><a role=treeitem title=度量和日志的常见问题。 href=/v1.6/zh/faq/metrics-and-logs/>度量和日志</a></li><li role=none><a role=treeitem title=分布式追踪问答。 href=/v1.6/zh/faq/distributed-tracing/>分布式追踪</a></li><li role=none><a role=treeitem title=流量管理的常见问题。 href=/v1.6/zh/faq/traffic-management/>流量管理</a></li></ul></div></div></div></nav></div><div class=article-container><nav aria-label=Breadcrumb><ol><li><a href=/v1.6/zh/ title=用于连接、保护、控制和观测服务。>Istio</a></li><li><a href=/v1.6/zh/faq/ title="关于 Istio 的常见问题。">FAQ</a></li><li>应用</li></ol></nav><article aria-labelledby=title><div class=title-area><i class=title-icon><svg class="icon"><use xlink:href="/v1.6/img/icons.svg#faq"/></svg></i><div style=width:100%><h1 id=title>应用常见问题</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 mesh 中运行 Casandra 吗?"><a href=#cassandra>可以在 Istio mesh 中运行 Casandra 吗?</a></li><li role=none aria-label="我可以在 Istio 网格内运行 Redis 吗?"><a href=#redis>我可以在 Istio 网格内运行 Redis 吗?</a></li><li role=none aria-label="我能在 Istio 内部运行 Zookeeper 吗?"><a href=#zookeeper>我能在 Istio 内部运行 Zookeeper 吗?</a></li><li role=none aria-label="我能在 Istio 网格中运行 Elasticsearch 吗?"><a href=#elasticsearch>我能在 Istio 网格中运行 Elasticsearch 吗?</a></li></ol></nav></div><hr></nav><div class=faq><h5 id=cassandra class=question>可以在 Istio mesh 中运行 Casandra 吗?</h5><div class=answer><p>默认情况下,Cassandra 广播用于绑定(接受连接)到其他 Cassandra 节点的地址作为其地址。这通常是 Pod IP 地址,无需服务网格即可正常工作。但是,对于服务网格,此配置不起作用。Istio 和其他服务网格需要 <code>localhost</code> (<code>127.0.0.1</code>)作为绑定地址。</p><p>有两个配置参数要注意:
|
||
<a href="http://cassandra.apache.org/doc/latest/configuration/cassandra_config_file.html?highlight=listen_address#listen-address"><code>listen_address</code></a> 和 <a href="http://cassandra.apache.org/doc/latest/configuration/cassandra_config_file.html?highlight=listen_address#broadcast-address"><code>broadcast_address</code></a>。为了在 Istio 网格中运行 Cassandra,应该将 <code>listen_address</code> 参数设置为 <code>127.0.0.1</code>,将 <code>broadcast_address</code> 参数设置为 Pod IP 地址。</p><p>这些配置参数在 Cassandra 配置目录(例如 <code>/etc/cassandra</code>)的 <code>cassandra.yaml</code> 中定义。有多种用于启动 Cassandra 的脚本(和 yaml 文件),应注意这些脚本如何设置这些参数。例如,一些用于配置和启动 Cassandra 的脚本使用环境变量 <code>CASSANDRA_LISTEN_ADDRESS</code> 的值来设置 <code>listen_address</code>。</p></div><h5 id=redis class=question>我可以在 Istio 网格内运行 Redis 吗?</h5><div class=answer><p>与在 Istio 服务网格中部署的其他服务类似,Redis 实例需要监听 <code>localhost</code> (<code>127.0.0.1</code>)。每个 Redis 从属实例都应声明一个地址,主服务器可以使用该地址来访问它,但是,该地址不能是 <code>localhost</code> (<code>127.0.0.1</code>)。</p><p>使用 Redis 配置参数 <code>replica-announce-ip</code> 来公布正确的地址。例如,使用以下步骤将 <code>replica-announce-ip</code> 设置为每个 Redis 从属实例的 IP 地址:</p><p>通过从属 <code>StatefulSet</code> 的 <code>env</code> 小节中定义的环境变量传递 Pod IP 地址:</p><pre><code class=language-yaml data-expandlinks=true data-repo=istio>- name: "POD_IP"
|
||
valueFrom:
|
||
fieldRef:
|
||
fieldPath: status.podIP
|
||
</code></pre><p>另外,在 <code>command</code> 小节下添加以下内容:</p><pre><code class=language-yaml data-expandlinks=true data-repo=istio>echo "" >> /opt/bitnami/redis/etc/replica.conf
|
||
echo "replica-announce-ip $POD_IP" >> /opt/bitnami/redis/etc/replica.conf
|
||
</code></pre></div><h5 id=zookeeper class=question>我能在 Istio 内部运行 Zookeeper 吗?</h5><div class=answer><p>默认情况下,Zookeeper 通过监听 pod 的 IP 地址用来在服务间通信。而 Istio 和其他的服务网格需要监听在 <code>localhost</code> (<code>127.0.0.1</code>)地址上。</p><p>有一个配置参数可以来修改这个默认行为:
|
||
<a href=https://zookeeper.apache.org/doc/r3.5.7/zookeeperAdmin.html><code>quorumListenOnAllIPs</code></a>。
|
||
这个选项可以让 Zookeeper 监听所有的地址包括 <code>localhost</code>。
|
||
通过下面的命令可以把这个参数设置为 <code>true</code>,<code>$ZK_CONFIG_FILE</code> 是你 Zookeeper 配置文件的路径。</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ echo "quorumListenOnAllIPs=true" >> $ZK_CONFIG_FILE
|
||
</code></pre></div><h5 id=elasticsearch class=question>我能在 Istio 网格中运行 Elasticsearch 吗?</h5><div class=answer><p>在 Istio 中运行 Elasticsearch,有两个 Elasticsearch 配置参数需要被正确设置:<code>network.bind_host</code> 和 <code>network.publish_host</code>。默认情况下,这些参数值被设置成 <code>network.host</code> 参数。如果 <code>network.host</code> 被设置成 <code>0.0.0.0</code>,Elasticsearch 很可能选择 pod IP 作为发布地址并且不需要更进一步的配置。</p><p>如果默认配置没有生效,你可以将 <code>network.bind_host</code> 设置为 <code>0.0.0.0</code> 或 <code>localhost</code> (<code>127.0.0.1</code>) 并将 <code>network.publish_host</code> 设置为 pod IP,例如:</p><pre><code class=language-yaml data-expandlinks=true data-repo=istio>...
|
||
containers:
|
||
- name: elasticsearch
|
||
image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0
|
||
env:
|
||
- name: network.bind_host
|
||
value: 127.0.0.1
|
||
- name: network.publish_host
|
||
valueFrom:
|
||
fieldRef:
|
||
fieldPath: status.podIP
|
||
...
|
||
</code></pre><p>了解更多信息请查看 <a href=https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#modules-network>Elasticsearch 网络设置</a>。</p></div></div></article><nav class=pagenav><div class=left><a title=安全常见问题。 href=/v1.6/zh/faq/security/><svg class="icon"><use xlink:href="/v1.6/img/icons.svg#left-arrow"/></svg>安全</a></div><div class=right><a title="Mixer Q & A." href=/v1.6/zh/faq/mixer/>Mixer<svg class="icon"><use xlink:href="/v1.6/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="立刻下载 Istio 1.6.8" href=/v1.6/docs/setup/getting-started/#download aria-label="Download Istio"><span>download</span><svg class="icon"><use xlink:href="/v1.6/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.6/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.6/img/icons.svg#stackoverflow"/></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.6/img/icons.svg#slack"/></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.6/img/icons.svg#twitter"/></svg></a><div class=tag>对于用户</div></div><div class=info><p class=copyright>中文内容由 ServiceMesher 社区维护,部分文档可能稍微滞后于英文版本,同步工作持续进行中<br>Istio 归档
|
||
1.6.8<br>© 2020 Istio Authors, <a href=https://policies.google.com/privacy>隐私政策</a><br>归档于 2020年8月21日</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.6/img/icons.svg#github"/></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.6/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.6/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.6/img/icons.svg#top"/></svg></button></div></body></html> |