This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
The following commit(s) were added to refs/heads/master by this push:
new 3dd4933 Addd new docs (#424)
3dd4933 is described below
commit 3dd4933b1103e04cf0b0ad11dc288cccd3e51a17
Author: ken.lj <[email protected]>
AuthorDate: Fri Jul 5 17:38:49 2019 +0800
Addd new docs (#424)
---
docs/zh-cn/user/SUMMARY.md | 1 +
.../user/configuration/environment-variables.md | 31 ++++++++++++++++++++++
site_config/docs.js | 4 +++
3 files changed, 36 insertions(+)
diff --git a/docs/zh-cn/user/SUMMARY.md b/docs/zh-cn/user/SUMMARY.md
index f5034e4..9d7edc0 100644
--- a/docs/zh-cn/user/SUMMARY.md
+++ b/docs/zh-cn/user/SUMMARY.md
@@ -13,6 +13,7 @@
* [5.3 Annotation 配置](./configuration/annotation.md)
* [5.3 动态配置中心](./configuration/config-center.md)
* [5.4 配置加载流程](./configuration/configuration-load-process.md)
+ * [5.5 自动加载环境变量](./configuration/environment-variables.md)
* [6 示例](./demos/index.md)
* [6.1 启动时检查](./demos/preflight-check.md)
* [6.2 集群容错](./demos/fault-tolerent-strategy.md)
diff --git a/docs/zh-cn/user/configuration/environment-variables.md
b/docs/zh-cn/user/configuration/environment-variables.md
new file mode 100644
index 0000000..0bc108e
--- /dev/null
+++ b/docs/zh-cn/user/configuration/environment-variables.md
@@ -0,0 +1,31 @@
+# 自动加载环境变量
+
+从2.7.3版本开始,Dubbo会自动从约定key中读取配置,并将配置以Key-Value的形式写入到URL中。
+
+支持的key有以下两个:
+
+1. `dubbo.labels`,指定一些列配置到URL中的键值对,通常通过JVM -D或系统环境变量指定。
+
+ 增加以下配置:
+
+ ```properties
+ # JVM
+ -Ddubbo.labels = "tag1=value1; tag2=value2"
+
+ # 环境变量
+ DUBBO_LABELS = "tag1=value1; tag2=value2"
+ ```
+ 最终生成的URL会包含 tag1、tag2 两个 key: `dubbo://xxx?tag1=value1&tag2=value2`
+
+
+2. `dubbo.env.keys`,指定环境变量key值,Dubbo会尝试从环境变量加载每个 key
+
+ ```properties
+ # JVM
+ -Ddubbo.env.keys = "DUBBO_TAG1, DUBBO_TAG2"
+
+ # 环境变量
+ DUBBO_ENV_KEYS = "DUBBO_TAG1, DUBBO_TAG2"
+ ```
+
+ 最终生成的URL会包含 DUBBO_TAG1、DUBBO_TAG2 两个 key:
`dubbo://xxx?DUBBO_TAG1=value1&DUBBO_TAG2=value2`
\ No newline at end of file
diff --git a/site_config/docs.js b/site_config/docs.js
index 5271c14..20b0cd2 100644
--- a/site_config/docs.js
+++ b/site_config/docs.js
@@ -672,6 +672,10 @@ export default {
{
title: '配置加载流程',
link:
'/zh-cn/docs/user/configuration/configuration-load-process.html'
+ },
+ {
+ title: '自动加载环境变量',
+ link:
'/zh-cn/docs/user/configuration/environment-variables.html'
}
],
},