In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
With the popularity of micro-service architecture, some problems under micro-service architecture will become more and more prominent. For example, a request may involve multiple services, and the service itself may also rely on other services. The entire request path forms a mesh call chain. In the whole call chain, once an exception occurs in a node, the stability of the entire call chain will be affected.
In the face of the above situation, we need some tools that can help understand the system behavior and analyze performance problems, so that when a fault occurs, we can quickly locate and solve the problem. At this time, the distributed tracking system should make its debut.
1. Distributed tracking system skywalking
1. What is distributed tracking?
The above figure shows a common framework for microservices, with 4 instances, 2 MySQL and 1 Redis. In fact, it has two completely different requests coming in: one request will access Redis, another will visit MySQL;, the other may go to another service, and then go directly to MySQL. What is the purpose of the whole distributed tracking? So that we can finally replicate this process on the page, on UI, and on the data. We need to get the entire link, including the exact response time, the access method, the circle accessed, the key of the accessed Redis, etc., which is a complete information that we need to show when doing distributed tracking.
2. Introduction to skywalking
SkyWalking is an APM system for distributed systems, also known as distributed tracking system * automatic probe monitoring, no need to modify the application code. View the list of supported middleware and component libraries: https://github.com/apache/incubator-skywalking* supports manual probe monitoring and provides SDK that supports the OpenTracing standard. The coverage is extended to components supported by OpenTracing-Java. Check out the OpenTracing component support list: https://github.com/opentracing-contrib/meta* automatic monitoring and manual monitoring can be used at the same time, using manual monitoring to make up for automatic monitoring of unsupported components, or even privatizing components. * A pure Java back-end analyzer that provides RESTful services and provides analysis capabilities for other language probes. * High performance pure flow analysis
The core of SkyWalking is the storage platform for data analysis and measurement results. Analysis and measurement data are submitted to SkyWalking Collecter through HTTP or gRPC. SkyWalking Collecter analyzes and aggregates the data and stores them to Elasticsearch, H2, MySQL, TiDB and so on. Finally, we can view the final results through the visualization interface of SkyWalking UI. Skywalking supports the collection of data from multiple sources and formats: Skywalking Agent, Zipkin v1/v2, Istio survey, Envoy metrics, and other data formats in multiple languages.
Let's deploy SkyWalking+elasticsearch based on the Linux environment.
II. Preparatory work before deployment
1. Close selinux
Sed-I "s/SELINUX=enforcing/SELINUX=disabled/g" / etc/selinux/configsed-I's etc/selinux/configsetenforce
2. Install the tools you need
Yum-y install vim wget java
3. Download SkyWalking and elasticsearch
Both SkyWalking and elasticsearch provide compiled packages that can be downloaded and decompressed and used directly.
Cd / data/wget https://www-eu.apache.org/dist/skywalking/6.4.0/apache-skywalking-apm-6.4.0.tar.gzwget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.2.tar.gz
Note: SkyWalking 6.4.0 currently only supports elasticsearch 6.x.
4. The firewall opens the following ports
Firewall-cmd-permanent-add-port=9200/tcpfirewall-cmd-permanent-add-port=8080/tcpfirewall-cmd-permanent-add-port=11800/tcpfirewall-cmd-permanent-add-port=12800/tcpfirewall-cmd-reload III. Deploy elasticsearchtar zxvf elasticsearch-7.4.0-linux-x86_64.tar.gzmv elasticsearch-6.6.2 elasticsearch
Modify elasticsearch configuration
Vim elasticsearch/config/elasticsearch.ymlcluster.name: CollectorDBClusterpath.data: / data/elasticsearch/datapath.logs: / data/elasticsearch/logsnetwork.host: 0.0.0.0http.port: 9200
Create Startup user
Useradd els-p 123456chown-R els:els / data/elasticsearch
To modify the number of limit, you need to log in again and the system takes effect.
Vim / etc/security/limits.conf # add the following * soft nofile 75535 * hard nofile 75535
Modify kernel parameter vm.max_map_count
Vim / etc/sysctl.conf # add the following content vm.max_map_count=262144
Execute the following order to take effect
Sysctl-p
Switch to els user and start elasticsearch
Su-els/data/elasticsearch/bin/elasticsearch-d
Browsers access http://192.168.2.211:9200/ for verification
The above page shows that elasticsearch installs OK.
IV. Deploy SkyWalkingtar zxvf apache-skywalking-apm-6.4.0.tar.gz
Modify SkyWalking configuration
Vim apache-skywalking-apm-bin/config/application.yml
Comment out H3 content, enable elasticsearch content, and use elasticsearch to store data.
Note: nameSpace needs to be consistent with elasticsearch's cluster.name
Start SkyWalking
Cd apache-skywalking-apm-bin/bin/./startup.sh
Authentication, browser access to http://192.168.2.211:8080/
Normal access means that OK is installed.
V. access to Java projects
Skywalking supports many projects, such as Java, .net, github, sample and so on. Here I will only talk about the access and use of Java projects. For other projects, you can check the official documents.
To modify the contents of the agent/config/agent.config file, you only need to modify the following two lines
Agent.service_name=$ {SW_AGENT_NAME:YFW_Java} collector.backend_service=$ {SW_AGENT_COLLECTOR_BACKEND_SERVICES:192.168.2.211:11800}
Note: agent.servicename is the name of your java project; collector.backendservice is the IP address and port number to which the project connects to skywalking.
Package and upload the agent to the java project server and add the following parameter to start the java program when it starts.
-javaagent:/yibang/agent/skywalking-agent.jar
Note: specify the full path to the skywalking-agent.jar file
Then refresh the skywalking page and you can see the data.
Click "track" to see the details.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.