SkyWalking
SkyWalking
SkyWalking 是分布式系统的应用程序性能监视工具,专为微服务、云原生架构和基于容器(Docker、K8s、Mesos)架构而设计。SkyWalking 是观察性分析平台和应用性能管理系统,提供分布式追踪、服务网格遥测分析、度量聚合和可视化一体化解决方案。
以下说明SkyWalking集群部署的流程:
1.准备
- Nacos集群,准备集群访问地址,参考Nacos部署内容。
- Elasticsearch集群,准备集群访问地址,参考ELK部署内容。
- 负载均衡服务器,用于配置SkyWalking访问,参考Nginx部署内容。
- 至少2台服务器,用于集群高可用部署。
1.下载
下载地址:https://archive.apache.org/dist/skywalking/8.8.1/apache-skywalking-apm-8.8.1.tar.gz
下载后上传到2台服务器上。
2.部署
在2台服务器上分别进行以下操作,默认数据盘在/hos:
2.1 解压
tar zxf apache-skywalking-apm-8.8.1.tar.gz -C /hos/
2.2 修改配置
修改后端服务的配置文件:apache-skywalking-apm-bin/config/application.yml
cluster:
selector: ${SW_CLUSTER:nacos}
nacos:
serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
hostPort: ${SW_CLUSTER_NACOS_HOST_PORT:localhost:8848}
# Nacos Configuration namespace
namespace: ${SW_CLUSTER_NACOS_NAMESPACE:"public"}
# Nacos auth username
username: ${SW_CLUSTER_NACOS_USERNAME:""}
password: ${SW_CLUSTER_NACOS_PASSWORD:""}
storage:
selector: ${SW_STORAGE:elasticsearch}
elasticsearch:
namespace: ${SW_NAMESPACE:""}
clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}
protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
其中:
- localhost:8848修改为nacos服务器地址。
- localhost:9200修改为elasticsearch地址。
修改前端UI的配置文件:apache-skywalking-apm-bin/webapp/webapp.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.
server:
port: 8080
spring:
cloud:
gateway:
routes:
- id: oap-route
uri: lb://oap-service
predicates:
- Path=/graphql/**
discovery:
client:
simple:
instances:
oap-service:
- uri: http://127.0.0.1:12800
# - uri: http://<oap-host-1>:<oap-port1>
# - uri: http://<oap-host-2>:<oap-port2>
mvc:
throw-exception-if-no-handler-found: true
web:
resources:
add-mappings: true
management:
server:
base-path: /manage
其中oap-service:配置2个后端服务的地址。
2.3 启动服务
sh apache-skywalking-apm-bin/bin/startup.sh
2.4 配置负载均衡
stream {
upstream skywalking-oap-server {
server 10.241.12.4:11800;
server 10.241.12.5:11800 backup;
}
upstream skywalking-ui {
server 10.241.12.4:8080;
server 10.241.12.5:8080 backup;
}
server {
listen 11800;
proxy_pass skywalking-oap-server;
}
server {
listen 8080;
proxy_pass skywalking-ui;
}
}
3.访问验证
访问负载均衡虚拟IP地址:8080,即可打开skywalking的web页面。