tomcat实现链路追踪-skywalking
下载软件包
wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.82/bin/apache-tomcat-8.5.82.tar.gz
wget https://download.oracle.com/java/18/latest/jdk-18_linux-x64_bin.rpm
wget --no-check-certificate https://get.jenkins.io/war-stable/2.346.3/jenkins.war
wget https://dlcdn.apache.org/skywalking/java-agent/8.11.0/apache-skywalking-java-agent-8.11.0.tgz -p /data
安装jdk
rpm -ivh jdk-18_linux-x64_bin.rpm
java --version
安装tomcat
tar -xvf apache-tomcat-8.5.82.tar.gz -C /apps
mv jenkins.war /apps/apache-tomcat-8.5.82/webapps/
解压并配置skywalking-java-agent
tar xvf apache-skywalking-java-agent-8.11.0.tgz
vim skywalking-agent/config/agent.config
agent.service_name=${SW_AGENT_NAME:jenkins}
agent.namespace=${SW_AGENT_NAMESPACE:jenkins}
collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:10.0.0.2:11800}
官网配置skywalking-agent方法
https://skywalking.apache.org/docs/skywalking-java/v8.11.0/en/setup/service-agent/java-agent/readme/
我们用下面的方法
vim /apps/apache-tomcat-8.5.82/bin/catalina.sh
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/data/skywalking-agent/skywalking-agent.jar"; export CATALINA_OPTS
启动tomcat
/apps/apache-tomcat-8.5.82/bin/catalina.sh start
浏览器访问http://1.13.248.44:8080/jenkins
查看下密码复制到jenkins页面,按照推荐安装插件
cat /root/.jenkins/secrets/initialAdminPassword
登陆下skywalking已经可以看到jenkins的数据了