Sync docs from 2.1.x to gh-pages

This commit is contained in:
buildmaster
2019-06-28 14:30:51 +00:00
parent 4d5cbc82da
commit 8fe3a66b7d
7 changed files with 69 additions and 61 deletions

View File

@@ -90,7 +90,7 @@ $(addBlockSwitches);
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>2.1.3.BUILD-SNAPSHOT</p>
<p>2.1.4.BUILD-SNAPSHOT</p>
</div>
</div>
</div>

View File

@@ -32,7 +32,7 @@ With the default Config Server implementation, it can be a git label, branch nam
Label can also be provided as a comma-separated list.
In that case, the items in the list are tried one by one until one succeeds.
This behavior can be useful when working on a feature branch.
For instance, you might want to align the config label with your branch but make it optional (in that case, use <code class="literal">spring.cloud.config.label=myfeature,develop</code>).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_specifying_multiple_urls_for_the_config_server" href="#_specifying_multiple_urls_for_the_config_server"></a>7.6&nbsp;Specifying Multiple Urls for the Config Server</h2></div></div></div><p>To ensure high availability when you have multiple instances of Config Server deployed and expect one or more instances to be unavailable from time to time, you can either specify multiple URLs (as a comma-separated list under the <code class="literal">spring.cloud.config.uri</code> property) or have all your instances register in a Service Registry like Eureka ( if using Discovery-First Bootstrap mode ). Note that doing so ensures high availability only when the Config Server is not running (that is, when the application has exited) or when a connection timeout has occurred. For example, if the Config Server returns a 500 (Internal Server Error) response or the Config Client receives a 401 from the Config Server (due to bad credentials or other causes), the Config Client does not try to fetch properties from other URLs. An error of that kind indicates a user issue rather than an availability problem.</p><p>If you use HTTP basic security on your Config Server, it is currently possible to support per-Config Server auth credentials only if you embed the credentials in each URL you specify under the <code class="literal">spring.cloud.config.uri</code> property. If you use any other kind of security mechanism, you cannot (currently) support per-Config Server authentication and authorization.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_configuring_read_timeouts" href="#_configuring_read_timeouts"></a>7.7&nbsp;Configuring Read Timeouts</h2></div></div></div><p>If you want to configure read timeout, this can be done by using the property <code class="literal">spring.cloud.config.request-read-timeout</code>.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_security_2" href="#_security_2"></a>7.8&nbsp;Security</h2></div></div></div><p>If you use HTTP Basic security on the server, clients need to know the password (and username if it is not the default).
For instance, you might want to align the config label with your branch but make it optional (in that case, use <code class="literal">spring.cloud.config.label=myfeature,develop</code>).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_specifying_multiple_urls_for_the_config_server" href="#_specifying_multiple_urls_for_the_config_server"></a>7.6&nbsp;Specifying Multiple Urls for the Config Server</h2></div></div></div><p>To ensure high availability when you have multiple instances of Config Server deployed and expect one or more instances to be unavailable from time to time, you can either specify multiple URLs (as a comma-separated list under the <code class="literal">spring.cloud.config.uri</code> property) or have all your instances register in a Service Registry like Eureka ( if using Discovery-First Bootstrap mode ). Note that doing so ensures high availability only when the Config Server is not running (that is, when the application has exited) or when a connection timeout has occurred. For example, if the Config Server returns a 500 (Internal Server Error) response or the Config Client receives a 401 from the Config Server (due to bad credentials or other causes), the Config Client does not try to fetch properties from other URLs. An error of that kind indicates a user issue rather than an availability problem.</p><p>If you use HTTP basic security on your Config Server, it is currently possible to support per-Config Server auth credentials only if you embed the credentials in each URL you specify under the <code class="literal">spring.cloud.config.uri</code> property. If you use any other kind of security mechanism, you cannot (currently) support per-Config Server authentication and authorization.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_configuring_timeouts" href="#_configuring_timeouts"></a>7.7&nbsp;Configuring Timeouts</h2></div></div></div><p>If you want to configure timeout thresholds:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">Read timeouts can be configured by using the property <code class="literal">spring.cloud.config.request-read-timeout</code>.</li><li class="listitem">Connection timeouts can be configured by using the property <code class="literal">spring.cloud.config.request-connect-timeout</code>.</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_security_2" href="#_security_2"></a>7.8&nbsp;Security</h2></div></div></div><p>If you use HTTP Basic security on the server, clients need to know the password (and username if it is not the default).
You can specify the username and password through the config server URI or via separate username and password properties, as shown in the following example:</p><p><b>bootstrap.yml.&nbsp;</b>
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">spring</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> cloud</span>:
@@ -50,7 +50,7 @@ The following example works locally and for a user-provided service on Cloud Fou
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">spring</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> cloud</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> uri</span>: ${vcap.services.configserver.credentials.uri:http://user:password@localhost:<span class="hl-number">8888</span><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">}</span></pre><p>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> uri</span>: ${vcap.services.configserver.credentials.uri:http://user:password@localhost:<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">8888</xslthl:number><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">}</span></pre><p>
</p><p>If you use another form of security, you might need to <a class="link" href="multi__spring_cloud_config_client.html#custom-rest-template" title="7.8.2&nbsp;Providing A Custom RestTemplate">provide a <code class="literal">RestTemplate</code></a> to the <code class="literal">ConfigServicePropertySourceLocator</code> (for example, by grabbing it in the bootstrap context and injecting it).</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_health_indicator_2" href="#_health_indicator_2"></a>7.8.1&nbsp;Health Indicator</h3></div></div></div><p>The Config Client supplies a Spring Boot Health Indicator that attempts to load configuration from the Config Server.
The health indicator can be disabled by setting <code class="literal">health.config.enabled=false</code>.
The response is also cached for performance reasons.
@@ -58,9 +58,9 @@ The default cache time to live is 5 minutes.
To change that value, set the <code class="literal">health.config.time-to-live</code> property (in milliseconds).</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="custom-rest-template" href="#custom-rest-template"></a>7.8.2&nbsp;Providing A Custom RestTemplate</h3></div></div></div><p>In some cases, you might need to customize the requests made to the config server from the client.
Typically, doing so involves passing special <code class="literal">Authorization</code> headers to authenticate requests to the server.
To provide a custom <code class="literal">RestTemplate</code>:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">Create a new configuration bean with an implementation of <code class="literal">PropertySourceLocator</code>, as shown in the following example:</li></ol></div><p><b>CustomConfigServiceBootstrapConfiguration.java.&nbsp;</b>
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em>
</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Configuration</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> CustomConfigServiceBootstrapConfiguration {
<em><span class="hl-annotation" style="color: gray">@Bean</span></em>
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Bean</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> ConfigServicePropertySourceLocator configServicePropertySourceLocator() {
ConfigClientProperties clientProperties = configClientProperties();
ConfigServicePropertySourceLocator configServicePropertySourceLocator = <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> ConfigServicePropertySourceLocator(clientProperties);
@@ -79,5 +79,5 @@ in <code class="literal">bootstrap.yml</code>, as shown in the following example
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> token</span>: YourVaultToken</pre><p>
</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_nested_keys_in_vault" href="#_nested_keys_in_vault"></a>7.9&nbsp;Nested Keys In Vault</h2></div></div></div><p>Vault supports the ability to nest keys in a value stored in Vault, as shown in the following example:</p><p><code class="literal">echo -n '{"appA": {"secret": "appAsecret"}, "bar": "baz"}' | vault write secret/myapp -</code></p><p>This command writes a JSON object to your Vault.
To access these values in Spring, you would use the traditional dot(<code class="literal">.</code>) annotation, as shown in the following example</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Value("${appA.secret}")</span></em>
To access these values in Spring, you would use the traditional dot(<code class="literal">.</code>) annotation, as shown in the following example</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Value("${appA.secret}")</xslthl:annotation>
String name = <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"World"</span>;</pre><p>The preceding code would sets the value of the <code class="literal">name</code> variable to <code class="literal">appAsecret</code>.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__push_notifications_and_spring_cloud_bus.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;</td></tr><tr><td width="40%" align="left" valign="top">6.&nbsp;Push Notifications and Spring Cloud Bus&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-config.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>

View File

@@ -3,8 +3,8 @@
<title>2.&nbsp;Spring Cloud Config Server</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="up" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="prev" href="multi__quick_start.html" title="1.&nbsp;Quick Start"><link rel="next" href="multi__serving_alternative_formats.html" title="3.&nbsp;Serving Alternative Formats"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.&nbsp;Spring Cloud Config Server</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__quick_start.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi__serving_alternative_formats.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_spring_cloud_config_server" href="#_spring_cloud_config_server"></a>2.&nbsp;Spring Cloud Config Server</h1></div></div></div><p>Spring Cloud Config Server provides an HTTP resource-based API for external configuration (name-value pairs or equivalent YAML content).
The server is embeddable in a Spring Boot application, by using the <code class="literal">@EnableConfigServer</code> annotation.
Consequently, the following application is a config server:</p><p><b>ConfigServer.java.&nbsp;</b>
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@SpringBootApplication</span></em>
<em><span class="hl-annotation" style="color: gray">@EnableConfigServer</span></em>
</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@SpringBootApplication</xslthl:annotation>
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@EnableConfigServer</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> ConfigServer {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">void</span> main(String[] args) {
SpringApplication.run(ConfigServer.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, args);
@@ -59,7 +59,7 @@ If you use a command-line client such as curl, be careful with the brackets in t
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> server</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> git</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> uri</span>: https://example.com/my/repo
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> timeout</span>: <span class="hl-number">4</span></pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_placeholders_in_git_uri" href="#_placeholders_in_git_uri"></a>Placeholders in Git URI</h4></div></div></div><p>Spring Cloud Config Server supports a git repository URL with placeholders for the <code class="literal">{application}</code> and <code class="literal">{profile}</code> (and <code class="literal">{label}</code> if you need it, but remember that the label is applied as a git label anyway).
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> timeout</span>: <xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">4</xslthl:number></pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_placeholders_in_git_uri" href="#_placeholders_in_git_uri"></a>Placeholders in Git URI</h4></div></div></div><p>Spring Cloud Config Server supports a git repository URL with placeholders for the <code class="literal">{application}</code> and <code class="literal">{profile}</code> (and <code class="literal">{label}</code> if you need it, but remember that the label is applied as a git label anyway).
So you can support a <span class="quote">&#8220;<span class="quote">one repository per application</span>&#8221;</span> policy by using a structure similar to the following:</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">spring</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> cloud</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
@@ -164,7 +164,7 @@ In order to activate property-based SSH configuration, the <code class="literal"
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> server</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> git</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> uri</span>: git<em><span class="hl-annotation" style="color: gray">@gitserver.com:team/repo1.git</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> uri</span>: git<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@gitserver.com:team/repo1.git</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> ignoreLocalSshSettings</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">true</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> hostKey</span>: someHostKey
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> hostKeyAlgorithm</span>: ssh-rsa
@@ -173,28 +173,28 @@ In order to activate property-based SSH configuration, the <code class="literal"
MIIEpgIBAAKCAQEAx4UbaDzY5xjW6hc9jwN0mX33XpTDVW9WqHp5AKaRbtAC3DqX
IXFMPgw3K45jxRb93f8tv9vL3rD9CUG1Gv4FM+o7ds7FRES5RTjv2RT/JVNJCoqF
ol8+ngLqRZCyBtQN7zYByWMRirPGoDUqdPYrj2yq+ObBBNhg5N+hOwKjjpzdj2Ud
<span class="hl-number">1l</span>7R+wxIqmJo1IYyy16xS8WsjyQuyC0lL456qkd5BDZ0Ag8j2X9H9D5220Ln7s9i
<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">1l</xslthl:number>7R+wxIqmJo1IYyy16xS8WsjyQuyC0lL456qkd5BDZ0Ag8j2X9H9D5220Ln7s9i
oezTipXipS7p7Jekf3Ywx6abJwOmB0rX79dV4qiNcGgzATnG1PkXxqt76VhcGa0W
DDVHEEYGbSQ6hIGSh0I7BQun0aLRZojfE3gqHQIDAQABAoIBAQCZmGrk8BK6tXCd
fY6yTiKxFzwb38IQP0ojIUWNrq0+<span class="hl-number">9</span>Xt+NsypviLHkXfXXCKKU4zUHeIGVRq5MN9b
fY6yTiKxFzwb38IQP0ojIUWNrq0+<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">9</xslthl:number>Xt+NsypviLHkXfXXCKKU4zUHeIGVRq5MN9b
BO56/RrcQHHOoJdUWuOV2qMqJvPUtC0CpGkD+valhfD75MxoXU7s3FK7yjxy3rsG
EmfA6tHV8/<span class="hl-number">4</span>a5umo5TqSd2YTm5B19AhRqiuUVI1wTB41DjULUGiMYrnYrhzQlVvj
<span class="hl-number">5</span>MjnKTlYu3V8PoYDfv1GmxPPh6vlpafXEeEYN8VB97e5x3DGHjZ5UrurAmTLTdO8
+AahyoKsIY612TkkQthJlt7FJAwnCGMgY6podzzvzICLFmmTXYiZ/<span class="hl-number">28</span>I4BX/mOSe
EmfA6tHV8/<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">4</xslthl:number>a5umo5TqSd2YTm5B19AhRqiuUVI1wTB41DjULUGiMYrnYrhzQlVvj
<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">5</xslthl:number>MjnKTlYu3V8PoYDfv1GmxPPh6vlpafXEeEYN8VB97e5x3DGHjZ5UrurAmTLTdO8
+AahyoKsIY612TkkQthJlt7FJAwnCGMgY6podzzvzICLFmmTXYiZ/<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">28</xslthl:number>I4BX/mOSe
pZVnfRixAoGBAO6Uiwt40/PKs53mCEWngslSCsh9oGAaLTf/XdvMns5VmuyyAyKG
ti8Ol5wqBMi4GIUzjbgUvSUt+IowIrG3f5tN85wpjQ1UGVcpTnl5Qo9xaS1PFScQ
xrtWZ9eNj2TsIAMp/svJsyGG3OibxfnuAIpSXNQiJPwRlW3irzpGgVx/AoGBANYW
dnhshUcEHMJi3aXwR12OTDnaLoanVGLwLnkqLSYUZA7ZegpKq90UAuBdcEfgdpyi
PhKpeaeIiAaNnFo8m9aoTKr+<span class="hl-number">7</span>I6/uMTlwrVnfrsVTZv3orxjwQV20YIBCVRKD1uX
PhKpeaeIiAaNnFo8m9aoTKr+<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">7</xslthl:number>I6/uMTlwrVnfrsVTZv3orxjwQV20YIBCVRKD1uX
VhE0ozPZxwwKSPAFocpyWpGHGreGF1AIYBE9UBtjAoGBAI8bfPgJpyFyMiGBjO6z
FwlJc/xlFqDusrcHL7abW5qq0L4v3R+FrJw3ZYufzLTVcKfdj6GelwJJO+<span class="hl-number">8</span>wBm+R
FwlJc/xlFqDusrcHL7abW5qq0L4v3R+FrJw3ZYufzLTVcKfdj6GelwJJO+<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">8</xslthl:number>wBm+R
gTKYJItEhT48duLIfTDyIpHGVm9+I1MGhh5zKuCqIhxIYr9jHloBB7kRm0rPvYY4
VAykcNgyDvtAVODP+<span class="hl-number">4</span>m6JvhjAoGBALbtTqErKN47V0+JJpapLnF0KxGrqeGIjIRV
VAykcNgyDvtAVODP+<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">4</xslthl:number>m6JvhjAoGBALbtTqErKN47V0+JJpapLnF0KxGrqeGIjIRV
cYA6V4WYGr7NeIfesecfOC356PyhgPfpcVyEztwlvwTKb3RzIT1TZN8fH4YBr6Ee
KTbTjefRFhVUjQqnucAvfGi29f+<span class="hl-number">9</span>oE3Ei9f7wA+H35ocF6JvTYUsHNMIO/<span class="hl-number">3</span>gZ38N
KTbTjefRFhVUjQqnucAvfGi29f+<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">9</xslthl:number>oE3Ei9f7wA+H35ocF6JvTYUsHNMIO/<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">3</xslthl:number>gZ38N
CPjyCMa9AoGBAMhsITNe3QcbsXAbdUR00dDsIFVROzyFJ2m40i4KCRM35bC/BIBs
q0TY3we+ERB40U8Z2BvU61QuwaunJ2+uGadHo58VSVdggqAo0BSkH58innKKt96J
<span class="hl-number">69</span>pcVH/<span class="hl-number">4</span>rmLbXdcmNYGm6iu+MlPQk4BUZknHSmVHIFdJ0EPupVaQ8RHT
<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">69</xslthl:number>pcVH/<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">4</xslthl:number>rmLbXdcmNYGm6iu+MlPQk4BUZknHSmVHIFdJ0EPupVaQ8RHT
-----END RSA PRIVATE KEY-----</pre><p>The following table describes the SSH configuration properties.</p><div class="table"><a name="d0e633" href="#d0e633"></a><p class="title"><b>Table&nbsp;2.1.&nbsp;SSH Configuration Properties</b></p><div class="table-contents"><table class="table" summary="SSH Configuration Properties" style="border-collapse: collapse;border-top: 1px solid ; border-bottom: 1px solid ; border-left: 1px solid ; border-right: 1px solid ; "><colgroup><col class="col_1"><col class="col_2"></colgroup><thead><tr><th style="border-right: 1px solid ; border-bottom: 1px solid ; " align="left" valign="top">Property Name</th><th style="border-bottom: 1px solid ; " align="left" valign="top">Remarks</th></tr></thead><tbody><tr><td style="border-right: 1px solid ; border-bottom: 1px solid ; " align="left" valign="top"><p><span class="strong"><strong>ignoreLocalSshSettings</strong></span></p></td><td style="border-bottom: 1px solid ; " align="left" valign="top"><p>If <code class="literal">true</code>, use property-based instead of file-based SSH config. Must be set at as <code class="literal">spring.cloud.config.server.git.ignoreLocalSshSettings</code>, <span class="strong"><strong>not</strong></span> inside a repository definition.</p></td></tr><tr><td style="border-right: 1px solid ; border-bottom: 1px solid ; " align="left" valign="top"><p><span class="strong"><strong>privateKey</strong></span></p></td><td style="border-bottom: 1px solid ; " align="left" valign="top"><p>Valid SSH private key. Must be set if <code class="literal">ignoreLocalSshSettings</code> is true and Git URI is SSH format.</p></td></tr><tr><td style="border-right: 1px solid ; border-bottom: 1px solid ; " align="left" valign="top"><p><span class="strong"><strong>hostKey</strong></span></p></td><td style="border-bottom: 1px solid ; " align="left" valign="top"><p>Valid SSH host key. Must be set if <code class="literal">hostKeyAlgorithm</code> is also set.</p></td></tr><tr><td style="border-right: 1px solid ; border-bottom: 1px solid ; " align="left" valign="top"><p><span class="strong"><strong>hostKeyAlgorithm</strong></span></p></td><td style="border-bottom: 1px solid ; " align="left" valign="top"><p>One of <code class="literal">ssh-dss, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, or ecdsa-sha2-nistp521</code>. Must be set if <code class="literal">hostKey</code> is also set.</p></td></tr><tr><td style="border-right: 1px solid ; border-bottom: 1px solid ; " align="left" valign="top"><p><span class="strong"><strong>strictHostKeyChecking</strong></span></p></td><td style="border-bottom: 1px solid ; " align="left" valign="top"><p><code class="literal">true</code> or <code class="literal">false</code>. If false, ignore errors with host key.</p></td></tr><tr><td style="border-right: 1px solid ; border-bottom: 1px solid ; " align="left" valign="top"><p><span class="strong"><strong>knownHostsFile</strong></span></p></td><td style="border-bottom: 1px solid ; " align="left" valign="top"><p>Location of custom <code class="literal">.known_hosts</code> file.</p></td></tr><tr><td style="border-right: 1px solid ; " align="left" valign="top"><p><span class="strong"><strong>preferredAuthentications</strong></span></p></td><td style="" align="left" valign="top"><p>Override server authentication method order. This should allow for evading login prompts if server has keyboard-interactive authentication before the <code class="literal">publickey</code> method.</p></td></tr></tbody></table></div></div><br class="table-break"></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_placeholders_in_git_search_paths" href="#_placeholders_in_git_search_paths"></a>Placeholders in Git Search Paths</h4></div></div></div><p>Spring Cloud Config Server also supports a search path with placeholders for the <code class="literal">{application}</code> and <code class="literal">{profile}</code> (and <code class="literal">{label}</code> if
you need it), as shown in the following example:</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">spring</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> cloud</span>:
@@ -333,7 +333,7 @@ You can enable this feature by adding a dependency to <a class="link" href="http
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> server</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> credhub</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> url</span>: https://credhub:<span class="hl-number">8844</span></pre><p>The properties should be stored as JSON, such as:</p><pre class="programlisting">credhub set --name "/demo-app/default/master/toggles" --type=json
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> url</span>: https://credhub:<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">8844</xslthl:number></pre><p>The properties should be stored as JSON, such as:</p><pre class="programlisting">credhub set --name "/demo-app/default/master/toggles" --type=json
value: {"toggle.button": "blue", "toggle.link": "red"}</pre><pre class="programlisting">credhub set --name "/demo-app/default/master/abs" --type=json
value: {"marketing.enabled": true, "external.enabled": false}</pre><p>All client applications with the name <code class="literal">spring.cloud.config.name=demo-app</code> will have the following properties available to them:</p><pre class="screen">{
toggle.button: "blue",
@@ -358,7 +358,7 @@ value: {"marketing.enabled": true, "external.enabled": false}</pre><p>All client
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> server</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> credhub</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> url</span>: https://credhub:<span class="hl-number">8844</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> url</span>: https://credhub:<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">8844</xslthl:number>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> oauth2</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> registration-id</span>: credhub-client
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> security</span>:
@@ -372,7 +372,7 @@ value: {"marketing.enabled": true, "external.enabled": false}</pre><p>All client
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> authorization-grant-type</span>: client_credentials
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> provider</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> uaa</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> token-uri</span>: https://uaa:<span class="hl-number">8443</span>/oauth/token</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The used UAA client-id should have <code class="literal">credhub.read</code> as scope.</p></td></tr></table></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="composite-environment-repositories" href="#composite-environment-repositories"></a>2.1.9&nbsp;Composite Environment Repositories</h3></div></div></div><p>In some scenarios, you may wish to pull configuration data from multiple environment repositories.
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> token-uri</span>: https://uaa:<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">8443</xslthl:number>/oauth/token</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The used UAA client-id should have <code class="literal">credhub.read</code> as scope.</p></td></tr></table></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="composite-environment-repositories" href="#composite-environment-repositories"></a>2.1.9&nbsp;Composite Environment Repositories</h3></div></div></div><p>In some scenarios, you may wish to pull configuration data from multiple environment repositories.
To do so, you can enable the <code class="literal">composite</code> profile in your configuration server&#8217;s application properties or YAML file.
If, for example, you want to pull configuration data from a Subversion repository as well as two Git repositories, you can set the following properties for your configuration server:</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">spring</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> profiles</span>:
@@ -400,11 +400,11 @@ If, for example, you want to pull configuration data from a single Git repositor
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> server</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> git</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> uri</span>: file:///path/to/git/repo
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> order</span>: <span class="hl-number">2</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> order</span>: <xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">2</xslthl:number>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> vault</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> host</span>: <span class="hl-number">127.0</span>.<span class="hl-number">0.1</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> port</span>: <span class="hl-number">8200</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> order</span>: <span class="hl-number">1</span></pre><p>Using this configuration, precedence can be determined by an <code class="literal">order</code> property.
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> host</span>: <xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">127.0</xslthl:number>.<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">0.1</xslthl:number>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> port</span>: <xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">8200</xslthl:number>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> order</span>: <xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">1</xslthl:number></pre><p>Using this configuration, precedence can be determined by an <code class="literal">order</code> property.
You can use the <code class="literal">order</code> property to specify the priority order for all your repositories.
The lower the numerical value of the <code class="literal">order</code> property, the higher priority it has.
The priority order of a repository helps resolve any potential conflicts between repositories that contain values for the same properties.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If your composite environment includes a Vault server as in the previous example, you must include a Vault token in every request made to the configuration server. See <a class="link" href="multi__spring_cloud_config_server.html#vault-backend" title="2.1.4&nbsp;Vault Backend">Vault Backend</a>.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>Any type of failure when retrieving values from an environment repository results in a failure for the entire composite environment.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>When using a composite environment, it is important that all repositories contain the same labels.

View File

@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="up" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="prev" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="next" href="multi__quick_start.html" title="1.&nbsp;Quick Start"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-config.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi__quick_start.html">Next</a></td></tr></table><hr></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.1.3.BUILD-SNAPSHOT</strong></span></p><p>Spring Cloud Config provides server-side and client-side support for externalized configuration in a distributed system. With the Config Server, you have a central place to manage external properties for applications across all environments.
<title></title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="up" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="prev" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="next" href="multi__quick_start.html" title="1.&nbsp;Quick Start"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-config.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi__quick_start.html">Next</a></td></tr></table><hr></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.1.4.BUILD-SNAPSHOT</strong></span></p><p>Spring Cloud Config provides server-side and client-side support for externalized configuration in a distributed system. With the Config Server, you have a central place to manage external properties for applications across all environments.
The concepts on both client and server map identically to the Spring <code class="literal">Environment</code> and <code class="literal">PropertySource</code> abstractions, so they fit very well with Spring applications but can be used with any application running in any language.
As an application moves through the deployment pipeline from dev to test and into production, you can manage the configuration between those environments and be certain that applications have everything they need to run when they migrate.
The default implementation of the server storage backend uses git, so it easily supports labelled versions of configuration environments as well as being accessible to a wide range of tooling for managing the content.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -4,11 +4,11 @@
<book xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>Spring Cloud Config</title>
<date>2019-06-06</date>
<date>2019-06-28</date>
</info>
<preface>
<title></title>
<simpara><emphasis role="strong">2.1.3.BUILD-SNAPSHOT</emphasis></simpara>
<simpara><emphasis role="strong">2.1.4.BUILD-SNAPSHOT</emphasis></simpara>
<simpara>Spring Cloud Config provides server-side and client-side support for externalized configuration in a distributed system. With the Config Server, you have a central place to manage external properties for applications across all environments.
The concepts on both client and server map identically to the Spring <literal>Environment</literal> and <literal>PropertySource</literal> abstractions, so they fit very well with Spring applications but can be used with any application running in any language.
As an application moves through the deployment pipeline from dev to test and into production, you can manage the configuration between those environments and be certain that applications have everything they need to run when they migrate.
@@ -1373,9 +1373,17 @@ For instance, you might want to align the config label with your branch but make
<simpara>To ensure high availability when you have multiple instances of Config Server deployed and expect one or more instances to be unavailable from time to time, you can either specify multiple URLs (as a comma-separated list under the <literal>spring.cloud.config.uri</literal> property) or have all your instances register in a Service Registry like Eureka ( if using Discovery-First Bootstrap mode ). Note that doing so ensures high availability only when the Config Server is not running (that is, when the application has exited) or when a connection timeout has occurred. For example, if the Config Server returns a 500 (Internal Server Error) response or the Config Client receives a 401 from the Config Server (due to bad credentials or other causes), the Config Client does not try to fetch properties from other URLs. An error of that kind indicates a user issue rather than an availability problem.</simpara>
<simpara>If you use HTTP basic security on your Config Server, it is currently possible to support per-Config Server auth credentials only if you embed the credentials in each URL you specify under the <literal>spring.cloud.config.uri</literal> property. If you use any other kind of security mechanism, you cannot (currently) support per-Config Server authentication and authorization.</simpara>
</section>
<section xml:id="_configuring_read_timeouts">
<title>Configuring Read Timeouts</title>
<simpara>If you want to configure read timeout, this can be done by using the property <literal>spring.cloud.config.request-read-timeout</literal>.</simpara>
<section xml:id="_configuring_timeouts">
<title>Configuring Timeouts</title>
<simpara>If you want to configure timeout thresholds:</simpara>
<itemizedlist>
<listitem>
<simpara>Read timeouts can be configured by using the property <literal>spring.cloud.config.request-read-timeout</literal>.</simpara>
</listitem>
<listitem>
<simpara>Connection timeouts can be configured by using the property <literal>spring.cloud.config.request-connect-timeout</literal>.</simpara>
</listitem>
</itemizedlist>
</section>
<section xml:id="_security_2">
<title>Security</title>