天天看点

[skywalking] 基于nacos集群配置

skywalking为什么要进行集群配置?

业务众多量级大单台skywalking oap server 是不够用的(具体多大量级需要多少配置在这里不详细说),skywalking oap 之间本身不能搭建集群,需要一个集群管理器来组建集群,skywalking 支持nacos、zookeeper、Kubernetes、Consul、Etcd 五种集群管理器

skywalking集群部署

主要修改 config/application.yml文件

cluster:
  selector: ${SW_CLUSTER:nacos}
  nacos:
    serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
    hostPort: ${SW_CLUSTER_NACOS_HOST_PORT:localhost:8848}
    # Nacos Configuration namespace
    namespace: ${SW_CLUSTER_NACOS_NAMESPACE:"public"}
    # Nacos auth username
    username: ${SW_CLUSTER_NACOS_USERNAME:""}
    password: ${SW_CLUSTER_NACOS_PASSWORD:""}
......

configuration:
  selector: ${SW_CONFIGURATION:nacos}
  nacos:
    # Nacos Server Host
    serverAddr: ${SW_CONFIG_NACOS_SERVER_ADDR:127.0.0.1}
    # Nacos Server Port
    port: ${SW_CONFIG_NACOS_SERVER_PORT:8848}
    # Nacos Configuration Group
    group: ${SW_CONFIG_NACOS_SERVER_GROUP:skywalking}
    # Nacos Configuration namespace
    namespace: ${SW_CONFIG_NACOS_SERVER_NAMESPACE:}
    # Unit seconds, sync period. Default fetch every 60 seconds.
    period: ${SW_CONFIG_NACOS_PERIOD:60}      
[skywalking] 基于nacos集群配置

nacos发布配置

参考:

Dynamic Configuration | Apache SkyWalking

Dynamic Configuration Nacos Implementation | Apache SkyWalking

Config Key Value Description Value Format Example
agent-analyzer.default.slowDBAccessThreshold Thresholds of slow Database statement. Overrides receiver-trace/default/slowDBAccessThreshold of application.yml. default:200,mongodb:50
agent-analyzer.default.uninstrumentedGateways The uninstrumented gateways. Overrides gateways.yml.

Same as gateways.yml

.

alarm.default.alarm-settings The alarm settings. Overrides alarm-settings.yml.

Same as alarm-settings.yml

.

core.default.apdexThreshold The apdex threshold settings. Overrides service-apdex-threshold.yml.

Same as service-apdex-threshold.yml

.

core.default.endpoint-name-grouping The endpoint name grouping setting. Overrides endpoint-name-grouping.yml.

Same as endpoint-name-grouping.yml

.

core.default.log4j-xml The log4j xml configuration. Overrides log4j2.xml.

Same as log4j2.xml

.

agent-analyzer.default.traceSamplingPolicy The sampling policy for default and service dimension, override trace-sampling-policy-settings.yml. same as trace-sampling-policy-settings.yml
configuration-discovery.default.agentConfigurations The ConfigurationDiscovery settings.

See configuration-discovery.md

.

选择namespace,创建配置

[skywalking] 基于nacos集群配置

配置Config Key

注意Group 要和skywalking配置匹配

[skywalking] 基于nacos集群配置

注意 skywalking-oap日志

[skywalking] 基于nacos集群配置

继续阅读