Monitoring Cloud Servers

This document was translated by GPT-4

# 1. Introduction

DeepFlow supports monitoring cloud servers, retrieving cloud resource data via the cloud vendor's API, and injecting this data automatically into all observable data sets (AutoTagging). Note that DeepFlow Server must run on K8s. If you do not have a Kubernates cluster, you can first deploy DeepFlow Server according to the All-in-One Quick Deployment section.

# 2. Deployment Topology

# 3. Create Public Cloud Domain

Currently, DeepFlow supports synchronizing resource information from the following public clouds (those labeled as 'TBD' are being coded):

Cloud Service Provider (English) Cloud Service Provider (Chinese) Type Identifier Used in DeepFlow
AWS AWS aws
Aliyun Aliyun aliyun
Baidu Cloud Baidu Cloud baidu_bce
Huawei Cloud Huawei Cloud huawei
Microsoft Azure Microsoft Azure TBD
QingCloud QingCloud qingcloud
Tencent Cloud Tencent Cloud tencent

You can use the deepflow-ctl domain example <domain_type> command to access the configuration file template to create a public cloud Domain. Taking Aliyun as an example:

deepflow-ctl domain example aliyun > aliyun.yaml
1

Modify the aliyun.yaml configuration file, filling in AK/SK (requires read-only permissions for cloud resources) and Region information:

name: aliyun
type: aliyun
config:
  # AccessKey Id
  secret_id: xxxxxxxx ## FIXME: your secret_id
  # AccessKey Secret
  secret_key: xxxxxxx ## FIXME: your secret_key
  include_regions: 北京华北2 ## The region where deepflow is hosted, if left blank it indicates all regions, and the regions are separated by commas
1
2
3
4
5
6
7
8

Use the modified configuration file to create a public cloud Domain:

deepflow-ctl domain create -f aliyun.yaml
1

# 4. Deploy DeepFlow Agent

Download deepflow-agent:

curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/rpm/agent/stable/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
1
2
3
curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/deb/agent/stable/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
1
2
3
curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/bin/agent/stable/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
[Unit]
Description=deepflow-agent.service
After=syslog.target network-online.target

[Service]
Environment=GOTRACEBACK=single
LimitCORE=1G
ExecStart=/usr/sbin/deepflow-agent
Restart=always
RestartSec=10
LimitNOFILE=1024:4096

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

Modify the deepflow-agent configuration file /etc/deepflow-agent.yaml:

controller-ips:
  - 10.1.2.3 # FIXME: K8s Node IPs
1
2

Start deepflow-agent:

systemctl enable deepflow-agent
systemctl restart deepflow-agent
1
2

Note:

If deepflow-agent cannot start normally due to lack of dependency libraries, you can download deepflow-agent compiled with static link. Please note that deepflow-agent compiled with static link has serious performance issues under multi-threading:

curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/rpm/agent/stable/linux/static-link/$(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
1
2
3
curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/deb/agent/stable/linux/static-link/$(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
1
2
3
curl -O https://deepflow-ce.oss-cn-beijing.aliyuncs.com/bin/agent/stable/linux/static-link/$(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
[Unit]
Description=deepflow-agent.service
After=syslog.target network-online.target

[Service]
Environment=GOTRACEBACK=single
LimitCORE=1G
ExecStart=/usr/sbin/deepflow-agent
Restart=always
RestartSec=10
LimitNOFILE=1024:4096

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# 5. Next Steps