Commit | Line | Data |
---|---|---|
f5595c32 PP |
1 | lttng-relayd(8) |
2 | =============== | |
e9711845 | 3 | :revdate: 14 June 2021 |
26f0c779 PP |
4 | :daemon-bin-name: lttng-relayd |
5 | :daemon-ini-section: relayd | |
f5595c32 PP |
6 | |
7 | ||
8 | NAME | |
9 | ---- | |
26f0c779 | 10 | lttng-relayd - LTTng relay daemon |
f5595c32 PP |
11 | |
12 | ||
13 | SYNOPSIS | |
14 | -------- | |
15 | [verse] | |
7b7920c8 | 16 | *lttng-relayd* [option:--background | option:--daemonize] [option:--config='PATH'] |
89751b02 | 17 | [option:--control-port='URL'] [option:--data-port='URL'] [option:--fd-pool-size='COUNT'] |
26f0c779 PP |
18 | [option:--live-port='URL'] [option:--output='DIR'] [option:--group='GROUP'] |
19 | [option:--verbose]... [option:--working-directory='DIR'] | |
20 | [option:--group-output-by-host | option:--group-output-by-session] [option:--disallow-clear] | |
fd00593c | 21 | |
f5595c32 PP |
22 | |
23 | DESCRIPTION | |
24 | ----------- | |
26f0c779 | 25 | include::common-intro.txt[] |
f5595c32 | 26 | |
26f0c779 PP |
27 | An LTTng relay daemon, `lttng-relayd`, is a program which receives trace |
28 | data from (possibly remote) LTTng session/consumer daemons and which | |
29 | writes it to the local file system. The relay daemon also accepts LTTng | |
30 | live connections from compatible readers (for example, | |
31 | man:babeltrace2(1)); this is the recommended approach to read trace data | |
e9711845 | 32 | while the remote recording session is active. |
f5595c32 | 33 | |
26f0c779 PP |
34 | By default, a relay daemon listens on all network interfaces to receive |
35 | trace data, but only on `localhost` for LTTng live connections. Override | |
36 | the listening URLs with the option:--control-port, option:--data-port, | |
da39b67c | 37 | and option:--live-port options (see the ``<<url-format,URL format>>'' |
26f0c779 PP |
38 | section below). For example, use the |
39 | option:--live-port=+tcp://0.0.0.0:{default_network_viewer_port}+ option | |
40 | to make a relay daemon listen to LTTng live connections on all network | |
41 | interfaces. | |
f5595c32 | 42 | |
26f0c779 PP |
43 | Once LTTng has completely sent a trace to a relay daemon{nbsp}__RD__, |
44 | any LTTng trace reader can read the trace located on the local file | |
45 | system of{nbsp}__RD__. | |
f5595c32 | 46 | |
26f0c779 PP |
47 | By default, `lttng-relayd` doesn't start as a daemon. Make it a daemon |
48 | with the option:--daemonize or option:--background option. With those | |
49 | options, `lttng-relayd` ensures the daemon is listening to incoming | |
50 | connections before it exits. | |
f5595c32 | 51 | |
26f0c779 PP |
52 | |
53 | include::common-daemon-cfg.txt[] | |
54 | ||
55 | INI configuration file example: | |
56 | ||
57 | [source,ini] | |
58 | ---- | |
59 | [relayd] | |
60 | daemonize=yes | |
61 | live-port=tcp://0.0.0.0:4567 | |
62 | disallow-clear=yes | |
63 | ---- | |
f5595c32 PP |
64 | |
65 | ||
66 | [[output-directory]] | |
67 | Output directory | |
68 | ~~~~~~~~~~~~~~~~ | |
fd00593c | 69 | The relay daemon uses different output path patterns depending on: |
f5595c32 | 70 | |
fd00593c | 71 | * Its configuration. |
26f0c779 | 72 | + |
da39b67c | 73 | See the ``<<cfg,Daemon configuration>>'' section above. |
26f0c779 | 74 | |
e9711845 | 75 | * The recording session configuration of the connected peer. |
26f0c779 PP |
76 | * The LTTng session daemon (see man:lttng-sessiond(8)) version |
77 | of the connected peer. | |
f5595c32 | 78 | |
fd00593c PP |
79 | Consider the following variables: |
80 | ||
81 | 'BASE':: | |
26f0c779 PP |
82 | Base output directory: `$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME` |
83 | defaults to `$HOME`) or the argument of the option:--output option. | |
f5595c32 PP |
84 | |
85 | 'HOSTNAME':: | |
26f0c779 | 86 | Hostname of the connected peer. |
f5595c32 PP |
87 | |
88 | 'SESSION':: | |
e9711845 | 89 | Recording session name. |
fd00593c PP |
90 | |
91 | 'DATETIME':: | |
e9711845 | 92 | Unique recording session date/time. |
f5595c32 | 93 | |
26f0c779 PP |
94 | 'TRACEDIR':: |
95 | Custom trace directory path ('TRACEDIR' part of the argument of the | |
96 | nloption:--set-url option of the man:lttng-create(1) command, if | |
97 | any). | |
98 | ||
99 | 'SESSIONDV':: | |
100 | The version of the LTTng session daemon of the connected peer. | |
f5595c32 | 101 | |
fd00593c PP |
102 | The relay daemon output path patterns are: |
103 | ||
26f0c779 PP |
104 | With the option:--group-output-by-host option (hostname grouping):: |
105 | Without a custom trace directory::: | |
fd00593c | 106 | + |
fd00593c PP |
107 | [verse] |
108 | 'BASE'/'HOSTNAME'/'SESSION'-'DATETIME' | |
fd00593c | 109 | |
26f0c779 | 110 | With a custom trace directory::: |
fd00593c | 111 | + |
fd00593c | 112 | [verse] |
26f0c779 | 113 | 'BASE'/'HOSTNAME'/'TRACEDIR' |
04dedfc0 | 114 | |
e9711845 | 115 | With the option:--group-output-by-session option (recording session grouping):: |
26f0c779 PP |
116 | Without a custom trace directory::: |
117 | 'SESSIONDV' is at least{nbsp}2.4:::: | |
fd00593c | 118 | + |
04dedfc0 | 119 | [verse] |
fd00593c | 120 | 'BASE'/'SESSION'/'HOSTNAME'-'DATETIME' |
04dedfc0 | 121 | |
fd00593c PP |
122 | Otherwise:::: |
123 | Defaults to the hostname grouping pattern: | |
124 | + | |
fd00593c PP |
125 | [verse] |
126 | 'BASE'/'HOSTNAME'/'SESSION'-'DATETIME' | |
04dedfc0 | 127 | |
26f0c779 PP |
128 | With a custom trace directory::: |
129 | 'SESSIONDV' is at least 2.4:::: | |
fd00593c | 130 | + |
fd00593c | 131 | [verse] |
26f0c779 | 132 | 'BASE'/'SESSION'/'HOSTNAME'-'DATETIME'/'TRACEDIR' |
f5595c32 | 133 | |
fd00593c PP |
134 | Otherwise:::: |
135 | Defaults to the hostname grouping pattern: | |
136 | + | |
fd00593c | 137 | [verse] |
26f0c779 | 138 | 'BASE'/'HOSTNAME'/'TRACEDIR' |
04dedfc0 | 139 | |
f5595c32 PP |
140 | |
141 | [[url-format]] | |
142 | URL format | |
143 | ~~~~~~~~~~ | |
26f0c779 PP |
144 | The argument of the option:--control-port='URL', |
145 | option:--data-port='URL', and option:--live-port='URL' options is an | |
146 | URL. | |
f5595c32 | 147 | |
26f0c779 | 148 | The format of 'URL' is: |
f5595c32 PP |
149 | |
150 | [verse] | |
151 | tcp://('HOST' | 'IPADDR'):__PORT__ | |
152 | ||
153 | with: | |
154 | ||
155 | ('HOST' | 'IPADDR'):: | |
26f0c779 PP |
156 | Binding hostname or IP address. |
157 | + | |
158 | IPv6 address must be enclosed in square brackets (`[` and{nbsp}`]`); | |
159 | see https://www.ietf.org/rfc/rfc2732.txt[RFC{nbsp}2732]. | |
f5595c32 PP |
160 | |
161 | 'PORT':: | |
162 | TCP port. | |
163 | ||
164 | ||
26f0c779 | 165 | [[options]] |
f5595c32 PP |
166 | OPTIONS |
167 | ------- | |
26f0c779 PP |
168 | General daemon configuration |
169 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
f5595c32 | 170 | option:-b, option:--background:: |
26f0c779 PP |
171 | Start as a Unix daemon, but keep file descriptors (console) open. |
172 | + | |
173 | With this option, `lttng-relayd` ensures the daemon is listening | |
174 | to incoming connections before it exits. | |
175 | + | |
176 | Use the option:--daemonize option instead to close the file descriptors. | |
f5595c32 | 177 | |
7b7920c8 | 178 | option:-f 'PATH', option:--config='PATH':: |
26f0c779 PP |
179 | Configure the daemon using the INI configuration file 'PATH' in |
180 | addition to the default configuration files and the command-line | |
181 | options. | |
182 | + | |
da39b67c | 183 | See the ``<<cfg,Daemon configuration>>'' section above. |
7b7920c8 | 184 | |
f5595c32 | 185 | option:-d, option:--daemonize:: |
26f0c779 PP |
186 | Start as a Unix daemon and close file descriptors (console). |
187 | + | |
188 | With this option, `lttng-relayd` ensures the daemon is listening | |
189 | to incoming connections before it exits. | |
190 | + | |
191 | Use the option:--background option instead to keep the file descriptors | |
192 | open. | |
f5595c32 | 193 | |
fd00593c PP |
194 | option:-x, option:--disallow-clear:: |
195 | Disallow clearing operations (see man:lttng-clear(1)). | |
f5595c32 | 196 | + |
fd00593c | 197 | See also the `LTTNG_RELAYD_DISALLOW_CLEAR` environment variable. |
f5595c32 | 198 | |
fd00593c | 199 | option:--fd-pool-size='SIZE':: |
26f0c779 | 200 | Set the size of the file descriptor pool to 'SIZE' file descriptors. |
04dedfc0 | 201 | + |
26f0c779 PP |
202 | 'SIZE' is the maximum number of file descriptors that the relay daemon |
203 | may keep open simultaneously. | |
04dedfc0 | 204 | + |
fd00593c PP |
205 | Default: the soft `RLIMIT_NOFILE` resource limit of the process (see |
206 | man:getrlimit(2)). | |
207 | ||
208 | option:-g 'GROUP', option:--group='GROUP':: | |
26f0c779 PP |
209 | Set the Unix tracing group to 'GROUP' instead of `tracing`. |
210 | + | |
211 | This option is only meaningful when the `root` Unix user starts | |
212 | `lttng-relayd`. | |
213 | + | |
214 | Members of the Unix tracing group may connect to the health check socket | |
215 | of the relay daemon. | |
216 | + | |
217 | See also the `LTTNG_RELAYD_HEALTH` environment variable. | |
04dedfc0 | 218 | |
26f0c779 | 219 | option:-w 'DIR', option:--working-directory='DIR':: |
fd00593c | 220 | Set the working directory of the processes the relay daemon creates |
26f0c779 | 221 | to 'DIR'. |
fd00593c PP |
222 | + |
223 | See also the `LTTNG_RELAYD_WORKING_DIRECTORY` environment variable. | |
6ab3f69a | 224 | |
f5595c32 PP |
225 | option:-v, option:--verbose:: |
226 | Increase verbosity. | |
227 | + | |
26f0c779 | 228 | Specify this option up to three times to get more levels of verbosity. |
f5595c32 PP |
229 | |
230 | ||
fd00593c PP |
231 | Output |
232 | ~~~~~~ | |
da39b67c | 233 | See the ``<<output-directory,Output directory>>'' section above to learn |
26f0c779 | 234 | more. |
fd00593c PP |
235 | |
236 | option:-p, option:--group-output-by-host:: | |
26f0c779 PP |
237 | Group the written trace directories by hostname. |
238 | + | |
239 | As of LTTng{nbsp}{lttng_version}, this is the default output grouping | |
240 | strategy, but this may change in the future. | |
fd00593c PP |
241 | |
242 | option:-s, option:--group-output-by-session:: | |
e9711845 PP |
243 | Group the written trace directories by recording session name |
244 | instead of by hostname. | |
fd00593c | 245 | |
26f0c779 | 246 | option:-o 'DIR', option:--output='DIR':: |
fd00593c | 247 | Set the base output directory of the written trace directories to |
26f0c779 | 248 | 'DIR'. |
fd00593c PP |
249 | |
250 | ||
f5595c32 PP |
251 | Ports |
252 | ~~~~~ | |
da39b67c PP |
253 | See the ``<<url-format,URL format>>'' section above to learn more about |
254 | the syntax of the 'URL' argument of the following options. | |
f5595c32 | 255 | |
59b19c3c | 256 | option:-C 'URL', option:--control-port='URL':: |
26f0c779 PP |
257 | Listen to control data on URL 'URL'. |
258 | + | |
259 | Default: | |
260 | +tcp://{default_network_control_bind_address}:{default_network_control_port}+. | |
f5595c32 | 261 | |
59b19c3c | 262 | option:-D 'URL', option:--data-port='URL':: |
26f0c779 PP |
263 | Listen to trace data on URL 'URL'. |
264 | + | |
265 | Default: | |
266 | +tcp://{default_network_data_bind_address}:{default_network_data_port}+. | |
f5595c32 | 267 | |
59b19c3c | 268 | option:-L 'URL', option:--live-port='URL':: |
26f0c779 PP |
269 | Listen to LTTng live connections on URL 'URL'. |
270 | + | |
271 | Default: | |
272 | +tcp://{default_network_viewer_bind_address}:{default_network_viewer_port}+. | |
f5595c32 PP |
273 | |
274 | ||
275 | Program information | |
276 | ~~~~~~~~~~~~~~~~~~~ | |
26f0c779 | 277 | include::common-help-option.txt[] |
f5595c32 PP |
278 | |
279 | option:-V, option:--version:: | |
26f0c779 | 280 | Show version and quit. |
f5595c32 PP |
281 | |
282 | ||
af1c4164 PP |
283 | EXIT STATUS |
284 | ----------- | |
285 | *0*:: | |
286 | Success | |
287 | ||
288 | *1*:: | |
289 | Error | |
290 | ||
291 | *3*:: | |
292 | Fatal error | |
293 | ||
294 | ||
295 | ENVIRONMENT | |
296 | ----------- | |
9bbd8e06 | 297 | `LTTNG_ABORT_ON_ERROR`:: |
26f0c779 PP |
298 | Set to `1` to abort the process after the first error is |
299 | encountered. | |
9bbd8e06 | 300 | |
f5595c32 | 301 | `LTTNG_NETWORK_SOCKET_TIMEOUT`:: |
26f0c779 PP |
302 | Socket connection, receive, and send timeout (milliseconds). |
303 | + | |
304 | Set to `0` or `-1` to set an infinite timeout (default). | |
f5595c32 | 305 | |
06e1d71f | 306 | `LTTNG_RELAYD_DISALLOW_CLEAR`:: |
26f0c779 | 307 | Set to `1` to disallow clearing operations (see man:lttng-clear(1)). |
fd00593c | 308 | + |
26f0c779 | 309 | The option:--disallow-clear option overrides this environment variable. |
06e1d71f | 310 | |
f5595c32 | 311 | `LTTNG_RELAYD_HEALTH`:: |
26f0c779 | 312 | Path to the health check socket of the relay daemon. |
f5595c32 | 313 | |
e0512bf5 | 314 | `LTTNG_RELAYD_TCP_KEEP_ALIVE`:: |
26f0c779 | 315 | Set to `1` to enable TCP keep-alive. |
e0512bf5 JR |
316 | + |
317 | The TCP keep-alive mechanism allows the detection of dead peers | |
26f0c779 PP |
318 | (man:lttng-sessiond(8)) in cases of unclean termination (for example, a |
319 | hard reset) of a peer. | |
e0512bf5 JR |
320 | + |
321 | Supported on Linux and Solaris only. The default behaviour of the TCP | |
322 | keep-alive mechanism is OS-specific. | |
323 | + | |
26f0c779 | 324 | Search for `tcp_keepalive` in man:tcp(7) to learn more. |
e0512bf5 JR |
325 | |
326 | `LTTNG_RELAYD_TCP_KEEP_ALIVE_ABORT_THRESHOLD`:: | |
26f0c779 PP |
327 | The time threshold (seconds) to abort a TCP connection after the |
328 | keep-alive probing mechanism has failed. | |
e0512bf5 | 329 | + |
26f0c779 PP |
330 | Set to `0` or `-1` to use the value chosen by the operating system |
331 | (default). | |
e0512bf5 JR |
332 | + |
333 | Supported on Solaris 11 only. | |
334 | + | |
26f0c779 | 335 | Search for `tcp_keepalive_abort_threshold` in man:tcp(7) to learn more. |
e0512bf5 JR |
336 | |
337 | `LTTNG_RELAYD_TCP_KEEP_ALIVE_IDLE_TIME`:: | |
338 | Number of seconds a connection needs to be idle before TCP begins | |
339 | sending out keep-alive probes. | |
340 | + | |
26f0c779 PP |
341 | Set to `0` or `-1` to use the value chosen by the operating system |
342 | (default). | |
e0512bf5 JR |
343 | + |
344 | Supported on Linux and Solaris 11 only. | |
345 | + | |
26f0c779 PP |
346 | On Solaris{nbsp}11, the accepted values are `-1`, `0`, and `10` to |
347 | `864000`. | |
e0512bf5 JR |
348 | + |
349 | Search for `tcp_keepalive_time` and `tcp_keepalive_interval` | |
26f0c779 | 350 | in man:tcp(7) on Solaris{nbsp}11 to learn more. |
e0512bf5 JR |
351 | |
352 | `LTTNG_RELAYD_TCP_KEEP_ALIVE_MAX_PROBE_COUNT`:: | |
353 | Maximum number of TCP keep-alive probes to send before giving up and | |
354 | killing the connection if no response is obtained from the other end. | |
355 | + | |
26f0c779 PP |
356 | Set to `0` or `-1` to use the value chosen by the operating system |
357 | (default). | |
e0512bf5 JR |
358 | + |
359 | Supported on Linux only. | |
360 | + | |
26f0c779 | 361 | Search for `tcp_keepalive_probes` in man:tcp(7) to learn more. |
e0512bf5 JR |
362 | |
363 | `LTTNG_RELAYD_TCP_KEEP_ALIVE_PROBE_INTERVAL`:: | |
364 | Number of seconds between TCP keep-alive probes. | |
365 | + | |
26f0c779 PP |
366 | Set to `0` or `-1` to use the value chosen by the operating system |
367 | (default). | |
e0512bf5 JR |
368 | + |
369 | Supported on Linux only. | |
370 | + | |
26f0c779 | 371 | Search for `tcp_keepalive_intvl` in man:tcp(7) to learn more. |
e0512bf5 | 372 | |
508a802c | 373 | `LTTNG_RELAYD_WORKING_DIRECTORY`:: |
fd00593c | 374 | Working directory of the processes the relay daemon creates. |
508a802c | 375 | + |
26f0c779 PP |
376 | The option:--working-directory option overrides this environment |
377 | variable. | |
508a802c | 378 | |
f5595c32 | 379 | |
900690ca PP |
380 | FILES |
381 | ----- | |
382 | `$LTTNG_HOME/.lttng`:: | |
26f0c779 | 383 | Unix user's LTTng runtime and configuration directory. |
900690ca PP |
384 | |
385 | `$LTTNG_HOME/lttng-traces`:: | |
26f0c779 PP |
386 | Default base output directory of LTTng traces. |
387 | + | |
388 | Override this path with the option:--output option. | |
900690ca | 389 | |
484b2a0c | 390 | NOTE: `$LTTNG_HOME` defaults to `$HOME`. |
900690ca PP |
391 | |
392 | ||
f5595c32 PP |
393 | include::common-footer.txt[] |
394 | ||
395 | ||
396 | SEE ALSO | |
397 | -------- | |
af1c4164 | 398 | man:babeltrace2(1), |
7c1a4458 | 399 | man:lttng(1), |
af1c4164 | 400 | man:lttng-sessiond(8) |