-
Notifications
You must be signed in to change notification settings - Fork 26
/
sync.conf
450 lines (373 loc) · 19.7 KB
/
sync.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# Configuration file for the syncronization service
# Sync service configuration parameters can be provided using a
# configuration file (sync.conf by default) and/or environment variables.
# If the same parameter appears in both the value specified by the environment variable is used.
# Most of the parameters are optional and their default value can be used.
# Mandatory parameters are marked as must be provided by the user.
#################################################################################
### Basic Configuration
#################################################################################
# NodeType specifies whether this node is a CSS or ESS
# Possible values are: CSS, ESS
# Defaults to CSS
# Environment variable: NODE_TYPE
#NodeType CSS
# DestinationType specifies the destination type of this ESS
# Not used (ignored) on the CSS (DestinationType set internally)
# Environment variable: DESTINATION_TYPE
# This parameter must be provided by the user on an ESS
DestinationType
# DestinationId specifies the destination id of this ESS
# The combination of DestinationType and DestinationId must uniquely identify the node (within the organization)
# Not used (ignored) on the CSS (DestinationID set internally)
# Environment variable: DESTINATION_ID
# This parameter must be provided by the user on an ESS
DestinationId
# OrgID specifies the organization ID of this node
# Environment variable: ORG_ID
# Defaults to blank (not set)
# For ESS an OrgID must be provided by the user
# For CSS OrgID is optional. If specified the CSS will support only a single organization
# For a CSS to support multiple organizations OrgID must be blank (not set) and organizations should be added/removed via the API
# OrgID
# ListeningType specifies whether the server is
# listening securely, unsecurely, both securely and unsecurely, using Unix sockets,
# or using Unix sockets securely.
# Possible values are secure, unsecure, both, unix, secure-unix.
# unix and secure-unix can only be specified if the NodeType is ESS.
# Defaults to unsecure on a CSS and secure on an ESS
# Environment variable: LISTENING_TYPE
#ListeningType unsecure
# ListeningAddress specifies the address to listen on for HTTP/HTTPS API requests
# If the ListeningType is unix or secure-unix, this property specifies the socket file to be used.
# The file will be erased and recreated, if it already exists. The filename is relative
# to the PersistenceRootPath configuration property if it doesn't start with a slash (/).
# Defaults to blank (all addresses on this node)
# Environment variable: LISTENING_ADDRESS
#ListeningAddress
# SecureListeningPort specifies the port to listen on for API requests via HTTPS
# Defaults to 8443
# Environment variable: SECURE_LISTENING_PORT
#SecureListeningPort 8443
# UnsecureListeningPort specifies the port to listen on for API requests via HTTP
# Defaults to 8080
# Environment variable: UNSECURE_LISTENING_PORT
#UnsecureListeningPort 8080
# CommunicationProtocol is a comma separated list of protocols to be used for communication between CSS and ESS
# The elements of the list can be 'http', 'mqtt', and 'wiotp'
# wiotp indicates MQTT communication via the Watson IoT Platform and mqtt indicates direct MQTT communication to a broker
# The list must not include both wiotp and mqtt (only one mode of MQTT communication is allowed)
# For ESS only a single protocol is allowed
# The default is mqtt
# Environment variable: COMMUNICATION_PROTOCOL
#CommunicationProtocol mqtt
# CSSOnWIoTP indicates whether the CSS is inside or outside the Watson IoT Platform.
# The default value is false, i.e. outside.
# Environment variable: CSS_ON_WIOTP
#CSSOnWIoTP false
# UsingEdgeConnector indicates whether or not the ESS should connect to the Watson IoT Platform via an Edge Connector.
# Not relevant to the CSS.
# The default value is false.
# Environment variable: USING_EDGE_CONNECTOR
# UsingEdgeConnector false
# ServerCertificate specifies the Cloud Server side certificate to use to serve as HTTPS
# This value can either be the certificate itself or the path of a file containing
# the certificate. If it is a path of a file, then it is relative to the
# PersistenceRootPath configuration property if it doesn't start with a slash (/).
#
# NOTE: On the edge side, if a certificate is provided as a value, it will be used. Otherwise,
# the edge side uses a self signed certificate which will be located at sync/certs/cert.pem
# relative to the PersistenceRootPath configuration property.
#
# Environment variable: SERVER_CERTIFICATE
#ServerCertificate
# ServerKey specifies the Cloud Server side key to use to serve as HTTPS. This value can
# either be the key itself or the path of a file containing the key. If it is a path of
# a file, then it is relative to the PersistenceRootPath configuration property if it
# doesn't start with a slash (/).
#
# NOTE: On the edge side, if a key is provided as a value, it will be used. Otherwise,
# the edge side uses a locally generated key which will be located at sync/certs/key.pem
# relative to the PersistenceRootPath configuration property.
#
# Environment variable: SERVER_KEY
#ServerKey
# PersistenceRootPath is the root path for storing persisted data.
# The information stored under PersistenceRootPath may include user data.
# It is recommended to set PersistenceRootPath to an encrypted partition.
# Default value: /var/wiotp-edge/persist
# Environment variable: PERSISTENCE_ROOT_PATH
PersistenceRootPath /var/wiotp-edge/persist
#################################################################################
### MQTT Communication Settings
#################################################################################
# MQTTClientId contains the MQTT client id
# If not provided a random clientId is generated
# Environment variable: MQTT_CLIENT_ID
MQTTClientId
# MQTTUserName contains the MQTT user name (used in CONNECT messages)
# Default is not to include user name in CONNECT messages
# Environment variable: MQTT_USER_NAME
#MQTTUserName
# MQTTPassword contains the MQTT password (used in CONNECT messages)
# Default is not to include password in CONNECT messages
# Environment variable: MQTT_PASSWORD
#MQTTPassword
# MQTTUseSSL specifies whether or not to use ssl connection with the MQTT broker
# Defaults to true
# Environment variable: MQTT_USE_SSL
#MQTTUseSSL true
# MQTTCACertificate specifies the CA certificate that was used to sign the server certificates
# used by the MQTT broker. This value can either be the CA certificate itself or the path of
# a file containing the CA certificate. If it is a path of a file, then it is relative to the
# PersistenceRootPath configuration property if it doesn't start with a slash (/).
# This parameter must be provided when communicating with the broker securely over TLS
# and the broker's certificate wasn't signed by a well known certificate authority (i.e. a
# self signed certificate).
# Default value: /broker/ca/ca.cert.pem
# Environment variable: MQTT_CA_CERTIFICATE
#MQTTCACertificate
# MQTTSSLCert specifies the SSL client certificate of the X509 key pair used to communicate
# with the MQTT broker. This value can either be the certificate itself or the path of a file
# containing the certificate. If it is a path of a file, then it is relative to the
# PersistenceRootPath configuration property if it doesn't start with a slash (/).
# The default is not to use a SSL client certificate
# Environment variable: MQTT_SSL_CERT
#MQTTSSLCert
# MQTTSSLKey specifies the SSL client key of the X509 key pair used to communicate with the
# the MQTT broker. This value can either be the key itself or the path of a file containing
# the key. If it is a path of a file, then it is relative to the PersistenceRootPath
# configuration property if it doesn't start with a slash (/).
# The default is not to use a SSL client key
# Environment variable: MQTT_SSL_KEY
#MQTTSSLKey
# MQTTAllowInvalidCertificates specifies that the MQTT client will not attempt to validate the server certificates
# Please only set this for development purposes! It makes using TLS pointless and is never the right answer.
# Defaults to false
# Environment variable: MQTT_ALLOW_INVALID_CERTIFICATES
# MQTTAllowInvalidCertificates
# BrokerAddress specifies the address to connect to for the MQTT broker or
# a list of server URIs for environments with multiple MQTT brokers
# If BrokerAddress is a json array, it contains multiple broker addresses and
# the messaging group name. Otherwise it contains a single broker address
# Defaults to localhost
# Environment variable: BROKER_ADDRESS
#BrokerAddress localhost
# BrokerPort specifies the port to connect to for the MQTT broker
# Defaults to 1883
# Environment variable: BROKER_PORT
#BrokerPort 1883
# MaxDataChunkSize specifies the maximum size of data that can be sent in one MQTT message
# Defaults to 120KB
# Environment variable: MAX_DATA_CHUNK_SIZE
# MaxDataChunkSize 122880
#################################################################################
### HTTP Communication Settings
#################################################################################
# HTTPPollingInterval specifies the frequency in seconds of ESS HTTP polling for updates
# Environment variable: HTTP_POLLING_INTERVAL
# HTTPPollingInterval 10
# HTTPCSSHost specifies on the ESS, the CSS host for HTTP communication
# ESS only parameter, ignored on CSS
# This parameter must be provided when CommunicationProtocol is set to http
# Environment variable: HTTP_CSS_HOST
# HTTPCSSHost
# HTTPCSSPort specifies on the ESS, the CSS host for HTTP communication
# ESS only parameter, ignored on CSS
# This parameter must be provided when CommunicationProtocol is set to http
# Environment variable: HTTP_CSS_PORT
# HTTPCSSPort
# HTTPCSSUseSSL specifies whether or not to use ssl connection with the CSS
# ESS only parameter, ignored on CSS
# This parameter must be provided when CommunicationProtocol is set to http and
# you want to communicate to the CSS securely using TLS.
# Defaults to false
# Environment variable: HTTP_CSS_USE_SSL
# HTTPCSSUseSSL false
# HTTPCSSCACertificate specifies the CA certificate that was used to sign the server certificate
# used by the CSS. This value can either be the CA certificate itself or the path of a file containing
# the CA certificate. If it is a path of a file, then it is relative to the
# PersistenceRootPath configuration property if it doesn't start with a slash (/).
# This parameter must be provided when CommunicationProtocol is set to http,
# you want to communicate to the CSS securely using TLS, and the CSS's certificate wasn't
# signed by a well known certificate authority (i.e. a self signed certificate).
# Default value: none
# Environment variable: HTTP_CSS_CA_CERTIFICATE
#HTTPCSSCACertificate
#################################################################################
### Logging Parameters
#################################################################################
# LogLevel specifies the logging level in string format
# Possible values are: NONE, STATUS, FATAL, ERROR, WARNING, INFO, DEBUG, TRACE
# Defaults to INFO
# Environment variable: LOG_LEVEL
#LogLevel INFO
# LogRootPath specifies the root path for the log files
# Defaults to /var/edge-sync-service/log
# Environment variable: LOG_ROOT_PATH
#LogRootPath /var/edge-sync-service/log
# LogTraceDestination is a comma separated list of destinations for the logging and tracing
# The elements of the list can be `file`, `stdout`, and `syslog`
# Defaults to `file`
# Environment variable: LOG_TRACE_DESTINATION
#LogTraceDestination file
# LogFileName specifies the name of the log file
# Defaults to sync-service
# Environment variable: LOG_FILE_NAME
#LogFileName sync-service
# TraceLevel specifies the tracing level in string form (NONE, STATUS, FATAL, ERROR, WARNING, INFO, DEBUG, TRACE)
# Defaults to INFO
# Environment variable: TRACE_LEVEL
#TraceLevel INFO
# TraceRootPath specifies the root path for the trace files
# Defaults to /var/edge-sync-service/trace
# Environment variable: TRACE_ROOT_PATH
#TraceRootPath /var/edge-sync-service/trace
# TraceFileName specifies the name of the trace file
# Defaults to sync-service
# Environment variable: TRACE_FILE_NAME
#TraceFileName sync-service
# Maximal size of a trace/log file in kilo bytes.
# Default value: 20000
# Environment variable: LOG_TRACE_FILE_SIZE_KB
#LogTraceFileSizeKB 20000
# The limit on the number of compressed files of trace/log.
# Default value: 50
# Environment variable: MAX_COMPRESSED_LOG_TRACE_FILES_NUMBER
#MaxCompressedlLogTraceFilesNumber 50
# LogTraceMaintenanceInterval specifies the frequency in seconds of log and trace maintenance (memory consumption, etc.)
# Default value: 60
# Environment variable: LOG_TRACE_MAINTENANCE_INTERVAL
#LogTraceMaintenanceInterval
#################################################################################
### Storage Configuration
#################################################################################
# StorageProvider specifies the type of the storage to be used by this node.
# For the CSS the options are 'mongo' (the default), and 'bolt'
# For the ESS the options are 'inmemory' (the default), and 'bolt'
# Environment variable: STORAGE_PROVIDER
# StorageProvider
# StorageMaintenanceInterval specifies the frequency in seconds of storage checks (for expired objects, etc.)
# The default value is 30 seconds
# Environment variable: STORAGE_MAINTENANCE_INTERVAL
# StorageMaintenanceInterval
# ObjectsDataPath specifies a directory in which the object's data should be persisted.
# The application can then access the object's data directly on the file system instead of reading
# the data via the Sync Service. Applications should only read/copy the data but not modify/delete it.
# When ObjectsDataPath is set the DestinationDataURI field in the object's metadata includes
# the full path to the object's data.
# ObjectsDataPath can be used only when the StorageProvider is set to bolt.
# The default is empty (not set) meaning that the object's data is persisted internally in a
# path selected by the Sync Service.
# ObjectsDataPath string `env:"OBJECTS_DATA_PATH"`
#################################################################################
### Storage Configuration for CSS
#################################################################################
# MongoAddressCsv specifies one or more addresses of the mongo database
# Defaults to localhost:27017
# Environment variable: MONGO_ADDRESS_CSV
# MongoAddressCsv localhost:27017
# MongoAuthDbName specifies the name of the database used to establish credentials and privileges
# Defaults to admin
# Environment variable: MONGO_AUTH_DB_NAME
# MongoAuthDbName admin
# MongoDbName specifies the name of the database to use
# Defaults to d_edge
# Environment variable: MONGO_DB_NAME
# MongoDbName d_edge
# MongoUsername specifies the username of the mongo database
# Default is empty string
# Environment variable: MONGO_USERNAME
# MongoUsername
# MongoPassword specifies the password of the mongo database
# Default is empty string
# Environment variable: MONGO_PASSWORD
# MongoPassword
# MongoUseSSL specifies whether or not to use ssl when connecting to the database
# Defaults to false
# Environment variable: MONGO_USE_SSL
# MongoUseSSL
# MongoCACertificate specifies the CA certificate that was used to sign the server certificate
# used by the MongoDB server. This value can either be the CA certificate itself or the path of a
# file containing the CA certificate. If it is a path of a file, then it is relative to the
# PersistenceRootPath configuration property if it doesn't start with a slash (/).
# This parameter must be provided when communicating with the MongoDb server securely over TLS
# and the MongoDB server's certificate wasn't signed by a well known certificate authority (i.e.
# a self signed certificate).
# Environment variable: MONGO_SSL_CA_FILE
# MongoCACertificate
# MongoAllowInvalidCertificates specifies that the mongo driver will not attempt to validate the server certificates
# Please only set this for development purposes! It makes using TLS pointless and is never the right answer.
# Defaults to false
# Environment variable: MONGO_ALLOW_INVALID_CERTIFICATES
# MongoAllowInvalidCertificates
#################################################################################
### Storage Configuration for ESS
#################################################################################
# ESSConsumedObjectsKept specifies the number of objects sent by the ESS and consumed by the CSS
# that are kept by the ESS for reporting
# The default value is 1000
# Environment variable: ESS_CONSUMED_OBJECTS_KEPT
# ESSConsumedObjectsKept
#################################################################################
### Advanced Settings
#################################################################################
# ResendInterval specifies the frequency in seconds of checks to resend unacknowledged notifications
# ESS resends register notification with this interval
# Other notifications are resent with frequency equal to ResendInterval*6
# Defaults to 5
# Environment variable: RESEND_INTERVAL
# ResendInterval 5
# ESSPingInterval specifies the frequency in hours in which an ESS sends ping messages to a CSS
# Defaults to 1
# Environment variable: ESS_PING_INTERVAL
# ESSPingInterval 1
# RemoveESSRegistrationTime specifies the time period in days after which the CSS
# removes ESSs that have not pinged the CSS. Any pending records and operations for
# the ESS are removed.
# CSS only parameter, ignored on ESS
# Defaults to 30
# Environment variable: REMOVE_ESS_REGISTRATION_TIME
# RemoveESSRegistrationTime 30
# LeadershipTimeout is the timeout for leadership updates in seconds
# Defaults to 30
# Environment variable: LEADERSHIP_TIMEOUT
# LeadershipTimeout 30
# ObjectActivationInterval specifies the frequency in seconds of checking if there are inactive objects
# that are ready to be activated
# Defaults to 30
# Environment variable: OBJECT_ACTIVATION_INTERVAL
# ObjectActivationInterval
# DatabaseConnectTimeout specifies the timeout in seconds of database connection attempts on startup
# Default is 300
# Environment variable: DATABASE_CONNECT_TIMEOUT
# DatabaseConnectTimeout
# MQTTBrokerConnectTimeout specifies the timeout in seconds of attempts to connect to the MQTT broker on startup
# Default value 300
# Environment variable: MQTT_BROKER_CONNECT_TIMEOUT
# MQTTBrokerConnectTimeout
# ShutdownQuiesceTime specifies the maximum time in seconds that the Sync Service will wait for internal tasks to end while shuting down
# The default values is 60 seconds
# Environment variable: SHUTDOWN_QUIESCE_TIME
# ShutdownQuiesceTime
#################################################################################
### Performance Tuning Settings
#################################################################################
# MQTTParallelMode specifies the parallelism mode by which incoming MQTT messages are processed
# Possible values: 'none', 'small', 'medium', 'large'
# Default is none (or empty string), which means no parallel processing
# It is recommended to change the default if the CSS is expected to process updates at a high rate
# The choice between small, medium, or large should be based on the resources available on the CSS machine
# and the expected rate of updates
# Environment variable: PARALLEL_MQTT_MODE
# MQTTParallelMode
# MaxInflightChunks defines how many in-flight chunks are allowed when transferring large objects
# When transferring lrge objects over it is recommended to set MaxInflightChunks to a value between 10 and 100
# Default is 1
# Environment variable: MAX_INFLIGHT_CHUNKS
# MaxInflightChunks
# MongoSessionCacheSize specifies the number of MongoDB session copies to use
# To handle high update rate it is recommended to use a value between 32 and 512
# Default is 1
# Environment variable: MONGO_SESSION_CACHE_SIZE
# MongoSessionCacheSize