为了账号安全,请及时绑定邮箱和手机立即绑定

Centos 7搭建Skywalking

标签:
Kubernetes

1.准备安装文件

# 下载安装包wget -c -P /tmp http://mirrors.hust.edu.cn/apache/incubator/skywalking/5.0.0-GA/apache-skywalking-apm-incubating-5.0.0-GA.tar.gz# 解压mkdir /opt/skywalking;\
tar xf /tmp/apache-skywalking-apm-incubating-5.0.0-GA.tar.gz -C /opt/skywalking# 拷贝到安装位置cd /opt/skywalking;\
mv apache-skywalking-apm-incubating 5.0.0;\
ln -s /opt/skywalking/5.0.0 /opt/skywalking/current# 新建用户useradd -s /sbin/nologin skywalking;\
mkdir /home/skywalking/data

2.安装Collector

2.1更改配置文件

# 备份配置文件mv /opt/skywalking/current/config/application.yml /opt/skywalking/current/config/application.yml_bak# 创建配置文件tee /opt/skywalking/current/config/application.yml << 'EOF'cluster:
  zookeeper:
    hostPort: 192.168.1.41:2181,192.168.1.42:2181,192.168.1.43:2181
    sessionTimeout: 100000
naming:
  jetty:    # 配置agent发现collector集群
    host: 192.168.1.41
    port: 10800
    contextPath: /
cache:#  guava:
  caffeine:
remote:
  gRPC:    # 配置collector节点在集群中相互通信
    host: 192.168.1.41
    port: 11800
agent_gRPC:
  gRPC:    # 配置agent上传(链路跟踪和指标)数据到collector
    host: 192.168.1.41
    port: 11800    # Set these two setting to open ssl
    #sslCertChainFile: $path
    #sslPrivateKeyFile: $path

    # Set your own token to active auth
    authentication: Password_1234
agent_jetty:
  jetty:    # 配置agent上传(链路跟踪和指标)数据到collector
    # SkyWalking native Java/.Net/node.js agents don't use this.
    # Open this for other implementor.
    host: 192.168.1.41
    port: 12800
    contextPath: /
analysis_register:
  default:
analysis_jvm:
  default:
analysis_segment_parser:
  default:
    bufferFilePath: ../buffer/
    bufferOffsetMaxFileSize: 10M
    bufferSegmentMaxFileSize: 500M
    bufferFileCleanWhenRestart: trueui:
  jetty:    # 配置UI访问collector
    host: 192.168.1.41
    port: 12800
    contextPath: /
storage:
  elasticsearch:
    clusterName: es_log
    clusterTransportSniffer: true
    clusterNodes: 192.168.1.41:9300,192.168.1.42:9300,192.168.1.43:9300
    indexShardsNumber: 2
    indexReplicasNumber: 0
    highPerformanceMode: true
    # Batch process setting
    bulkActions: 2000 # Execute the bulk every 2000 requests
    bulkSize: 20 # flush the bulk every 20mb
    flushInterval: 10 # flush the bulk every 10 seconds whatever the number of requests
    concurrentRequests: 2 # the number of concurrent requests
    # 设置统计指标数据的失效时间,当指标数据失效时系统将数据自动删除
    traceDataTTL: 90 # Unit is minute
    minuteMetricDataTTL: 90 # Unit is minute
    hourMetricDataTTL: 36 # Unit is hour
    dayMetricDataTTL: 45 # Unit is day
    monthMetricDataTTL: 18 # Unit is month    configuration:
  default:    #namespace: xxxxx
    # alarm threshold
    applicationApdexThreshold: 2000
    serviceErrorRateThreshold: 10.00
    serviceAverageResponseTimeThreshold: 2000
    instanceErrorRateThreshold: 10.00
    instanceAverageResponseTimeThreshold: 2000
    applicationErrorRateThreshold: 10.00
    applicationAverageResponseTimeThreshold: 2000    # thermodynamic
    thermodynamicResponseTimeStep: 50
    thermodynamicCountOfResponseTimeSteps: 40    # max collection's size of worker cache collection, setting it smaller when collector OutOfMemory crashed.
    workerCacheMaxSize: 10000
EOF

2.2创建服务

tee /etc/systemd/system/skywalking-collector.service << 'EOF'[Unit]
Description=Skywalking Collector
After=network.target

[Service]
Environment="JAVA_HOME=/usr/java/default" "COLLECTOR_HOME=/opt/skywalking/current"Type=forking
User=skywalking
Group=skywalking
LimitNOFILE=65535
ExecStart=/opt/skywalking/current/bin/collectorService.sh
Restart=on-failure
WorkingDirectory=/opt/skywalking/current

[Install]
WantedBy=multi-user.target
EOF

2.3启动脚本删除注释行

因原有脚本行首有注释导致systemd启动报错

sed -i -c -e '/^#/d' /opt/skywalking/current/bin/collectorService.sh;\
sed '1 i#!/usr/bin/env sh' -i /opt/skywalking/current/bin/collectorService.sh

2.4启动服务

chown -R skywalking. /home/skywalking /opt/skywalking;\
systemctl daemon-reload;\
systemctl enable skywalking-collector;\
systemctl start skywalking-collector;\
systemctl status skywalking-collector

2.5配置防火墙

firewall-cmd --add-port=10800/tcp --permanent;\
firewall-cmd --add-port=11800/tcp --permanent;\
firewall-cmd --add-port=12800/tcp --permanent;\
firewall-cmd --reload

3.安装UI

3.1更改配置

# 备份mv /opt/skywalking/current/webapp/webapp.yml /opt/skywalking/current/webapp/webapp.yml_bak# 创建配置文件tee /opt/skywalking/current/webapp/webapp.yml << 'EOF'server:
  port: 8080

collector:
  path: /graphql
  ribbon:
    ReadTimeout: 10000
    listOfServers: 192.168.1.41:10800,192.168.1.42:10800,192.168.1.43:10800

security:
  user:
    admin:
      password: Password_2018
EOF

3.2启动脚本删除注释行

因原有脚本行首有注释导致systemd启动报错

sed -i -c -e '/^#/d' /opt/skywalking/current/bin/webappService.sh;\
sed '1 i#!/usr/bin/env sh' -i /opt/skywalking/current/bin/webappService.sh

3.3创建服务

tee /etc/systemd/system/skywalking-ui.service << 'EOF'[Unit]
Description=Skywalking UI
After=network.target

[Service]
Environment="JAVA_HOME=/usr/java/default"Type=forking
User=skywalking
Group=skywalking
LimitNOFILE=65535
ExecStart=/opt/skywalking/current/bin/webappService.sh
Restart=on-failure
WorkingDirectory=/opt/skywalking/current

[Install]
WantedBy=multi-user.target
EOF

3.5启动服务

chown -R skywalking. /home/skywalking /opt/skywalking;\
systemctl daemon-reload;\
systemctl enable skywalking-ui;\
systemctl start skywalking-ui;\
systemctl status skywalking-ui

3.6配置防火墙

firewall-cmd --add-port=8080/tcp --permanent;\
firewall-cmd --reload



作者:Hanson1330
链接:https://www.jianshu.com/p/7a64f70a28eb


点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消