【Skywalking基本介绍】
点击【下载】到官方站点下载需要的软件版本,推荐下载二进制安装包
项目地址:https://github.com/apache/incubator-skywalking/tree/5.x,如果需要其它版本请自行切换branh或者tag
解压
tar -xvzf apache-skywalking-apm-incubating-5.0.0-GA.tar.gz -C /usr/local/
进入到软件主目录
cd /usr/local/apache-skywalking-apm-incubating/ $ ls agent bin collector-libs config DISCLAIMER LICENSE licenses NOTICE README.txt webapp
相关目录介绍
agent:java客户端程序目录
bin:服务端程序启动脚本(包含Windows和Linux)
config:配置文件所在目录
webapp:服务端程序所在服务
【Elasticsearch5.x部署】
点击【下载】获取到指定的版本,推荐下载RPM包
安装java基础环境
yum -y install java-1.8.0-openjdk
安装elasticsearch
rpm -ivh elasticsearch-5.6.14.rpm
创建数据目录
mkdir -p /data/es/{data,log} chown -R elasticsearch:elasticsearch /data/es
配置elasticsearch,配置文件【/etc/elasticsearch/elasticsearch.yml】
cluster.name: skywalking node.name: node1 path.data: /data/es/data path.logs: /data/es/log network.host: 0.0.0.0 http.port: 9200
启动服务
systemctl daemon-reload systemctl enable elasticsearch.service systemctl start elasticsearch.service
备注:
【启动Skywalking服务端】
确保以下端口没有被占用
10800,11800,12800和8080
进入程序目录
/usr/local/apache-skywalking-apm-incubating
修改skywalking主配置文件,config/application.yml
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #cluster: # zookeeper: # hostPort: localhost:2181 # sessionTimeout: 100000 naming: jetty: #OS real network IP(binding required), for agent to find collector cluster host: 192.168.6.102 #修改后 port: 10800 contextPath: / cache: # guava: caffeine: remote: gRPC: # OS real network IP(binding required), for collector nodes communicate with each other in cluster. collectorN --(gRPC) --> collectorM host: 192.168.6.102 #修改后 port: 11800 agent_gRPC: gRPC: #OS real network IP(binding required), for agent to uplink data(trace/metrics) to collector. agent--(gRPC)--> collector host: 192.168.6.102 #修改后 port: 11800 # Set these two setting to open ssl #sslCertChainFile: $path #sslPrivateKeyFile: $path # Set your own token to active auth #authentication: xxxxxx agent_jetty: jetty: # OS real network IP(binding required), for agent to uplink data(trace/metrics) to collector through HTTP. agent--(HTTP)--> collector # SkyWalking native Java/.Net/node.js agents don't use this. # Open this for other implementor. host: 192.168.6.102 #修改后 port: 12800 contextPath: / analysis_register: default: analysis_jvm: default: analysis_segment_parser: default: bufferFilePath: ../buffer/ bufferOffsetMaxFileSize: 10M bufferSegmentMaxFileSize: 500M bufferFileCleanWhenRestart: true ui: jetty: # Stay in `localhost` if UI starts up in default mode. # Change it to OS real network IP(binding required), if deploy collector in different machine. host: 192.168.6.102 #修改后 port: 12800 contextPath: / storage: elasticsearch: clusterName: skywalking #修改后 clusterTransportSniffer: true clusterNodes: localhost:9300 #修改后 indexShardsNumber: 2 indexReplicasNumber: 0 highPerformanceMode: true # Batch process setting, refer to https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.5/java-docs-bulk-processor.html bulkActions: 2000 # Execute the bulk every 2000 requests bulkSize: 20 # flush the bulk every 20mb flushInterval: 10 # flush the bulk every 10 seconds whatever the number of requests concurrentRequests: 2 # the number of concurrent requests # Set a timeout on metric data. After the timeout has expired, the metric data will automatically be deleted. traceDataTTL: 90 # Unit is minute minuteMetricDataTTL: 90 # Unit is minute hourMetricDataTTL: 36 # Unit is hour dayMetricDataTTL: 45 # Unit is day monthMetricDataTTL: 18 # Unit is month #storage: # h2: # url: jdbc:h2:~/memorydb # userName: sa configuration: default: #namespace: xxxxx # alarm threshold applicationApdexThreshold: 2000 serviceErrorRateThreshold: 10.00 serviceAverageResponseTimeThreshold: 2000 instanceErrorRateThreshold: 10.00 instanceAverageResponseTimeThreshold: 2000 applicationErrorRateThreshold: 10.00 applicationAverageResponseTimeThreshold: 2000 # thermodynamic thermodynamicResponseTimeStep: 50 thermodynamicCountOfResponseTimeSteps: 40 # max collection's size of worker cache collection, setting it smaller when collector OutOfMemory crashed. workerCacheMaxSize: 10000 #receiver_zipkin: # default: # host: localhost # port: 9411 # contextPath: /
主要修改监听与访问的地址,全都修改为真实的IP,另外就是修改访问ES集群的地址,填写集群名和地址端口即可
修改skywalking-webapp配置文件,webapp/webapp.yml
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. server: port: 8080 collector: path: /graphql ribbon: ReadTimeout: 10000 listOfServers: 192.168.6.102:10800 #修改后 security: user: admin: password: admin
修改访问collector服务的地址
启动服务
sh bin/startup.sh
访问dashboard,服务端程序所在服务器的地址+8080端口访问
默认用户名密码:admin/admin
【部署java客户端】
修改配置文件,客户端程序就是agent整个目录,配置文件在agent/config/agent.config
agent.application_code=APPNAME collector.servers=192.168.6.102:10800
主要修改当前客户端所在app的名称和访问collector的地址
在java项目中使用agent
参考资料:github地址
使用方法:官方博客