天天看點

[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叢集配置

繼續閱讀