4 3.2 Deploy skywalking agent
吴晟 Wu Sheng edited this page 2017-09-29 11:59:14 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Download skywalking agent release version

Deploy skywalking javaagent

  • Add -javaagent:/path/to/javaagent/jar to VM argument.

  • Configure skywalking agent. There are two ways to configure java agent:

  1. Configure by VM argument. In this way, only need to set applicationCode and servers parameters. The applicationCode is the identification for the application(Not process, all the processes of the same application should use the same name). The servers targets one or several IP:port of collectors, several collectors should be seperated by ,. The address(IP:port) matches the agent_server/jetty/port config item in Collector's config/application.yml.
 -DapplicationCode=test-service -Dservers=127.0.0.1:10800
  1. Configure by sky-walking.conf file. The file absolute path should be set by -Dconfig=/path/to/sky-walking/config, default file name is sky-walking.config; or it is in the same directory as skywalking-agent.jar.
# Application name, show in UI.
# All the processes of the same application should use the same name
agent.application_code=Your_ApplicationName

# How many traces should sample in 3 seconds bucket.
# Negative value means off. Collect as many traces as possible, if the buffer is still available.
# agent.sample_n_per_3_secs=-1

# The suffix of entry operation name, mostly uri, should be ignored. Never sampled
# Default configurations
# agent.ignore_suffix=.jpg,.jpeg,.js,.css,.png,.bmp,.gif,.ico,.mp3,.mp4,.html,.svg

# Match `agent_server/jetty/port` config item in collector's `config\application.yml`
# e.g.
# Single Node Mode:SERVERS="127.0.0.1:8080" 
# Cluster Mode:SERVERS="10.2.45.126:8080,10.2.45.127:7600" 
collector.servers=127.0.0.1:10800

# The prefix of log file name. 
logging.file_name=skywalking-agent.log

# The path of log file
# Default is empty, agent outputs the log into the system console.
logging.dir=

# The size of each log file.
# Default is 300M
logging.max_file_size=314572800

# Log level. Default is DEBUG。
logging.level=DEBUG
  • Start your application。

Deploy agent in Tomcat FAQ

  • Tomcat 7 Change the first line of tomcat/bin/catalina.sh.
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/path/to/skywalking-agent.jar -Dconfig=\skywalking\config\dir"; export CATALINA_OPTS
  • Tomcat 8 Change the first line of tomcat/bin/catalina.sh.
set "CATALINA_OPTS=... -javaagent:E:\apache-tomcat-8.5.20\skywalking-agent.jar -Dconfig=\skywalking\config\dir"