dynamic-config.md 4.1 KB
Newer Older
1 2 3 4 5 6 7 8 9
# Dynamic Configuration
SkyWalking Configurations mostly are set through `application.yml` and OS system environment variables.
But some of them are supporting dynamic settings from upstream management system.

Right now, SkyWalking supports following dynamic configurations.

| Config Key | Value Description | Value Format Example |
|:----:|:----:|:----:|
|receiver-trace.default.slowDBAccessThreshold| Thresholds of slow Database statement, override `receiver-trace/default/slowDBAccessThreshold` of `applciation.yml`. | default:200,mongodb:50|
10 11
|receiver-trace.default.uninstrumentedGateways| The uninstrumented gateways, override `gateways.yml`. | same as [`gateways.yml`](uninstrumented-gateways.md#configuration-format) |
|alarm.default.alarm-settings| The alarm settings, will override `alarm-settings.yml`. | same as [`alarm-settings.yml`](backend-alarm.md) |
G
Gao Hongtao 已提交
12
|core.default.apdexThreshold| The apdex threshold settings, will override `service-apdex-threshold.yml`. | same as [`service-apdex-threshold.yml`](apdex-threshold.md) |
13 14


15 16
This feature depends on upstream service, so it is **DISABLED** by default.

17 18
```yaml
configuration:
19
  selector: ${SW_CONFIGURATION:none}
20
  none:
21 22 23 24 25 26
  apollo:
    apolloMeta: http://106.12.25.204:8080
    apolloCluster: default
    appId: skywalking
    period: 5
  # ... other implementations
27 28 29 30 31 32 33 34 35
```

## Dynamic Configuration Service, DCS
[Dynamic Configuration Service](../../../../oap-server/server-configuration/grpc-configuration-sync/src/main/proto/configuration-service.proto) 
is a gRPC service, which requires the upstream system implemented.
The SkyWalking OAP fetches the configuration from the implementation(any system), after you open this implementation like this.

```yaml
configuration:
36
  selector: ${SW_CONFIGURATION:grpc}
37 38 39 40 41
  grpc:
    host: 127.0.0.1
    port: 9555
```

42 43
## Dynamic Configuration Apollo Implementation

44
[Apollo](https://github.com/ctripcorp/apollo/) is also supported as DCC(Dynamic Configuration Center), to use it, just configured as follows:
45 46 47

```yaml
configuration:
48
  selector: ${SW_CONFIGURATION:apollo}
49 50 51 52 53 54 55 56
  apollo:
    apolloMeta: <your apollo meta address>
    apolloCluster: default
    appId: skywalking
    period: 5
```

## Dynamic Configuration Nacos Implementation
57

58
[Nacos](https://github.com/alibaba/nacos) is also supported as DCC(Dynamic Configuration Center), to use it, please configure as follows:
59 60 61

```yaml
configuration:
62
  selector: ${SW_CONFIGURATION:nacos}
63 64 65 66
  nacos:
    serverAddr: 127.0.0.1
    port: 8848
    group: 'skywalking'
67
    namespace: ''
68 69
    period : 60
    clusterName: "default"
70
  # ... other configurations
71
```
72

73 74 75 76 77 78 79

## Dynamic Configuration Zookeeper Implementation

[Zookeeper](https://github.com/apache/zookeeper) is also supported as DCC(Dynamic Configuration Center), to use it, please configure as follows:

```yaml
configuration:
80
  selector: ${SW_CONFIGURATION:zookeeper}
81 82 83 84 85 86
  zookeeper:
    period : 60 # Unit seconds, sync period. Default fetch every 60 seconds.
    nameSpace: /default
    hostPort: localhost:2181
    baseSleepTimeMs: 1000 # initial amount of time to wait between retries
    maxRetries: 3 # max number of times to retry
87
  # ... other configurations
88 89
```

A
Alan Lau 已提交
90 91 92 93 94 95
## Dynamic Configuration Etcd Implementation

[Etcd](https://github.com/etcd-io/etcd) is also supported as DCC(Dynamic Configuration Center), to use it, please configure as follows:

```yaml
configuration:
96
  selector: ${SW_CONFIGURATION:etcd}
A
Alan Lau 已提交
97 98 99 100 101
  etcd:
    period : 60 # Unit seconds, sync period. Default fetch every 60 seconds.
    group :  'skywalking'
    serverAddr: localhost:2379
    clusterName: "default"
102
  # ... other configurations
A
Alan Lau 已提交
103 104
```

105 106 107 108 109 110
## Dynamic Configuration Consul Implementation

[Consul](https://github.com/rickfast/consul-client) is also supported as DCC(Dynamic Configuration Center), to use it, please configure as follows:

```yaml
configuration:
111
  selector: ${SW_CONFIGURATION:consul}
112 113 114 115 116
  consul:
    # Consul host and ports, separated by comma, e.g. 1.2.3.4:8500,2.3.4.5:8500
    hostAndPorts: 127.0.0.1:8500
    # Sync period in seconds. Defaults to 60 seconds.
    period: 60
117 118
    # aclToken of connection consul (optional)
    aclToken: ${consul.aclToken}
119
  # ... other configurations
120 121
```

122 123