zoukankan      html  css  js  c++  java
  • skywalking6.3.0安装(centos7.6)

    先安装好jdk8(略),经测试高于jdk8不支持。

    http://skywalking.apache.org/downloads/
    wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" -P /opt/downloads http://mirrors.tuna.tsinghua.edu.cn/apache/skywalking/6.3.0/apache-skywalking-apm-6.3.0.tar.gz

    tar zxvf /opt/downloads/apache-skywalking-apm-6.3.0.tar.gz -C /opt

    以es作为存储的情况,资料网上很多了,本例以mysql作为储存
    vim /opt/apache-skywalking-apm-bin/config/application.yml
    注释掉storage:h2 解锁mysql
    找个mysql-connector-java-5.1.47.jar放入apache-skywalking-apm-bin/oap-libs
    经测试mysql/j版本是6.x.x或8.x.x会有问题

    vim /opt/apache-skywalking-apm-bin/config/datasource-settings.properties
    修改mysql的配置
    在对应的mysql中添加数据库

    加入dataSource.useSSL=false (可选)

    agent
    使用javaagent无侵入式的配合collector实现对分布式系统的追踪和相关数据的上下文传递。
    配置说明
    agent.namespace: 跨进程链路中的header,不同的namespace会导致跨进程的链路中断
    agent.service_name:一个服务(项目)的唯一标识,这个字段决定了在sw的UI上的关于service的展示名称
    agent.sample_n_per_3_secs: 客户端采样率,默认是-1代表全采样
    agent.authentication: 与collector进行通信的安全认证,需要同collector中配置相同
    agent.ignore_suffix: 忽略特定请求后缀的trace
    collecttor.backend_service: agent需要同collector进行数据传输的IP和端口
    logging.level: agent记录日志级别

    修改配置
    vim /opt/apache-skywalking-apm-bin/agent/config/agent.config
    agent.service_name是应用程序名
    collector.backend_service是agent的地址

    核对webapp
    vim /opt/apache-skywalking-apm-bin/webapp/webapp.yml
    server:
    port为网站端口,默认的8080容易与其他软件冲突,建议改一下比如18080
    server:
    ip设置为0.0.0.0 (可选)
    collector:ribbon:listOfServers设置为127.0.0.1:12800(多个以逗号隔开)
    用户名密码默认admin

    保证18080,11800,12800端口不被占用

    启动前先初始化 /opt/apache-skywalking-apm-bin/bin/oapServiceInit.sh
    看见 SkyWalking OAP started successfully! 执行成功,mysql数据库中将表被添加。


    安装oap守护进程
    vim /lib/systemd/system/skywalking-oap.service

    [Unit]
    Description=skywalking-oap
    After=syslog.target network.target remote-fs.target nss-lookup.target
    
    [Service]
    Type=forking
    ExecStart=/opt/apache-skywalking-apm-bin/bin/oapService.sh
    Restart=always
    PrivateTmp=true
    
    [Install]
    WantedBy=multi-user.target

    官方提供的sh脚本#!/usr/bin/env sh不在顶部会造成systemd启动报错
    把#!/usr/bin/env sh提至顶部
    sed -i -c -e '/^#!/usr/bin/env sh/d' /opt/apache-skywalking-apm-bin/bin/oapService.sh
    sed '1 i ' -i /opt/apache-skywalking-apm-bin/bin/oapService.sh
    sed '1 i#!/usr/bin/env sh' -i /opt/apache-skywalking-apm-bin/bin/oapService.sh

    权限

    chmod 777 /opt/apache-skywalking-apm-bin/bin/oapService.sh

    chmod 777 /lib/systemd/system/skywalking-oap.service

    systemctl enable skywalking-oap.service
    systemctl daemon-reload

    运行
    systemctl start skywalking-oap.service

    查看进程

     netstat -anltp|grep 11800

     netstat -anltp|grep 12800


    安装webapp守护进程
    vim /lib/systemd/system/skywalking-webapp.service

    [Unit]
    Description=skywalking-webapp
    After=syslog.target network.target remote-fs.target nss-lookup.target
    
    [Service]
    Type=forking
    ExecStart=/opt/apache-skywalking-apm-bin/bin/webappService.sh
    Restart=always
    PrivateTmp=true
    
    [Install]
    WantedBy=multi-user.target

    官方提供的sh脚本#!/usr/bin/env sh不在顶部会造成systemd启动报错
    把#!/usr/bin/env sh提至顶部
    sed -i -c -e '/^#!/usr/bin/env sh/d' /opt/apache-skywalking-apm-bin/bin/webappService.sh
    sed '1 i ' -i /opt/apache-skywalking-apm-bin/bin/webappService.sh
    sed '1 i#!/usr/bin/env sh' -i /opt/apache-skywalking-apm-bin/bin/webappService.sh

    权限

    chmod 777 /opt/apache-skywalking-apm-bin/bin/webappService.sh

    chmod 777 /lib/systemd/system/skywalking-webapp.service

    systemctl enable skywalking-webapp.service
    systemctl daemon-reload

    systemctl start skywalking-webapp.service

    查看日志

    tail -f /var/log/messages

    列出当前系统服务的状态

    systemctl list-units

  • 相关阅读:
    HDU 4763 Theme Section(KMP+枚举公共前后缀)
    HDU 3613 Best Reward(扩展KMP求前后缀回文串)
    HDU 3613 Best Reward(manacher求前、后缀回文串)
    扩展KMP模板
    Vue
    Vue
    css 文本换行 文本溢出隐藏用省略号表示剩下内容
    sublime 神一样的插件
    markdown
    css 居中布局
  • 原文地址:https://www.cnblogs.com/wintersoft/p/10896169.html
Copyright © 2011-2022 走看看