废话不多。
一 下载skywalking
最新版APM和Agent分开了。所以我们要下载2个
APM:
Agent:
下载后解压,
二 修改skywalking配置
1 apache-skywalking-apm-bin\config
application.yml
修改数据库(我用的Mysql)
注意修改selector 为mysql,并mysql连接修改账号密码
storage: selector: ${SW_STORAGE:mysql} mysql: properties: jdbcUrl: ${SW_JDBC_URL:"jdbc:mysql://localhost:3306/swtest?rewriteBatchedStatements=true"} 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} metadataQueryMaxSize: ${SW_STORAGE_MYSQL_QUERY_MAX_SIZE:5000} maxSizeOfBatchSql: ${SW_STORAGE_MAX_SIZE_OF_BATCH_SQL:2000} asyncBatchPersistentPoolSize: ${SW_STORAGE_ASYNC_BATCH_PERSISTENT_POOL_SIZE:4}
2 修改Tomcat配置
Tomcat\bin
catalina.bat
首行增加:
set "CATALINA_OPTS= -javaagent:C:\Users\DELL\Downloads\skywalking-agent\skywalking-agent.jar -Dskywalking.agent.service_name=test -Dskywalking.collector.backend_service=127.0.0.1:11800"
三 运行
1 tomcat:
启动tomcat之前,先将springmvc的war包,放到tomcat的webapp下
运行startup.bat
2 skywalking
启动apache-skywalking-apm-bin\bin\startup.bat
标签:Tomcat,SW,SOURCE,dataSource,mysql,skywalking,DATA From: https://www.cnblogs.com/hanjun0612/p/17101643.html