Distributed link tracking SkyWalking full installation and deployment JavaAgent
First, the installation environment
- The underlying operating system CentOS 7
- SkyWalking:SkyWalking6.6.0
- Requirements JDK1.8 +:
- 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
-
Extracting installation package
[root@example apache-skywalking-apm-bin]# tar -xvf apache-skywalking-apm-6.6.0.tar.gz -C /opt/
-
Port configuration UI
2.1 Main Contents Introduction:
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..bat
Startup script for windows;.sh
startup 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 启动脚本
-
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!
-
By Web UI detects link:
-
Configuring the back-end storage
Third, the deployment JavaAgent
JavaAgent probe deployment process:
- Agent is available for
JDK 1.6 - 12
. # Agent 用于JDK1.6-12 - The Find
agent folder
in SkyWalking Release Package Penalty for # directory to find the agent in SkyWalking directory - The SET
agent.service_name
inconfig/agent.config
. Could the any String BE in English. # In theconfig/agent.config
modifiedagent.service_name
name, display name UI console - The SET
collector.backend_service
inconfig/agent.config
. Point to the Default127.0.0.1:11800
, only Works for local backend. # Set the back-end Service collectorcollector.backend_service
,127.0.0.1:8080
only for local back-end collector. - The Add
-javaagent:/path/to/skywalking-package/agent/skywalking-agent.jar
to JVM argument. And the make the Sure the Add to the before at The IT-jar
argument. # Added-javaagent:/path/to/skywalking-package/agent/skywalking-agent.jar
before JVM parameters, ensuring that the -jar. - 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:
- The default logging output folder is /logs.# default log output to the logs directory.
- 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/plugins
in the directory, remove the plug-in jar package in this directory, this plug-in will Disabled. (Pluggable)
Fourth, Case: javaAgent deployed on Tomcat.
-
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
-
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}
-
Start Tomcat service.
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.