skywalking部署


官方文檔:Setup java agent Backend and UI

下載地址:http://skywalking.apache.org/downloads/

 

解壓后目錄

 

部署UI和收集器

 進入webapp,編輯webapp.yml,這里可以編輯登錄用戶名和密碼

進入config,編輯application.yml,這里配置es地址

運行bin/startup.sh

 UI使用8080端口,收集器使用10800端口

 如果10800端口沒有起來的話,檢查logs/collect.log,可以看到報錯信息

一般可能是es連接錯誤,skywalking目前只支持es5.x版本,如果連6.X版本就會報錯

 部署java agent

 先進入agent目錄,編輯config/agent.config

修改應用名稱和收集服務器地址

# The application name in UI
agent.application_code=chat-robot
# Server addresses.
# Primary address setting.
#
# Mapping to `naming/jetty/ip:port` in `config/application.yml` of Collector.
# Examples:
# Single collector:SERVERS="127.0.0.1:8080"
# Collector cluster:SERVERS="10.2.45.126:8080,10.2.45.127:7600"
collector.servers=172.20.102.149:10800
View Code

這里需要注意,如果不是使用接收器地址不是localhost,而是IP+port,那么需要對三個配置做修改

1.config/application.yml 將所有的localhost或者127.0.0.1替換成實際IP

2. webapp/webapp.yml 將127.0.0.1替換成實際IP

3. agent/config/agent.config 將127.0.0.1替換成實際IP

運行應用

nohup java -javaagent:/opt/soft/apache-skywalking-apm-incubating/agent/skywalking-agent.jar  -jar service-registry-0.0.1-SNAPSHOT.jar  >> registry.log 2>&1 &

或者創建一個start.sh

rm -f tpidnohup java -javaagent:/opt/soft/apache-skywalking-apm-incubating/agent/skywalking-agent.jar  -jar chat-robot-0.0.1-SNAPSHOT.jar  >> app.log 2>&1 &
echo $! > tpid
echo Start Success!
View Code

編輯權限

chmod 777 start.sh

運行start.sh

 停止的話可以加一個stop.sh

APP_NAME=service-registry-0.0.1-SNAPSHOT

tpid=`ps -ef|grep $APP_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
if [ ${tpid} ]; then
    echo 'Stop Process...'
    kill -15 $tpid
fi
sleep 5
tpid=`ps -ef|grep $APP_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
if [ ${tpid} ]; then
    echo 'Kill Process!'
    kill -9 $tpid
else
    echo 'Stop Success!'
fi
View Code

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM