• .netcore加入APM系统 SkyWalking


    安装环境:windows 2016

    必要条件:

    JDK8+

    Elasticsearch 5.x(注:目前不支持es6)

    8080,10800,11800,12800 端口不被占用

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

    设置skywalking的 agentconfigagent.config

    agent.application_code=自己的应用名

    collector.servers=127.0.0.1:10800

    设置skywalking的 webappwebapp.yml

    server:

      port: 8080

    默认为8080 可以修改为其他

    设置skywalking的 configappliction.yml

    naming:

     jetty:

        host: localhost

        port: 10800

        context_path: /

    storage:

      elasticsearch:

        clusterName: CollectorDBCluster

    CollectorDBCluster为默认值

    下载elasticsearch5 https://www.elastic.co/blog/elasticsearch-5-6-3-released

    elasticsearch的 configelasticsearch.yml 改为cluster.name: CollectorDBCluster 保持与skywalking配置中clusterName一样的值

    修改network.host: 0.0.0.0

    增加thread_pool.bulk.queue_size: 1000

    elasticsearch安装成windows服务,命令行输入域:elasticsearch-service.bat install

    启动elasticsearch服务

    浏览器输入 http://127.0.0.1:9200/ 查看elasticsearch是否启动成功

    安装为windows服务(可选)

    复制collectorService.bat的代码到SkyWalkingCollector.bat(新建文件,名字自己取) 去掉start "%COLLECTOR_PROCESS_TITLE%" 

    复制webappService.bat的代码到SkyWalkingWebapp.bat(新建文件,名字自己取) 去掉start "%WEBAPP_PROCESS_TITLE%" 

    下载nssm http://www.nssm.cc/download

    用nssm创建成windows服务:

    命令行输入:nssm install SkyWalkingCollector 选择SkyWalkingCollector.bat

    命令行输入:nssm install SkyWalkingWebapp 选择SkyWalkingWebapp.bat

    记得依赖选项卡加入elasticsearch-service-x64这个服务

    启动服务

    Agent地址 http://127.0.0.1:10800/agent/jetty

    webapp地址 http://localhost:8080 默认用户名密码都是admin

    .net core项目引用nuget包:Install-Package SkyWalking.AspNetCore

    修改 Startup.cs:

    public void ConfigureServices(IServiceCollection services)
    {
        //......
        services.AddSkyWalking(option =>
        {
            option.ApplicationCode = "应用名";//重写 agent/config/agent.config 配置文件中的服务名
            option.DirectServers = "localhost:11800";//用于重写 agent/config/agent.config 配置文件中的服务地址
        });
    }
    

      

  • 相关阅读:
    Timestamp,Date和String的互相转换
    从网址截取域名
    $.ajax()方法详解
    JS正则表达式详解
    List、Set、Map集合的遍历方法
    spring-security2配置精讲(转载)
    spring-security原理学习
    spring-security配置和原理简介
    三步法搞定CTF中的SQL注入题型
    两个局域网(办公网-IDC)安全互通方案2:by GRE and linux server&深入理解GRE
  • 原文地址:https://www.cnblogs.com/wintersoft/p/9672282.html
Copyright © 2020-2023  润新知