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 deploy skywalking in docker to realize full Link Monitoring function

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "how to deploy skywalking in docker to achieve full-link monitoring function". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to deploy skywalking in docker to achieve full link monitoring".

I. Overview and introduction

Skywalking is an open source platform for collecting, analyzing, aggregating, and visualizing data from different services and local infrastructure services.

Skywalking provides an easy way to get a clear understanding of your distributed systems and even cross-cloud services.

It is more like a modern system performance management, especially designed for distributed systems.

Function

Skywalking provides a way to observe and monitor distributed systems in many different scenarios.

First of all, like traditional methods, skywalking provides automatic probe proxies for java,c#,Node.js and others.

At the same time, it provides manual probes for Go,C++.

With more and more local services and the need for more and more languages, the risk of controlling the code is also increasing.

Skywalking can use mesh service probes to collect data to understand the entire distributed system.

In general, skywalking provides the ability to observe service,service instance,endpoint.

Service: a service

Service Instance: an instance of a service (1 service starts multiple nodes)

Endpoint: one of the interfaces in a service

Architecture diagram

II. Description of rapid deployment environment

Operating system: centos 7.6

Docker version: 19.03.12

Ip address: 192.168.31.146

Configuration: 4core 8g

Download image docker pull elasticsearch:7.5.1docker pull apache/skywalking-oap-server:6.6.0-es7docker pull apache/skywalking-ui:6.6.0

Note: using the latest versions of elasticsearch and skywalking-oap-server images, there will be problems with startup.

Therefore, you must use the above version.

Download the source package, and agent will be used below

Install elasticsearch to modify system parameters vi / etc/sysctl.conf

Adjust parameters

Vm.max_map_count=262144

Refresh parameter

Sysctl-p starts elasticsearchdocker run-d-- name=es7\-p 9200 name=es7 9200-p 9300 name=es7 9300\-e "discovery.type=single-node" elasticsearch:7.5.1

Wait about 30 seconds, check the docker log, if there is any

"publish_address {172.17.0.2 9300}, bound_addresses {0.0.0.0 VR 9300}"

It means the startup is successful.

Create a persistent directory and restart the startup elasticsearch

Mkdir-p / data/elasticsearchdocker cp es7:/usr/share/elasticsearch/data / data/elasticsearch/docker cp es7:/usr/share/elasticsearch/logs / data/elasticsearch/docker rm-f es7docker run-d-name=es7\-- restart=always\-p 9200V / data/elasticsearch/data:/usr/share/elasticsearch/data\-v / data/elasticsearch/logs:/usr/share/elasticsearch/logs\ elasticsearch:7.5.1 install oap

Note: wait for elasticsearch to fully start before starting oap

Docker run-- name oap--restart always-d\-- restart=always\-e TZ=Asia/Shanghai\-p 12800 TZ=Asia/Shanghai 12800\-p 11800 restart always 11800\-- link es7:es7\-e SW_STORAGE=elasticsearch\-e SW_STORAGE_ES_CLUSTER_NODES=es7:9200\ apache/skywalking-oap-server:6.6.0-es7

Description: elasticsearch is specified here to store data

Install uidocker run-d-- name skywalking-ui\-- restart=always\-e TZ=Asia/Shanghai\-p 8088 TZ=Asia/Shanghai 8080\-- link oap:oap\-e SW_OAP_ADDRESS=oap:12800\ apache/skywalking-ui:6.6.0

Note: the port mapped here is 8088 to prevent port conflicts.

3. Deploy and create jar package for spring-boot instance

Find a server with jdk1.8 and maven installed, and package it with the maven build command

Mvn clean package

After the package is finished, the jar package is generated in the target directory, and the file name is: spring-boot-demo-0.0.1-SNAPSHOT.jar

Start the jar package

The original startup method is:

Java-jar spring-boot-demo-0.0.1-SNAPSHOT.jar

Then using skywalkingagent, the startup command is:

Java-javaagent:/opt/apache-skywalking-apm-bin/agent/skywalking-agent.jar-Dskywalking.agent.service_name=xxxtest-Dskywalking.collector.backend_service=127.0.0.1:11800-jar / opt/spring-boot-demo-0.0.1-SNAPSHOT.jar

Description:

-javaagent specifies the location of the agent package. Here I extracted the apache-skywalking-apm-6.6.0.tar.gz to the / opt directory, so the path is: / opt/apache-skywalking-apm-bin/agent/skywalking-agent.jar

-Dskywalking.agent.service_name specifies the service name

-Dskywalking.collector.backend_service specifies the skywalking oap address, since on the local machine, the address is: 127.0.0.1 11800

-jar specifies the path of the jar package, which I put directly into the / opt/ directory.

Visit ui

Http://192.168.31.146:8088/

The effect is as follows:

Because the mechanism is lazy loading, it is displayed on the page only when you call the java interface. So on the first visit, there is no data.

Access the demo interface

The SpringBootDemo boot port is: 8080. There are 3 API interfaces.

GET / GET /? name=cheneyGET / random

The page is refreshed several times.

Http://192.168.31.146:8080/

Http://192.168.31.146:8080/?name=cheney

Http://192.168.31.146:8080/randomAbout

Instrument panel

Refresh the ui page and select the one for the last 15 minutes.

Topological graph

Click on the topology diagram and select the last 15 minutes

You can see that xxxtest is the name of the service we defined.

Tracking

Again, but check out the last 15 minutes.

Alarm

Check for the last 15 minutes.

Index

Here, three indicators can be selected for comparison. >

At this point, I believe you have a deeper understanding of "how to deploy skywalking in docker to achieve full-link monitoring function". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Development

Wechat

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

12
Report