SkyWalking study notes (CentOS environment)

Based on CentOS environment, use SkyAPM-dotnet to introduce SkyWalking. SkyAPM-dotnet is SkyWalking's .NET Agent

** Environmental requirements**

  1. JDK8+
  2. Elasticsearch
  3. 8080,9200,10800,11800,12800 Port is not occupied
** Elasticsearch installation**

Download and install Elasticsearch (CentOS as an example) Refer to the official tutorial.

  1. Download and install the public signing key
    rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
  2. yum add installation source warehouse
    Modify /etc/yum.conf file, add source
    [ elasticsearch]``name=Elasticsearch repository for 7.x packages``baseurl=https://artifacts.elastic.co/packages/7.x/yum``gpgcheck=1``gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch``enabled=0``autorefresh=1``type=rpm-md
  3. Install Elasticsearch
    sudo yum install --enablerepo=elasticsearch elasticsearch
Change setting######

After the installation is complete, you need to make the following changes to /etc/elasticsearch.yml

# modify
# If cluster.name is not set to CollectorDBCluster, you need to modify the SkyWalking configuration file
cluster.name: CollectorDBCluster
# IP port
network.host:0.0.0.0
http.host:0.0.0.0
http.port:9200
# node
node.name: node-1
cluster.initial_master_nodes:["node-1"]

For more configuration, refer to the official document

Elasticsearch's port is bound to 127.0.0.1 by default, http.host is configured for opening http ports to the outside world, and network.host is configured for opening tcp ports to the outside world
About network configuration refer to official

start up######

To configure Elasticsearch to start automatically when the system starts

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service

Start and stop can use the following commands

sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service

You can test whether your Elasticsearch node is running by sending an HTTP request to the local host port 9200

 curl "http://localhost:9200/"

The following message should be displayed

{" name":"XXXX","cluster_name":"CollectorDBCluster","cluster_uuid":"JVNBpkf1TjeFJUjiPdD5dQ","version":{"number":"7.5.1","build_flavor":"default","build_type":"rpm","build_hash":"3ae9ac9a93c95bd0cdc054951cf95d88e1e18d96","build_date":"2019-12-16T22:57:37.835892Z","build_snapshot":false,"lucene_version":"8.3.0","minimum_wire_compatibility_version":"6.8.0","minimum_index_compatibility_version":"6.0.0-beta1"},"tagline":"You Know, for Search"}
** SkyWalking installation**

SkyWalking recommends to download the official compilation directly, download link

(http://skywalking.apache.org/downloads/)

( Linux can download Binary Distribution for ElasticSearch 7 (Linux))

After decompression, renamed to SkyWalking-ES7 (see personal hobbies)

Change setting######

The file is located at /home/SkyWalking-ES7/config/application.yml

The default data storage is h2, here we need to modify the data storage to Elasticsearch7 (before starting SkyWalking, make sure that Elasticsearch is started)

start up######

The startup of SkyWalking (bin directory) includes two parts, one is SkyWalking Collector (oapService) and the other is SkyWalking UI (webappService).

Bat is used in windows environment and sh is used in linux environment. We can start oapService and webappService separately, or start them all at once through startup. From the commands in startup, we can know that they actually start oapService and webappService separately.

# cd /home/SkyWalking-ES7/bin    --The bin directory decompressed by SkyWalking
# . /startup.sh

The following message indicates success

SkyWalking OAP started successfully!
SkyWalking Web Application started successfully!

If you start to access successfully (refer to the quick start if it fails), you can open the link http://localhost:8080
View SkyWalking UI

Configure SkyWalking UI (optional)

The file is located at /home/SkyWalking-ES7/webapp/webapp.yml

Config Description
server.port Listen on port 8080 by default
collector.ribbon.listOfServers collector's access service name (same as the naming.jetty configuration in config/application.yml) and if there are multiple collector service names separated by','
collector.path Collector query uri address. The default is /graphql
collector.ribbon.ReadTimeout Query timeout time, the default is 10 seconds
** . NET project access**

Refer to the Demo under the official link SkyAPM-dotnet sample directory

  1. Create a new .net core api project and install the Nuget package
Install-Package SkyAPM.Agent.AspNetCore
  1. Add environment variables (reference)
    set ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=SkyAPM.Agent.AspNetCore
  2. Add the skyapm.json file in the project root directory and add the configuration information of SkyWalking (for more default configuration reference)
    You can also add it directly in appsettings.json and add cs code
  3. Start the program, the requested tracking result will be recorded, and view through SkyWalking UI

Some of the above configuration files can refer to the quick start
https://github.com/apache/skywalking/blob/5.x/docs/cn/Deploy-backend-in-cluster-mode-CN.md

Reprinting is a kind of power Sharing is a virtue

Author: Heart Levin Technology Chen Langlin

If you like the author's article, please pay attention to the subscription number of [Makou Chat Technology] to get the latest content as soon as possible. The copyright of this article belongs to the author and Hunan Xinlai Information Technology Co., Ltd., welcome to reprint, but this statement must be retained without the author's consent, and the original link must be given in an obvious place on the article page, otherwise the right to pursue legal responsibility is reserved.

Document official website: docs.xin-lai.com

Recommended Posts

SkyWalking study notes (CentOS environment)
Container study notes CentOS7 install Docker
Python study notes (1)
python study notes
Python study notes (3)
CentOS6.7 build LNMP environment
Hadoop environment construction (centos7)
Centos7.6 build LNMP environment
lamp (centos7) installation lamp environment
Centos6.9 install npm environment
Ubuntu Linux study notes
Linux notes (1): CentOS-7 installation
Centos7 configure nodejs environment
Configure CentOS7 GPU environment
CentOS 7 build LNMP environment
[CentOS environment deployment] Java7/Java8 deployment under CentOS
Build docker environment under Centos6.5
CentOS 7 install JAVA environment (JDK 1.8)
Centos7 set up GitBook environment
CentOS 7.2 deploy Node.js development environment
CentOS install nginx+tomcat+java+mysql operating environment
Centos6 set up GitBook environment
CentOS environment installation of Docker
Centos7 deploys python3 virtual environment
Centos7.4 environment installation lamp-php7.0 tutorial
CentOS 7 configure Java language development environment
CentOS 7 configure Ruby language development environment
CentOS 7 configure php language development environment
CentOS7 compile and install L(A|N)MP environment
Build Nginx environment on Linux (CentOS)
Configure python3 environment on centos7 and
FFmpeg environment deployment record under centos7
CentOS6.8 Chinese/English environment switching tutorial illustration
CentOS 7 configure Python language development environment
PPTP environment deployment record under Centos
Tomcat configuration JMX in centos 6.5 environment