Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to track distributed links in skywalking 6.4.How to trace distributed links

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Today, I'd like to talk to you about how to track distributed links in skywalking 6.4. maybe many people don't know much about it. In order to make you understand better, the editor summarizes the following contents. I hope you can get something from this article.

Skywalking

As the business becomes more and more complex, enterprise applications have entered the stage of distributed services. with the continuous increase of modules, a request may involve the collaborative processing of more than a dozen or even dozens of services. then how to accurately and quickly locate online faults and performance bottlenecks has become a thorny problem that we have to face. Traditional log monitoring and other methods can not meet the requirements of tracking calls and troubleshooting problems. Under the guidance of Google's paper "Dapper, tracking system for large-scale distributed systems", many excellent APM came into being.

Distributed tracking system develops rapidly and has a wide variety, which brings us great convenience. However, in the process of data acquisition, it is sometimes necessary to invade the user code, and the API of different systems are not compatible, which leads to big changes if you want to switch the tracking system. In order to solve the problem of API incompatibility of different distributed tracking systems, OpenTracing gave birth to OpenTracing specification. OpenTracing is a lightweight standardization layer that sits between an application / class library and a trace or log analyzer. For a detailed introduction, see

Skywalking is a domestic open source application performance monitoring tool, which supports the monitoring, tracking and diagnosis of distributed systems.

Skywalking is an APM (Application performance Monitor), especially suitable for micro-services, Cloud Native and container-based architecture systems. Also known as distributed tracking system. It provides a way to automatically detect applications: no need to change any source code of the target application, and a collector with efficient streaming modules.

APM (Application performance Monitoring) system for distributed systems, especially for micro-service, cloud native and containerized (Docker, Kubernetes, Mesos) architecture, the core of which is a distributed tracking system.

This project is an open source project skywalking (Code Cloud, github) implemented by Chinese Wu Sheng based on OpenTracking.

On December 8, 2017, the Apache Software Foundation Incubator Project Management Committee ASF IPMC announced that "SkyWalking is unanimously approved to enter the Apache Incubator"

The picture on the official home page can be found in skywalking's general structure.

Agent: monitor agent, please keep all the contents of this directory on the host where the system service is located (this directory is used as a stand-alone program)

Bin: startup script

Webapp:UI Program and Service Catalog

Config: storage directory of relevant data sources, registries, etc.

Configure the data source

Use elasticsearch

Open the config/application.yml configuration file, in the storage node, annotate the h3 data source, and enable the elasticsearch full-text retrieval engine to store as the data source

H3 is the default built-in database (Baidu is available if you are interested)

Note several core parameters:

# configure the IP and port of your elasticsearch service. Cluster IP should be separated by commas: clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:192.168.110.35:9200} # to store content for up to 7 days. Expired data will be cleaned up. Therefore, please adjust recordDataTTL: ${SW_STORAGE_ES_RECORD_DATA_TTL:7} # Unit is day# to refresh data to the collector every 10 seconds. FlushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:10} # provides 2 concurrent requests. If the system has a large volume of business and logs are generated very quickly, adjust concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} according to the actual situation.

Use mysql

Open the config/application.yml configuration file, and in the storage node, also comment out h3 and open the configuration of mysql.

Open the config/datasource-settings.properties configuration file and modify it according to your own configuration

The content of the subsequent demonstration in this article is based on elasticsearch data source.

Modify agent agent configuration

Note the following modifications:

# modify Your_ApplicationName to your own project name agent.service_name=$ {SW_AGENT_NAME:Your_ApplicationName} # point the IP and port collector.backend_service=$ {SW_AGENT_COLLECTOR_BACKEND_SERVICES:192.168.110.35:11800} of the agent to the collector service

Running

Run the collector and UI program

Enter the bin directory (I am uploading to the linux environment to run, if it is windows, please double-click to run startup.bat)

. / startup.sh

It can also be started separately.

Start collector separately and run

. / oapService.sh

Start UI separately and run

. / webappService.sh

Use agnet

The agent standalone package directory is located in the agent directory under the apache-skywalking-apm-bin package. The agent folder can be copied separately and placed in any directory of the server where the project system is located.

The skywalking-agent.jar under the agent folder is the monitoring agent. You only need to load the jar package in the startup command of jvm to complete the monitoring agent.

Deploy java agent

Linux Tomcat 7, Tomcat 8

Modify the tomcat/bin/catalina.sh and add the following information in the first line:

CATALINA_OPTS= "$CATALINA_OPTS-javaagent:/opt/apache-skywalking-apm-bin/agent/skywalking-agent.jar"; export CATALINA_OPTS

Windows Tomcat 7, Tomcat 8

Modify the tomcat/bin/catalina.bat and add the following information in the first line:

Set "CATALINA_OPTS=-javaagent:/opt/apache-skywalking-apm-bin/agent/skywalking-agent.jar"

JAR file

Add the-javaagent parameter to the command line that starts your application. And be sure to add it before the-jar parameter. For example:

Java-javaagent:/opt/apache-skywalking-apm-bin/agent/skywalking-agent.jar-jar yourApp.jar

IDAE configuration Agent

Configure the local program agent agent in IDEA. In VM options-javaagent:D:\ test\ apache-skywalking-apm-bin\ agent\ skywalking-agent.jar, run it directly after configuration.

After running the project system and opening the system interface for business operations, skywalking-agent.jar will collect relevant logs and send them to the skywalking collector service according to the agent plan.

SkywalkingUI interface

Open the skywalking management interface (IP for skywalking service deployment):

Http://localhost:8080

Refresh the interface to obtain the monitoring data sent by agent

The boundary is relatively simple and has few functions, but all of them are practical. You can switch between multiple projects and databases. The relevant metrics can be understood and are not described in detail in this document. The specific operations are as follows:

Home page overview

URL link tracing

Connection topology diagram

Current database

Global information

Current service

Current instance

After reading the above, do you have any further understanding of how to track distributed links in skywalking 6.4? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report