一、下载软件:
以最新版本8.9.0为例:
下载地址:
https://skywalking.apache.org/downloads/
1.下载APM监控平台程序:
2.下载代理探针工具程序:
2.解压下载的文件:
二、配置文件
1.配置APM:本机使用的话基本不用改动
配置文件位置:E:\software\apache-skywalking-apm-bin\config\application.yml
#集群配置 cluster: #默认是单机模式 selector: ${SW_CLUSTER:standalone} standalone: ... #核心配置,数据收集,分析的一些功能配置 core: selector: ${SW_CORE:default} default: #rest风格的数据接收端口 restHost: ${SW_CORE_REST_HOST:0.0.0.0} restPort: ${SW_CORE_REST_PORT:12800} #rpc风格的数据接收端口配置(默认),用来接收从skywalking-agent接收的数据 gRPCHost: ${SW_CORE_GRPC_HOST:0.0.0.0} gRPCPort: ${SW_CORE_GRPC_PORT:11800} #持久化配置 storage: #默认h2作为存储 selector: ${SW_STORAGE:h2} elasticsearch: namespace: ${SW_NAMESPACE:""} clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200} 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:""} password: ${SW_ES_PASSWORD:""} h2: driver: ${SW_STORAGE_H2_DRIVER:org.h2.jdbcx.JdbcDataSource} url: ${SW_STORAGE_H2_URL:jdbc:h2:mem:skywalking-oap-db;DB_CLOSE_DELAY=-1} user: ${SW_STORAGE_H2_USER:sa} metadataQueryMaxSize: ${SW_STORAGE_H2_QUERY_MAX_SIZE:5000} maxSizeOfArrayColumn: ${SW_STORAGE_MAX_SIZE_OF_ARRAY_COLUMN:20} numOfSearchableValuesPerTag: ${SW_STORAGE_NUM_OF_SEARCHABLE_VALUES_PER_TAG:2} maxSizeOfBatchSql: ${SW_STORAGE_MAX_SIZE_OF_BATCH_SQL:100} asyncBatchPersistentPoolSize: ${SW_STORAGE_ASYNC_BATCH_PERSISTENT_POOL_SIZE:1} 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@1234} 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} maxSizeOfArrayColumn: ${SW_STORAGE_MAX_SIZE_OF_ARRAY_COLUMN:20} numOfSearchableValuesPerTag: ${SW_STORAGE_NUM_OF_SEARCHABLE_VALUES_PER_TAG:2} maxSizeOfBatchSql: ${SW_STORAGE_MAX_SIZE_OF_BATCH_SQL:2000} asyncBatchPersistentPoolSize: ${SW_STORAGE_ASYNC_BATCH_PERSISTENT_POOL_SIZE:4} #配置中心的配置 configuration: #默认不适用配置中心 selector: ${SW_CONFIGURATION:none} none: apollo: apolloMeta: ${SW_CONFIG_APOLLO:http://localhost:8080} apolloCluster: ${SW_CONFIG_APOLLO_CLUSTER:default} apolloEnv: ${SW_CONFIG_APOLLO_ENV:""} appId: ${SW_CONFIG_APOLLO_APP_ID:skywalking} period: ${SW_CONFIG_APOLLO_PERIOD:60} zookeeper: period: ${SW_CONFIG_ZK_PERIOD:60} # Unit seconds, sync period. Default fetch every 60 seconds. namespace: ${SW_CONFIG_ZK_NAMESPACE:/default} hostPort: ${SW_CONFIG_ZK_HOST_PORT:localhost:2181} # Retry Policy baseSleepTimeMs: ${SW_CONFIG_ZK_BASE_SLEEP_TIME_MS:1000} # initial amount of time to wait between retries maxRetries: ${SW_CONFIG_ZK_MAX_RETRIES:3} # max number of times to retry nacos: # Nacos Server Host serverAddr: ${SW_CONFIG_NACOS_SERVER_ADDR:127.0.0.1} # Nacos Server Port port: ${SW_CONFIG_NACOS_SERVER_PORT:8848} # Nacos Configuration Group group: ${SW_CONFIG_NACOS_SERVER_GROUP:skywalking} # Nacos Configuration namespace namespace: ${SW_CONFIG_NACOS_SERVER_NAMESPACE:} # Unit seconds, sync period. Default fetch every 60 seconds. period: ${SW_CONFIG_NACOS_PERIOD:60} # Nacos auth username username: ${SW_CONFIG_NACOS_USERNAME:""} password: ${SW_CONFIG_NACOS_PASSWORD:""} # Nacos auth accessKey accessKey: ${SW_CONFIG_NACOS_ACCESSKEY:""} secretKey: ${SW_CONFIG_NACOS_SECRETKEY:""}
2.配置网页(webapp):通过网页可以查看应用的各种指标
配置文件位置:E:\software\apache-skywalking-apm-bin\webapp\webapp.yml
#网页web服务的端口 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 mvc: throw-exception-if-no-handler-found: true web: resources: add-mappings: true management: server: base-path: /manage
3.agent配置
配置文件地址:E:\software\skywalking-agent\config\agent.config,此文件不用做任何配置,主要做一些说明
# 应用软件在skywalking显示的名称 agent.service_name=${SW_AGENT_NAME:Your_ApplicationName} # skywalking-apm接收数据的地址. collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:127.0.0.1:11800}
三、启动
1.启动skywalking
执行E:\software\apache-skywalking-apm-bin\bin目录下的startup文件件,这样就可启动skywalking的apm和webapp程序。
2.启动应用
通过命令行启动jar包的形式:
java -javaagent:E:\software\skywalking-agent\skywalking-agent.jar -DSW_AGENT_NAME=rocketProducer -DSW_AGENT_COLLECTOR_BACKEND_SERVICES=127.0.0.1:11800 -jar rocket-producer-0.0.1-SNAPSHOT.jar
通过idea启动应用:
#skywalking-agent探针的位置 -javaagent:E:\software\skywalking-agent\skywalking-agent.jar #应用在skywalking中显示的名称 -DSW_AGENT_NAME=rocketConsumer #skywalking后端分析程序接收数据的地址 -DSW_AGENT_COLLECTOR_BACKEND_SERVICES=127.0.0.1:11800
服务和应用启动后访问http://127.0.0.1:8080/,服务获取信息不是实时的,所以需要等待几秒钟,可以看到应用已经被监控:
文章来源:https://www.toymoban.com/news/detail-603279.html
原创文章,引用请注明出处,并联系本人征得本人同意后才可转载。文章来源地址https://www.toymoban.com/news/detail-603279.html
到了这里,关于SkyWalking监控工具部署配置(单机模式:standalone)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!