方式二:通过 Telegraf receiver 具体参考官网文档的部署方式 https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-vm-monitoring 。
下面让我们一起开始部署吧
部署 SkyWalking
之前的文章都是默认大家会部署 SkyWalking 的,这里我也提供下平时测试用的部署方式,我这里采用 docker compose 部署,主要是参考官网提供的部署配置,
SkyWalking 提供的部署基础配置在代码目录中,链接地址 https://github.com/apache/skywalking/tree/master/docker 。
docker-compose.yml
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: '3.8'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:${ES_VERSION}
container\_name: elasticsearch
ports:
- "9200:9200"
healthcheck:
test: [ "CMD-SHELL", "curl --silent --fail localhost:9200/\_cluster/health || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
start\_period: 10s
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES\_JAVA\_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
oap:
image: ${OAP_IMAGE}
container\_name: oap
depends\_on:
elasticsearch:
condition: service_healthy
links:
- elasticsearch
ports:
- "11800:11800"
- "12800:12800"
healthcheck:
test: [ "CMD-SHELL", "/skywalking/bin/swctl ch" ]
interval: 30s
timeout: 10s
retries: 3
start\_period: 10s
environment:
SW\_STORAGE: elasticsearch
SW\_STORAGE\_ES\_CLUSTER\_NODES: elasticsearch:9200
SW\_HEALTH\_CHECKER: default
SW\_TELEMETRY: prometheus
JAVA\_OPTS: "-Xms2048m -Xmx2048m"
ui:
image: ${UI_IMAGE}
container\_name: ui
depends\_on:
oap:
condition: service_healthy
links:
- oap
ports:
- "8080:8080"
environment:
SW\_OAP\_ADDRESS: http://oap:12800
SW\_ZIPKIN\_ADDRESS: http://oap:9412
.env
用于镜像版本,这里使用 SkyWalking 9.7.0 版本,也是当前最新的版本
# The docker-compose.yml file is meant to be used locally for testing only after a local build, if you want to use it
# with officially released Docker images, please modify the environment variables on your command line interface.
# i.e.:
# export OAP_IMAGE=apache/skywalking-oap-server:<tag>
# export UI_IMAGE=apache/skywalking-ui:<tag>
# docker compose up
ES_VERSION=7.4.2
OAP_IMAGE=apache/skywalking-oap-server:9.7.0
UI_IMAGE=apache/skywalking-ui:9.7.0
启动 SkyWalking
docker compose up
启动完成后,访问 http://IP:8080 就可以正常打开 dashboard 页面了,当然这个时候还看不到监控数据。
部署 Prometheus node-exporter
node-exporter 官方文档 ,下载地址 https://prometheus.io/download/#node_exporter
这里下载 1.7.0 版本
wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz
tar xvfz node_exporter-1.7.0.linux-amd64.tar.gz
cd node_exporter-1.7.0.linux-amd64
./node_exporter
启动成功后访问 http://IP:9100/metrics 可以看到采集到的 metrics 信息。
部署 OpenTelemetry Collector
OpenTelemetry Collector 官方文档
这里将 otel-collector
和 skywalking 一起通过 docker compose 部署,完整配置如下:
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: '3.8'
services:
elasticsearch:
**自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。**
**深知大多数Linux运维工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!**
**因此收集整理了一份《2024年Linux运维全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。**
![img](https://img-blog.csdnimg.cn/img_convert/7c9d39c84f6cb85bed0521714bb535d2.png)
![img](https://img-blog.csdnimg.cn/img_convert/72374c810f4d28c0195b8ac6a830ed6e.png)
![img](https://img-blog.csdnimg.cn/img_convert/16265ec983df8433846333dbf33ea911.png)
![img](https://img-blog.csdnimg.cn/img_convert/36900cc692fb34f4b0304a9c9fe74308.png)
![img](https://img-blog.csdnimg.cn/img_convert/1f65ea9a5bff35088f914e07058e6f43.png)
**既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Linux运维知识点,真正体系化!**
**由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新**
**如果你觉得这些内容对你有帮助,可以添加VX:vip1024b (备注Linux运维获取)**
![img](https://img-blog.csdnimg.cn/img_convert/8b31c83f168a0edff05f4f9c00c7df81.jpeg)
### 最后的话
最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!
### 资料预览
给大家整理的视频资料:
![](https://img-blog.csdnimg.cn/img_convert/a481a412fefb9927271e48b45ddff656.png)
给大家整理的电子书资料:
![](https://img-blog.csdnimg.cn/img_convert/03b6a4350fcf71194f783cd79f7c515c.png)
**如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!**
**一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
![img](https://img-blog.csdnimg.cn/img_convert/6165cee3ed1ad812488f763bc1ee19b4.jpeg)
h8GCqDH-1712646272217)]
**如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!**
**一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
[外链图片转存中...(img-FvVoJLyV-1712646272218)]