skywalking

安装java环境(略)

参考java安装文档

下载解压

mkdir /opt/skywalking
cd /opt/skywalking
wget http://shu.share/soft/linux/skywalking/apache-skywalking-apm-9.2.0.tar.gz

mv /opt/skywalking/ /data/
ln -s /data/skywalking/apache-skywalking-apm-bin /opt/skywalking

修改配置

cd /opt/skywalking/config
vim application.yml
...
#集群模式选择standalone
cluster:
  selector: ${SW_CLUSTER:standalone}
...

#选择elasticsearch作为数据存储
...
storage:
  selector: ${SW_STORAGE:elasticsearch}
  elasticsearch:
    namespace: ${SW_NAMESPACE:"es-cluster"} #es集群名
    clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:192.168.1.120:9200} #es集群节点
    protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
    connectTimeout: ${SW_STORAGE_ES_CONNECT_TIMEOUT:3000}
    socketTimeout: ${SW_STORAGE_ES_SOCKET_TIMEOUT:30000}
    responseTimeout: ${SW_STORAGE_ES_RESPONSE_TIMEOUT:15000}
    numHttpClientThread: ${SW_STORAGE_ES_NUM_HTTP_CLIENT_THREAD:0}
    user: ${SW_ES_USER:"elastic"} #es账号(如果开启了认证)
    password: ${SW_ES_PASSWORD:"123456"} #es密码(如果开启了认证)
...

启动skywalking

/opt/skywalking/bin
./startup.sh

防护墙放行

firewall-cmd --zone=public --add-port=8080/tcp --permanent&&firewall-cmd --reload
firewall-cmd --zone=public --add-port=11800/tcp --permanent&&firewall-cmd --reload
firewall-cmd --zone=public --add-port=12800/tcp --permanent&&firewall-cmd --reload

开机自启

需要分开设置后台和web自启动服务
vim /etc/systemd/system/sky-oap.service
[Unit]
Description=skywalking oap
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
Environment="JAVA_HOME=/opt/java/jdk1.8.0_171"
ExecStart=/data/skywalking/apache-skywalking-apm-bin/bin/oapService.sh
Restart=always
PrivateTmp=true
LimitNOFILE=65536
WorkingDirectory=/data/skywalking/apache-skywalking-apm-bin/bin

[Install]
WantedBy=multi-user.target

vim /etc/systemd/system/sky-ui.service
[Unit]
Description=skywalking ui
After=network.target

[Service]
Type=forking
Environment="JAVA_HOME=/opt/java/jdk1.8.0_171"
ExecStart=/data/skywalking/apache-skywalking-apm-bin/bin/webappService.sh
PrivateTmp=true

[Install]
WantedBy=multi-user.target
systemctl start sky-oap
systemctl enable sky-oap

systemctl start sky-ui
systemctl enable sky-ui

你可能感兴趣的:(监控,skywalking)