先总结IDEA整合skywalking
一,下载
二,修改启动端口
修改D:\apache-skywalking-apm-bin\webapp\webapp.yml
主要修改port: 18080
server:
port: 18080
collector:
path: /graphql
ribbon:
ReadTimeout: 10000
# Point to all backend's restHost:restPort, split by ,
listOfServers: 127.0.0.1:12800
三,更改数据库为mysql
1 下载mysql-connector-java-5.1.46.jar到oap-libs下
只要是mysql-connector-java-5的版本就可以。
2 打开D:\apache-skywalking-apm-bin\config\application.yml
注释H2,开启mysql
# h2:
# driver: ${SW_STORAGE_H2_DRIVER:org.h2.jdbcx.JdbcDataSource}
# url: ${SW_STORAGE_H2_URL:jdbc:h2:mem:skywalking-oap-db}
# user: ${SW_STORAGE_H2_USER:sa}
# metadataQueryMaxSize: ${SW_STORAGE_H2_QUERY_MAX_SIZE:5000}
mysql:
properties:
jdbcUrl: ${SW_JDBC_URL:"jdbc:mysql://localhost:3306/swtest"}
dataSource.user: ${SW_DATA_SOURCE_USER:root}
dataSource.password: ${SW_DATA_SOURCE_PASSWORD:root}
dataSource.cachePrepStmts: ${SW_DATA_SOURCE_CACHE_PREP_STMTS:true}
dataSource.prepStmtCacheSize: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE:250}
dataSource.prepStmtCacheSqlLimit: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT:2048}
dataSource.useServerPrepStmts: ${SW_DATA_SOURCE_USE_SERVER_PREP_STMTS:true}
dataSource.useSSL: false
metadataQueryMaxSize: ${SW_STORAGE_MYSQL_QUERY_MAX_SIZE:5000}
3 接着,到Mysql中创建一个 swtest数据库。
四,修改IDEA的配置
-javaagent:D:/apache-skywalking-apm-bin/agent/skywalking-agent.jar
-Dskywalking.collector.backend_service=localhost:11800
五,启动
1 先开启微服务(注册中心,配置中心,zuul,个别服务)
2 启动 D:\apache-skywalking-apm-bin\bin\startup.bat
PS:学会看日志很重要!!!
D:\apache-skywalking-apm-bin\logs\skywalking-oap-server.log