/
things-search.conf
executable file
·276 lines (237 loc) · 8.61 KB
/
things-search.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
ditto {
mapping-strategy.implementation = "org.eclipse.ditto.services.models.thingsearch.ThingSearchMappingStrategy"
cluster {
become-leader = false
instance-index = ${?INSTANCE_INDEX}
}
services-utils-config.mongodb {
options {
ssl = false
w = 1
}
pool {
maxSize = 1000
maxSize = ${?MONGO_DB_CONNECTION_POOL_SIZE}
maxWaitTime = 30s
maxWaitTime = ${?MONGO_DB_CONNECTION_POOL_WAIT_TIME}
maxWaitQueueSize = 1000
maxWaitQueueSize = ${?MONGO_DB_CONNECTION_POOL_QUEUE_SIZE}
}
}
things-search {
http {
# InetAddress.getLocalHost.getHostAddress is used if empty
hostname = ""
hostname = ${?HOSTNAME}
hostname = ${?BIND_HOSTNAME}
port = 8080
port = ${?HTTP_PORT}
port = ${?PORT}
}
cluster {
# enables the majority check that solves network partitions automatically
majority-check.enabled = false
majority-check.enabled = ${?CLUSTER_MAJORITY_CHECK_ENABLED}
# the delay after which the cluster majority is checked
majority-check.delay = 30s
majority-check.delay = ${?CLUSTER_MAJORITY_CHECK_DELAY}
# as a rule of thumb: should be factor ten of the amount of cluster nodes available
# be aware that it must be the same as for all other services (e.g. things)
number-of-shards = 30
number-of-shards = ${?CLUSTER_NUMBER_OF_SHARDS}
}
mongodb {
breaker {
maxFailures = 5 # defines ater how many failures the circuit breaker should open
maxFailures = ${?BREAKER_MAXFAILURES}
timeout {
call = 5s # MongoDB Timeouts causing the circuitBreaker to open - "0s" disables timeouts opening the breaker
call = ${?BREAKER_TIMEOUT}
reset = 10s # after this time in "Open" state, the cicuitBreaker is "Half-opened" again
reset = ${?BREAKER_RESET}
}
}
}
health-check {
enabled = true
enabled = ${?HEALTH_CHECK_ENABLED} # may be overridden with this environment variable
interval = 60s
persistence {
enabled = true
enabled = ${?HEALTH_CHECK_PERSISTENCE_ENABLED} # may be overridden with this environment variable
timeout = 60s
}
}
index-initialization {
#indices should be created within this application
enabled = true
enabled = ${?INDEX_INITIALIZATION_ENABLED}
}
statsd {
hostname = ${?STATSD_PORT_8125_UDP_ADDR}
port = ${?STATSD_PORT_8125_UDP_PORT}
}
updater {
activity-check-interval = 1m
activity-check-interval = ${?ACTIVITY_CHECK_INTERVAL}
event-processing {
active = true
active = ${?EVENT_PROCESSING_ACTIVE}
}
cache-updates {
active = true
active = ${?CACHE_UPDATES_ACTIVE}
}
sync {
things {
active = true
active = ${?THINGS_SYNCHRONIZATION_ACTIVE}
start-offset = 30m
start-offset = ${?THINGS_SYNCHRONIZATION_START_OFFSET}
initial-start-offset = 120m
initial-start-offset = ${?THINGS_SYNCHRONIZATION_INITIAL_START_OFFSET}
stream-interval = 5m
stream-interval = ${?THINGS_SYNCHRONIZATION_STREAM_INTERVAL}
outdated-warning-offset = 12h
outdated-warning-offset = ${?THINGS_SYNCHRONIZATION_OUTDATED_WARNING_OFFSET}
max-idle-time = 1m
max-idle-time = ${?THINGS_SYNCHRONIZATION_MAX_IDLE_TIME}
streaming-actor-timeout = 5m
streaming-actor-timeout = ${?THINGS_SYNCHRONIZATION_STREAMING_ACTOR_TIMEOUT}
elements-streamed-per-batch = 10
elements-streamed-per-batch = ${?THINGS_SYNCHRONIZATION_ELEMENTS_PER_SECOND}
}
policies {
active = true
active = ${?POLICIES_SYNCHRONIZATION_ACTIVE}
start-offset = 30m
start-offset = ${?POLICIES_SYNCHRONIZATION_START_OFFSET}
initial-start-offset = 120m
initial-start-offset = ${?POLICIES_SYNCHRONIZATION_INITIAL_START_OFFSET}
stream-interval = 5m
stream-interval = ${?POLICIES_SYNCHRONIZATION_STREAM_INTERVAL}
outdated-warning-offset = 12h
outdated-warning-offset = ${?POLICIES_SYNCHRONIZATION_OUTDATED_WARNING_OFFSET}
max-idle-time = 1m
max-idle-time = ${?POLICIES_SYNCHRONIZATION_MAX_IDLE_TIME}
// streaming actor timeout is set generouslyl because each policy tag may trigger updates at many things.
streaming-actor-timeout = 30m
streaming-actor-timeout = ${?POLICIES_SYNCHRONIZATION_STREAMING_ACTOR_TIMEOUT}
elements-streamed-per-batch = 1
elements-streamed-per-batch = ${?POLICIES_SYNCHRONIZATION_ELEMENTS_PER_SECOND}
}
}
}
}
}
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
loglevel = "DEBUG"
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
# for log messages during the actor system is starting up and shutting down:
stdout-loglevel = "INFO"
log-config-on-start = off
actor {
provider = "akka.cluster.ClusterActorRefProvider"
enable-additional-serialization-bindings = on
# this is only intended for testing.
serialize-messages = off
serialize-creators = off
debug {
lifecycle = on
}
custom-updater-mailbox {
mailbox-type = "org.eclipse.ditto.services.thingsearch.updater.actors.mailbox.ThingUpdaterMailbox"
mailbox-capacity = 1000
mailbox-capacity = ${?UPDATER_MAILBOX_CAPACITY}
stash-capacity = 1000
stash-capacity = ${?UPDATER_STASH_CAPACITY}
}
serializers {
json = "org.eclipse.ditto.services.utils.cluster.JsonifiableSerializer"
}
serialization-bindings {
# "java.io.Serializable" = none # must not be set in order to get akka.cluster.sharding.ShardRegion$GetShardRegionStats$ serialized
# Serialize Jsonifiable events with custom JSON serializer:
"org.eclipse.ditto.model.base.json.Jsonifiable" = json
"org.eclipse.ditto.model.base.exceptions.DittoRuntimeException" = json
}
}
extensions = [
"akka.cluster.pubsub.DistributedPubSub",
"akka.cluster.ddata.DistributedData"
]
remote {
log-remote-lifecycle-events = on
netty.tcp {
# InetAddress.getLocalHost.getHostAddress is used if empty
hostname = ""
hostname = ${?TCP_HOSTNAME}
port = 2551
port = ${?TCP_PORT}
bind-hostname = ${?BIND_HOSTNAME}
bind-port = ${?BIND_TCP_PORT}
# maximum-frame-size = 128000b # this is the default
maximum-frame-size = 10485760b # 10MB - things could get that big
# send-buffer-size = 256000b # this is the default
send-buffer-size = 20971520b # 20MB
# receive-buffer-size = 256000b # this is the default
receive-buffer-size = 20971520b # 20MB
}
watch-failure-detector.threshold = 12 # default 10
}
cluster {
# Disable legacy metrics in akka-cluster.
metrics.enabled = off
# enable weakly up feature to allow members to join even if some members are unreachable
allow-weakly-up-members = on
sharding {
state-store-mode = ddata
use-dispatcher = "sharding-dispatcher"
role = "things-search"
}
roles = [
"things-search",
"thing-cache-aware",
"policy-cache-aware"
]
}
}
sharding-dispatcher {
# Dispatcher is the name of the event-based dispatcher
type = Dispatcher
# What kind of ExecutionService to use
executor = "fork-join-executor"
# Configuration for the fork join pool
fork-join-executor {
# Min number of threads to cap factor-based parallelism number to
parallelism-min = 8
# Parallelism (threads) ... ceil(available processors * factor)
parallelism-factor = 3.0
# Max number of threads to cap factor-based parallelism number to
parallelism-max = 128
}
# Throughput defines the maximum number of messages to be
# processed per actor before the thread jumps to the next actor.
# Set to 1 for as fair as possible.
throughput = 5 # default is 5
}
search-dispatcher {
# Dispatcher is the name of the event-based dispatcher
type = Dispatcher
# What kind of ExecutionService to use
executor = "fork-join-executor"
# Configuration for the fork join pool
fork-join-executor {
# Min number of threads to cap factor-based parallelism number to
parallelism-min = 8
# Parallelism (threads) ... ceil(available processors * factor)
parallelism-factor = 3.0
# Max number of threads to cap factor-based parallelism number to
parallelism-max = 128
}
# Throughput defines the maximum number of messages to be
# processed per actor before the thread jumps to the next actor.
# Set to 1 for as fair as possible.
throughput = 5
}