天天看点

start to use skywalkingInstall JDK8Install ESInstall skywalkingRun Springboot JAR

Start to use skywalking

  • Install JDK8
  • Install ES
  • Install skywalking
  • Run Springboot JAR

Install JDK8

If you have installed jdk8, and you can get JAVA_HOME path by

echo $JAVA_HOME

, then please skip this step.

yum install -y java-1.8.0-openjdk-devel.x86_64
           

Install ES

docker pull elasticsearch:6.5.4
docker create --name my_elasticsearch --net host -e "discovery.type=single-node" -e "network.host=172.16.55.xxxthe server internal ip" elasticsearch:6.5.4
docker start my_elasticsearch
docker logs my_elasticsearch
           

Install skywalking

Official link to download skywalking:

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

tar -zxvf ...
./bin/startup.sh
           

Now you can visit port 8080… see the page below

start to use skywalkingInstall JDK8Install ESInstall skywalkingRun Springboot JAR

Run Springboot JAR

A few steps:

  1. Copy the

    entire folder

    called

    agent

    to your server, we will need its absolute path

    You will get the folder

    agent

    when you uncompress the file you download from official site.
  2. vim

    agent.config

    under

    /agent/config/

agent.service_name=${SW_AGENT_NAME:PartyTest_1}
collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:192.xxx.xxx.xxx:11800}
           
Explain:

PartyTest_1

is your project name

192.xxx.xxx.xxx

is your server ip

11800

keep it and the rest
  1. create

    startUpSky.sh

    and start it.
#!/bin/bash
str=$1
str1=${str%-*}
str2=${str1%-*}
nohup /usr/local/jdk1.8.0_162/bin/java -javaagent:/opt/devlop/agent/skywalking-agent.jar -Dskywalking.agent.service_name=${str2} -jar -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m -Xms512m -Xmx512m -Xmn256m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC $1 > logs/$1.out &
           
Explain:

str2=${str1%-*}

better use your own

/usr/local/jdk1.8.0_162/bin/java

if you installed jdk manually, get the path by

echo $JAVA_HOME

, else you can get the path following below
[[email protected]_0_13_centos ~]# whereis javac
javac: /usr/bin/javac /usr/share/man/man1/javac.1.gz
[[email protected]_0_13_centos ~]# ll /usr/bin/javac
lrwxrwxrwx 1 root root 23 Sep 19 11:35 /usr/bin/javac -> /etc/alternatives/javac
[[email protected]_0_13_centos ~]# ll /etc/alternatives/javac
lrwxrwxrwx 1 root root 70 Sep 19 11:35 /etc/alternatives/javac -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-1.el7_7.x86_64/bin/javac
           
Take this part /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-1.el7_7.x86_64/bin/java

-Dskywalking.agent.service_name=${str2}

to define the name on the skywalking board, of cource you can put a name there directly as well

Thanks to below for installation guides and relevant intruductions, you can find help there

https://www.cnblogs.com/aspirant/p/8796974.html

http://mp.ofweek.com/bigdata/a645673326616

https://www.jianshu.com/p/77b4e70c7817

继续阅读