目录
一、搭建SkyWalking
1.1 版本选择
项目的JDK版本使用的JDK8,SkyWalking 9.x版本要求JDK版本至少为11,因此选择8.*,这里选择 8.9.1
开始安装9.4版本后查看启动日志报错:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/skywalking/oap/server/starter/OAPServerStartUp has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
版本问题:kyWalking需要JDK11或JDK17。如果您使用的Java版本只识别52.0以下的类文件版本,则意味着您使用的是Java 8。您需要将Java版本升级到JDK11或JDK17来解决这个问题。下面是启动后端的步骤:确保系统上安装了JDK11或JDK17。
1.2 下载安装
在虚拟机上安装。
下载链接:https://archive.apache.org/dist/skywalking/ 下选择版
wget https://archive.apache.org/dist/skywalking/8.9.1/apache-skywalking-apm-8.9.1.tar.gz
tar -xzf apache-skywalking-apm-8.9.1.tar.gz
1.3 配置启动
修改配置端口:apache-skywalking-apm-bin/webapp/webapp.yml
默认8080,修改为8100
server:
port: 8100
spring:
discovery:
client:
simple:
instances:
oap-service:
- uri: http://192.168.64.128:12800//修改为ip
修改apache-skywalking-apm-bin/config/application.yml配置:
选择elasticsearch进行存储
storage:
selector: ${SW_STORAGE:elasticsearch}
elasticsearch:
namespace: ${SW_NAMESPACE:"hbintrade-framework"}
clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:192.168.64.128:9200} #注意改成ip
protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
connectTimeout: ${SW_STORAGE_ES_CONNECT_TIMEOUT:500}
socketTimeout: ${SW_STORAGE_ES_SOCKET_TIMEOUT:30000}
numHttpClientThread: ${SW_STORAGE_ES_NUM_HTTP_CLIENT_THREAD:0}
user: ${SW_ES_USER:"elastic"} # es用户名密码
password: ${SW_ES_PASSWORD:"123456"}
trustStorePath: ${SW_STORAGE_ES_SSL_JKS_PATH:""}
trustStorePass: ${SW_STORAGE_ES_SSL_JKS_PASS:""}
secretsManagementFile: ${SW_ES_SECRETS_MANAGEMENT_FILE:""} # Secrets management file in the properties format includes the username, password, which are managed by 3rd party tool.
dayStep: ${SW_STORAGE_DAY_STEP:1} # Represent the number of days in the one minute/hour/day index.
indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:1} # Shard number of new indexes
indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:1} # Replicas number of new indexes
# Super data set has been defined in the codes, such as trace segments.The following 3 config would be improve es performance when storage super size data in es.
superDatasetDayStep: ${SW_SUPERDATASET_STORAGE_DAY_STEP:-1} # Represent the number of days in