Distributed link tracking SkyWalking full installation and deployment JavaAgent (b)

First, the installation environment

  1. The underlying operating system CentOS 7
  2. SkyWalking:SkyWalking6.6.0
  3. Requirements JDK1.8 +:
  4. Apache-tomato 7.x

ElasticSearch

In order to activate ElasticSearch 6 as storage, set storage provider to elasticsearch
In order to activate ElasticSearch 7 as storage, set storage provider to elasticsearch7
Required ElasticSearch 6.3.2 or higher. HTTP RestHighLevelClient is used to connect server.

For ElasticSearch 6.3.2 ~ 7.0.0 (excluded), please download the apache-skywalking-bin.tar.gz or apache-skywalking-bin.zip,
For ElasticSearch 7.0.0 ~ 8.0.0 (excluded), please download the apache-skywalking-bin-es7.tar.gz or apache-skywalking-bin-es7.zip.

Second, the installation SkyWalking

  1. Extracting installation package

    [root@example apache-skywalking-apm-bin]# tar -xvf apache-skywalking-apm-6.6.0.tar.gz -C /opt/
    
  2. Port configuration UI
    2.1 Main Contents Introduction:
    Here Insert Picture Description
    2.3 config:. Profile, the information agent acquisition of major changes in the application.yml store where you want to save, the default H2, now changed to ES. ES cluster to modify the namespace name, clusterNodes URL for the ES cluster nodes to other temporary default.

    #    segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200}
      h2:
        driver: ${SW_STORAGE_H2_DRIVER:org.h2.jdbcx.JdbcDataSource}
        url: ${SW_STORAGE_H2_URL:jdbc:h2:mem:skywalking-oap-db}
        user: ${SW_STORAGE_H2_USER:sa}
        metadataQueryMaxSize: ${SW_STORAGE_H2_QUERY_MAX_SIZE:5000}
    

    2.4 webapp:. ES will show in the data out of the UI project basic configuration, change it server.port port webapp.yml default 8080
    2.5 bin startup script, startup.sh and start oap (primarily the acquisition of the probe. data upload ES) and the webapp (corresponding to zipkin-ui) two services may be started separately. .batStartup script for windows; .shstartup script for Linux;

    [root@example apache-skywalking-apm-bin]# ll bin
    total 40
    -rwxr-xr-x. 1 nginx 1002 1352 Dec 24 01:10 oapService.bat
    -rwxr-xr-x. 1 nginx 1002 1364 Dec 24 01:10 oapServiceInit.bat
    -rwxr-xr-x. 1 nginx 1002 1597 Dec 24 01:10 oapServiceInit.sh
    -rwxr-xr-x. 1 nginx 1002 1367 Dec 24 01:10 oapServiceNoInit.bat
    -rwxr-xr-x. 1 nginx 1002 1616 Dec 24 01:10 oapServiceNoInit.sh
    -rwxr-xr-x. 1 nginx 1002 1599 Dec 24 01:10 oapService.sh  # oapService 服务启动脚本
    -rwxr-xr-x. 1 nginx 1002  941 Dec 24 01:10 startup.bat
    -rwxr-xr-x. 1 nginx 1002  934 Dec 24 01:10 startup.sh  #启动oap 和UI 服务
    -rwxr-xr-x. 1 nginx 1002 1426 Dec 24 01:10 webappService.bat
    -rwxr-xr-x. 1 nginx 1002 1630 Dec 24 01:10 webappService.sh  # Web UI 启动脚本
    
  3. H2 storage used by default, start SkyWalking the UI console, appear under the plan proved successful start.

    [root@example apache-skywalking-apm-bin]# bin/startup.sh
    SkyWalking OAP started successfully!
    SkyWalking Web Application started successfully!
    
  4. By Web UI detects link:
    Here Insert Picture Description

  5. Configuring the back-end storage

Third, the deployment JavaAgent

JavaAgent probe deployment process:

  1. Agent is available for JDK 1.6 - 12. # Agent 用于JDK1.6-12
  2. The Find agent folderin SkyWalking Release Package Penalty for # directory to find the agent in SkyWalking directory
  3. The SET agent.service_namein config/agent.config. Could the any String BE in English. # In the config/agent.configmodified agent.service_namename, display name UI console
  4. The SET collector.backend_servicein config/agent.config. Point to the Default 127.0.0.1:11800, only Works for local backend. # Set the back-end Service collector collector.backend_service, 127.0.0.1:8080only for local back-end collector.
  5. The Add -javaagent:/path/to/skywalking-package/agent/skywalking-agent.jarto JVM argument. And the make the Sure the Add to the before at The IT -jarargument. # Added -javaagent:/path/to/skywalking-package/agent/skywalking-agent.jarbefore JVM parameters, ensuring that the -jar.
  6. Start your application. # Start your application.

The agent release dist is included in Apache official release. New agent package looks like this.

The new Agent package as follows:

+-- agent
    +-- activations
         apm-toolkit-log4j-1.x-activation.jar
         apm-toolkit-log4j-2.x-activation.jar
         apm-toolkit-logback-1.x-activation.jar
         ...
    +-- config
         agent.config  
    +-- plugins
         apm-dubbo-plugin.jar
         apm-feign-default-http-9.x.jar
         apm-httpClient-4.x-plugin.jar
         .....
    +-- optional-plugins
         apm-gson-2.x-plugin.jar
         .....
    +-- bootstrap-plugins
         jdk-http-plugin.jar
         .....
    +-- logs
    skywalking-agent.jar

Advanced Features:

  1. The default logging output folder is /logs.# default log output to the logs directory.
  2. All plugins are in / plugins folder. The plugin jar is active when it is in there. Remove the plugin jar, it disabled. # Support all plug-ins are present agent/pluginsin the directory, remove the plug-in jar package in this directory, this plug-in will Disabled. (Pluggable)

Fourth, Case: javaAgent deployed on Tomcat.

  1. Upload Agent directory to the specified device Tomcat

    [root@localhost opt]# ll
    total 20248
    drwxrwxr-x.  8 mysql 1002      143 Mar  8 22:01 agent
    
  2. Configuration Agent configuration file, conf / agent.conf set agent.service_name, collector.backend_service;

    [root@localhost opt]# vim /opt/agent/config/agent.config
    # The service name in UI
    agent.service_name=${SW_AGENT_NAME:Tomcat-9}
    # Backend service addresses.  #你的远程SkyWalking 服务器
    collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:192.168.2.103:11800}
    
  3. Start Tomcat service.
    Here Insert Picture Description
    By viewing port in the remote SkyWalking server:

    [root@example ~]# netstat -natpl| grep java
    tcp6       0      0 192.168.2.106:11800     192.168.2.115:42108     ESTABLISHED 4091/java
    

    Note: Normal Start java application, take the following parameters:

    java -javaagent:/path/to/agent/skywalking-agent.jar $yourApp.jar
    

5, configuration back-end storage for the ES

Boot sequence: first start elasticsearch, then start skywalking, finally started to join the probe micro-service program.

Published 51 original articles · won praise 18 · views 60000 +

Guess you like

Origin blog.csdn.net/AMimiDou_212/article/details/104751709