Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/zh/04-best-practice/04-reduce-storage-overhead.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ ORDER BY date DESC
根据某个字段的值,区分统计空间消耗。例如:查看 `l7_flow_log` 表中不同应用协议(`l7_protocol`)的行数,以及对应的 `request_resource` 字段的平均长度,评估是否关闭某种应用协议的解析:

```sql
SELECT dictGet(flow_tag.int_enum_map, 'name', ('l7_protocol', toUInt64(l7_protocol))) AS "应用协议", count(0) AS "行数", sum(length(request_resource))/count(l7_protocol) AS "平均 request_resource 长度", sum(length(request_resource))/sum(if(request_resource !='', 1, 0)) AS "平均非空 request_resource 长度" FROM flow_log.l7_flow_log WHERE time>now()-86400 GROUP BY l7_protocol ORDER BY "行数" DESC;
SELECT dictGet(flow_tag.int_enum_map, 'name_zh', ('l7_protocol', toUInt64(l7_protocol))) AS "应用协议", count(0) AS "行数", sum(length(request_resource))/count(l7_protocol) AS "平均 request_resource 长度", sum(length(request_resource))/sum(if(request_resource !='', 1, 0)) AS "平均非空 request_resource 长度" FROM flow_log.l7_flow_log WHERE time>now()-86400 GROUP BY l7_protocol ORDER BY "行数" DESC;

SELECT
dictGet(flow_tag.int_enum_map, 'name', ('l7_protocol', toUInt64(l7_protocol))) AS `应用协议`,
dictGet(flow_tag.int_enum_map, 'name_zh', ('l7_protocol', toUInt64(l7_protocol))) AS `应用协议`,
count(0) AS `行数`,
sum(length(request_resource)) / count(l7_protocol) AS `平均 request_resource 长度`,
sum(length(request_resource)) / sum(if(request_resource != '', 1, 0)) AS `平均非空 request_resource 长度`
Expand All @@ -126,11 +126,11 @@ ORDER BY `行数` DESC
查看 `l7_flow_log` 表中不同观测点(`observation_point`)的行数,评估是否关闭某些观测点处采集的调用日志:

```sql
SELECT observation_point, dictGet(flow_tag.string_enum_map, 'name', ('observation_point', observation_point)) AS "观测点", count(0) AS "行数" FROM flow_log.l7_flow_log WHERE time>now()-86400 GROUP BY observation_point ORDER BY "行数" DESC;
SELECT observation_point, dictGet(flow_tag.string_enum_map, 'name_zh', ('observation_point', observation_point)) AS "观测点", count(0) AS "行数" FROM flow_log.l7_flow_log WHERE time>now()-86400 GROUP BY observation_point ORDER BY "行数" DESC;

SELECT
observation_point,
dictGet(flow_tag.string_enum_map, 'name', ('observation_point', observation_point)) AS `观测点`,
dictGet(flow_tag.string_enum_map, 'name_zh', ('observation_point', observation_point)) AS `观测点`,
count(0) AS `行数`
FROM flow_log.l7_flow_log
WHERE time > (now() - 86400)
Expand Down
18 changes: 9 additions & 9 deletions docs/zh/04-best-practice/06-production-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DeepFlow 生产环境部署建议。

# 使用 LTS 版本 DeepFlow

helm 添加 --version 参数安装最新 LTS 版本 DeepFlow Server 和 Agent
通过 `helm search repo deepflow -l` 查看[最新的 LTS 版本](../release-notes/release-timeline)

## 安装 LTS 版本 DeepFlow Server

Expand All @@ -21,7 +21,7 @@ helm 添加 --version 参数安装最新 LTS 版本 DeepFlow Server 和 Agent
# helm repo add deepflow https://deepflowio.github.io/deepflow

