Skywalking 部署

官网

bash 复制代码
## 官网地址:
skywalking.apache.org/

## 中文文档地址:
https://skyapm.github.io/document-cn-translation-of-skywalking/

## 下载地址
https://skywalking.apache.org/downloads/

参考

bash 复制代码
##
https://blog.csdn.net/qq_45518774/article/details/128798893

##
https://zhuanlan.zhihu.com/p/346605953

安装

ES作为后端存储

bash 复制代码
## 官网下载
wget https://dlcdn.apache.org/skywalking/9.3.0/apache-skywalking-apm-9.3.0.tar.gz
wget https://dlcdn.apache.org/skywalking/java-agent/8.14.0/apache-skywalking-java-agent-8.14.0.tgz

## 后端存储选择ES
elasticsearch-7.17.9-linux-x86_64.tar.gz

前置操作

vi /etc/security/limits.conf

bash 复制代码
* soft nofile 640000
* hard nofile 640000
* soft nproc 640000
* hard nproc 640000

vi /etc/sysctl.conf

bash 复制代码
vm.max_map_count=655360

配置

vim /opt/app/skywalking/config/application.yml

bash 复制代码
node.master: true
node.data: true

node.name: node-01
path.data: /opt/data/es/data
path.logs: /opt/data/es/logs
network.host: 0.0.0.0
http.port: 9200

## 支持跨域访问
http.cors.enabled: true
启动:
bash 复制代码
#以es用户启动
groupadd es
useradd es -g es -p es

##
chown -R es:es /opt/data/es/

开启启动

cat /etc/systemd/system/elastic.service

bash 复制代码
[Unit]
Description=elasticsearch


[Service]
Type=forking

User=es 
LimitNOFILE=65536
LimitNPROC=65536
ExecStart=/opt/app/elastic/bin/elasticsearch -d

[Install]
WantebBy=multi-user.target

编辑Skywalking配置文件

vi /opt/app/skywalking/config/application.yml

bash 复制代码
storage:
  #selector: ${SW_STORAGE:h2}
  selector: ${SW_STORAGE:elasticsearch}
  elasticsearch:
    namespace: ${SW_NAMESPACE:"apm-es"}  # 表示es的索引
    clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:10.1.1.32:9200}
    protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
    connectTimeout: ${SW_STORAGE_ES_CONNECT_TIMEOUT:3000}
    socketTimeout: ${SW_STORAGE_ES_SOCKET_TIMEOUT:30000}
    responseTimeout: ${SW_STORAGE_ES_RESPONSE_TIMEOUT:15000}
    numHttpClientThread: ${SW_STORAGE_ES_NUM_HTTP_CLIENT_THREAD:0}
    user: ${SW_ES_USER:""}
    password: ${SW_ES_PASSWORD:""}

启动

bash 复制代码
# 
../bin/startup.sh

Mysql作为后端存储

vi /opt/app/skywalking/config/application.yml

bash 复制代码
storage:
  #selector: ${SW_STORAGE:h2}
  selector: ${SW_STORAGE:mysql}
..............................
  mysql:
    properties:
      jdbcUrl: ${SW_JDBC_URL:"jdbc:mysql://localhost:3306/db_apm?rewriteBatchedStatements=true"}
      dataSource.user: ${SW_DATA_SOURCE_USER:root}
      dataSource.password: ${SW_DATA_SOURCE_PASSWORD:root@1234}

依赖包

官方是没有mysql的包的。去下载:

bash 复制代码
###
create database db_apm;

## 依赖驱动包下载地址
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.28


## 
mysql-connector-java-8.0.28.jar

## jar放到以下目录
/opt/app/skywalking/oap-libs/

客户端接入

Java-agent

vim /media/agent/skywalking-agent/config/agent.config

bash 复制代码
##
collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:10.1.1.32:11800}
加载agent
bash 复制代码
##
tar -xzvf apache-skywalking-apm-9.3.0.tar.gz  
tar -zxvf apache-skywalking-java-agent-8.15.0.tgz


# 每个项目需要拷贝一份skywalking-agent.jar
java -jar -javaagent:/media/agent/skywalking-agent/skywalking-agent.jar -Dskywalking.agent.service_name=demo /opt/app/java-demo/demo.jar

#或者
java -jar -javaagent:/media/agent/skywalking-agent/skywalking-agent.jar -DSW_AGENT_NAME=ke-demo-test /opt/app/java-demo/demo.jar


## 或者
# java -javaagent:/skywalking-agent/skywalking-agent.jar \
-DSW_AGENT_NAMESPACE=xyz \
-DSW_AGENT_NAME=abc-application \
-Dskywalking.collector.backend_service=skywalking.abc.xyz.com:11800 \
-jar abc-xyz-1.0-SNAPSHOT.jar
相关推荐
bohu838 天前
skywalking实现链路追踪-笔记
笔记·skywalking·单机模式
lvyuanj8 天前
IDEA skywalking 启动报错 ClassNotFoundException InstanceConstructorInterceptor
java·intellij-idea·skywalking
cominglately11 天前
centos部署SkyWalking以及在springcloud项目中搭配loki使用
spring cloud·centos·skywalking
白露与泡影13 天前
SkyWalking 和 ELK 链路追踪实战
elk·wpf·skywalking
不爱吃米饭_13 天前
SkyWalking 和 ELK 链路追踪实战
elk·wpf·skywalking
m0_6726565415 天前
SpringBoot教程(三十二) SpringBoot集成Skywalking链路跟踪
spring boot·后端·skywalking
inventecsh17 天前
docker-compose部署skywalking 8.1.0
docker·容器·skywalking
林中伊人17 天前
go引入skywalking
skywalking
wgslucky22 天前
skywalking 配置elasticsearch持久化
大数据·elasticsearch·skywalking
canxiusi22 天前
SkyWalking没办法自动创建ES索引问题
大数据·elasticsearch·skywalking