helm repo update deepflow # use `helm repo update` when helm < 3.7.0
helm upgrade --install deepflow -n deepflow deepflow/deepflow --version 6.5.012 --create-namespace
helm upgrade --install deepflow -n deepflow deepflow/deepflow --version 7.0.014 --create-namespace
```

@tab Use Aliyun
Expand All @@ -38,7 +38,7 @@ helm repo update deepflow # use `helm repo update` when helm < 3.7.0
# image:
# repository: registry.cn-beijing.aliyuncs.com/deepflow-ce/grafana
# EOF
helm upgrade --install deepflow -n deepflow deepflow/deepflow --version 6.5.012 --create-namespace \
helm upgrade --install deepflow -n deepflow deepflow/deepflow --version 7.0.014 --create-namespace \
-f values-custom.yaml
```

Expand All @@ -63,7 +63,7 @@ helm upgrade --install deepflow -n deepflow deepflow/deepflow --version 6.5.012
# helm repo add deepflow https://deepflowio.github.io/deepflow

helm repo update deepflow # use `helm repo update` when helm < 3.7.0
helm upgrade --install deepflow-agent -n deepflow deepflow/deepflow-agent --version 6.5.012 --create-namespace -f values-custom.yaml
helm upgrade --install deepflow-agent -n deepflow deepflow/deepflow-agent --version 7.0.014 --create-namespace -f values-custom.yaml
```

@tab Use Aliyun
Expand All @@ -81,7 +81,7 @@ helm upgrade --install deepflow-agent -n deepflow deepflow/deepflow-agent --vers
# helm repo add deepflow https://deepflowio.github.io/deepflow

helm repo update deepflow # use `helm repo update` when helm < 3.7.0
helm upgrade --install deepflow-agent -n deepflow deepflow/deepflow-agent --version 6.5.012 --create-namespace -f values-custom.yaml
helm upgrade --install deepflow-agent -n deepflow deepflow/deepflow-agent --version 7.0.014 --create-namespace -f values-custom.yaml
```

:::
Expand All @@ -95,23 +95,23 @@ helm upgrade --install deepflow-agent -n deepflow deepflow/deepflow-agent --vers
@tab rpm

```bash
curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/rpm/agent/v6.4.9/linux/$(arch | sed 's|x86_64|amd64|' | sed 's|aarch64|arm64|')/deepflow-agent-rpm.zip
curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/rpm/agent/v7.0/linux/$(arch | sed 's|x86_64|amd64|' | sed 's|aarch64|arm64|')/deepflow-agent-rpm.zip
unzip deepflow-agent-rpm.zip
yum -y localinstall x86_64/deepflow-agent-1.0*.rpm
```

@tab deb

```bash
curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/deb/agent/v6.4.9/linux/$(arch | sed 's|x86_64|amd64|' | sed 's|aarch64|arm64|')/deepflow-agent-deb.zip
curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/deb/agent/v7.0/linux/$(arch | sed 's|x86_64|amd64|' | sed 's|aarch64|arm64|')/deepflow-agent-deb.zip
unzip deepflow-agent-deb.zip
dpkg -i x86_64/deepflow-agent-1.0*.systemd.deb
```

@tab binary file

```bash
curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/bin/agent/v6.4.9/linux/$(arch | sed 's|x86_64|amd64|' | sed 's|aarch64|arm64|')/deepflow-agent.tar.gz
curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/bin/agent/v7.0/linux/$(arch | sed 's|x86_64|amd64|' | sed 's|aarch64|arm64|')/deepflow-agent.tar.gz
tar -zxvf deepflow-agent.tar.gz -C /usr/sbin/

cat << EOF > /etc/systemd/system/deepflow-agent.service
Expand Down Expand Up @@ -141,7 +141,7 @@ systemctl daemon-reload
切换 Cli 下载链接至 LTS 版本:

```bash
curl -o /usr/bin/deepflow-ctl https://deepflow-ce.oss-cn-beijing.aliyuncs.com/bin/ctl/v6.4.9/linux/$(arch | sed 's|x86_64|amd64|' | sed 's|aarch64|arm64|')/deepflow-ctl
curl -o /usr/bin/deepflow-ctl https://deepflow-ce.oss-cn-beijing.aliyuncs.com/bin/ctl/v7.0/linux/$(arch | sed 's|x86_64|amd64|' | sed 's|aarch64|arm64|')/deepflow-ctl
chmod a+x /usr/bin/deepflow-ctl
```

Expand Down
Loading