]>
Commit | Line | Data |
---|---|---|
f7f62235 | 1 | .\" -*- nroff -*- |
b421d2af BP |
2 | .de IQ |
3 | . br | |
4 | . ns | |
5 | . IP "\\$1" | |
6 | .. | |
d2cb6c95 | 7 | .TH ovsdb\-server 1 "@VERSION@" "Open vSwitch" "Open vSwitch Manual" |
a946ed39 | 8 | .\" This program's name: |
f7f62235 BP |
9 | .ds PN ovsdb\-server |
10 | . | |
11 | .SH NAME | |
12 | ovsdb\-server \- Open vSwitch database server | |
13 | . | |
14 | .SH SYNOPSIS | |
15 | \fBovsdb\-server\fR | |
b4e8d170 | 16 | [\fIdatabase\fR]\&... |
a946ed39 BP |
17 | [\fB\-\-remote=\fIremote\fR]\&... |
18 | [\fB\-\-run=\fIcommand\fR] | |
19 | .so lib/daemon-syn.man | |
42dd41ef | 20 | .so lib/service-syn.man |
a946ed39 | 21 | .so lib/vlog-syn.man |
12b84d50 BP |
22 | .IP "Active-backup options:" |
23 | [\fB\-\-sync\-from=\fIserver\fR] | |
24 | [\fB\-\-sync\-exclude-tables=\fIdb\fB:\fItable\fR[\fB,\fIdb\fB:\fItable\fR]...\fR] | |
25 | [\fB\-\-active\fR] | |
812560d7 BP |
26 | .so lib/ssl-syn.man |
27 | .so lib/ssl-bootstrap-syn.man | |
5bf6cbd6 | 28 | .so lib/ssl-peer-ca-cert-syn.man |
e18a1d08 | 29 | .so lib/ssl-connect-syn.man |
a946ed39 BP |
30 | .so lib/unixctl-syn.man |
31 | .so lib/common-syn.man | |
f7f62235 BP |
32 | . |
33 | .SH DESCRIPTION | |
b4e8d170 BP |
34 | The \fBovsdb\-server\fR program provides RPC interfaces to one or more |
35 | Open vSwitch databases (OVSDBs). It supports JSON-RPC client | |
36 | connections over active or passive TCP/IP or Unix domain sockets. | |
12b84d50 BP |
37 | For an introduction to OVSDB and its implementation in Open vSwitch, |
38 | see \fBovsdb\fR(7). | |
f7f62235 | 39 | .PP |
b4e8d170 BP |
40 | Each OVSDB file may be specified on the command line as \fIdatabase\fR. |
41 | If none is specified, the default is \fB@DBDIR@/conf.db\fR. The database | |
42 | files must already have been created and initialized using, for | |
1b1d2e6d BP |
43 | example, \fBovsdb\-tool\fR's \fBcreate\fR, \fBcreate\-cluster\fR, or |
44 | \fBjoin\-cluster\fR command. | |
e51879e9 | 45 | .PP |
1b1d2e6d BP |
46 | This OVSDB implementation supports standalone, active-backup, and |
47 | clustered database service models, as well as database replication. | |
12b84d50 | 48 | See the Service Models section of \fBovsdb\fR(7) for more information. |
6bb9b060 | 49 | .PP |
1b1d2e6d BP |
50 | For clustered databases, when the \fB\-\-detach\fR option is used, |
51 | \fBovsdb\-server\fR detaches without waiting for the server to | |
52 | successfully join a cluster (if the database file is freshly created | |
53 | with \fBovsdb\-tool join\-cluster\fR) or connect to a cluster that it | |
54 | has already joined. Use \fBovsdb\-client wait\fR (see | |
55 | \fBovsdb\-client\fR(1)) to wait until the server has successfully | |
56 | joined and connected to a cluster. | |
57 | .PP | |
6bb9b060 BP |
58 | In addition to user-specified databases, \fBovsdb\-server\fR version |
59 | 2.9 and later also always hosts a built-in database named | |
60 | \fB_Server\fR. Please see \fBovsdb\-server\fR(5) for documentation on | |
61 | this database's schema. | |
62 | . | |
f7f62235 BP |
63 | .SH OPTIONS |
64 | . | |
0b1fae1b BP |
65 | .IP "\fB\-\-remote=\fIremote\fR" |
66 | Adds \fIremote\fR as a connection method used by \fBovsdb\-server\fR. | |
12b84d50 BP |
67 | The \fIremote\fR may be an OVSDB active or passive connection method, |
68 | e.g. \fBpssl:6640\fR, as described in \fBovsdb\fR(7). The following | |
69 | additional form is also supported: | |
f7f62235 BP |
70 | . |
71 | .RS | |
fb6de52c | 72 | .IP "\fBdb:\fIdb\fB,\fItable\fB,\fIcolumn\fR" |
a976b2ec | 73 | Reads additional connection methods from \fIcolumn\fR in all of the |
fb6de52c GS |
74 | rows in \fItable\fR within \fIdb\fR. As the contents of \fIcolumn\fR changes, |
75 | \fBovsdb\-server\fR also adds and drops connection methods accordingly. | |
94db5407 BP |
76 | .IP |
77 | If \fIcolumn\fR's type is string or set of strings, then the | |
78 | connection methods are taken directly from the column. The connection | |
79 | methods in the column must have one of the forms described above. | |
80 | .IP | |
81 | If \fIcolumn\fR's type is UUID or set of UUIDs and references a table, | |
82 | then each UUID is looked up in the referenced table to obtain a row. | |
83 | The following columns in the row, if present and of the correct type, | |
84 | configure a connection method. Any additional columns are ignored. | |
85 | .RS | |
86 | .IP "\fBtarget\fR (string)" | |
87 | Connection method, in one of the forms described above. This column | |
88 | is mandatory: if it is missing or empty then no connection method can | |
89 | be configured. | |
90 | .IP "\fBmax_backoff\fR (integer)" | |
91 | Maximum number of milliseconds to wait between connection attempts. | |
b4e8d170 | 92 | .IP "\fBinactivity_probe\fR (integer)" |
94db5407 BP |
93 | Maximum number of milliseconds of idle time on connection to |
94 | client before sending an inactivity probe message. | |
9c1a1182 LR |
95 | .IP "\fBread_only\fR (boolean)" |
96 | If true, only read-only transactions are allowed on this connection. | |
94db5407 BP |
97 | .RE |
98 | .IP | |
99 | It is an error for \fIcolumn\fR to have another type. | |
f7f62235 BP |
100 | .RE |
101 | . | |
9f33227d BP |
102 | .IP |
103 | To connect or listen on multiple connection methods, use multiple | |
104 | \fB\-\-remote\fR options. | |
105 | . | |
475afa1b BP |
106 | .IP "\fB\-\-run=\fIcommand\fR]" |
107 | Ordinarily \fBovsdb\-server\fR runs forever, or until it is told to | |
108 | exit (see \fBRUNTIME MANAGEMENT COMMANDS\fR below). With this option, | |
109 | \fBovsdb\-server\fR instead starts a shell subprocess running | |
110 | \fIcommand\fR. When the subprocess terminates, \fBovsdb\-server\fR | |
111 | also exits gracefully. If the subprocess exits normally with exit | |
112 | code 0, then \fBovsdb\-server\fR exits with exit code 0 also; | |
113 | otherwise, it exits with exit code 1. | |
114 | .IP | |
115 | This option can be useful where a database server is needed only to | |
116 | run a single command, e.g.: | |
4e312e69 | 117 | .B "ovsdb\-server \-\-remote=punix:socket \-\-run='ovsdb\-client dump unix:socket Open_vSwitch'" |
41064650 GS |
118 | .IP |
119 | This option is not supported on Windows platform. | |
f7f62235 | 120 | .SS "Daemon Options" |
a7ff9bd7 BP |
121 | .ds DD \ |
122 | \fBovsdb\-server\fR detaches only after it starts listening on all \ | |
1b1d2e6d BP |
123 | configured remotes. At this point, all standalone and active-backup \ |
124 | databases are ready for use. Clustered databases only become ready \ | |
125 | for use after they finish joining their clusters (which could have \ | |
126 | already happened in previous runs of \fBovsdb\-server\fR). | |
f7f62235 | 127 | .so lib/daemon.man |
42dd41ef GS |
128 | .SS "Service Options" |
129 | .so lib/service.man | |
f7f62235 BP |
130 | .SS "Logging Options" |
131 | .so lib/vlog.man | |
12b84d50 BP |
132 | .SS "Active-Backup Options" |
133 | These options support the \fBovsdb\-server\fR active-backup service | |
1b1d2e6d BP |
134 | model and database replication. These options apply only to databases |
135 | in the format used for standalone and active-backup databases, which | |
136 | is the database format created by \fBovsdb\-tool create\fR. By | |
12b84d50 BP |
137 | default, when it serves a database in this format, \fBovsdb\-server\fR |
138 | runs as a standalone server. These options can configure it for | |
139 | active-backup use: | |
140 | .IP \(bu | |
141 | Use \fB\-\-sync\-from=\fIserver\fR to start the server in the backup | |
142 | role, replicating data from \fIserver\fR. When \fBovsdb\-server\fR is | |
143 | running as a backup server, it rejects all transactions that can | |
144 | modify the database content, including lock commands. The same form | |
145 | can be used to configure the local database as a replica of | |
146 | \fIserver\fR. | |
147 | .IP \(bu | |
148 | Use \fB\-\-sync\-from=\fIserver\fB \-\-active\fR to start the server | |
149 | in the active role, but prepared to switch to the backup role in which | |
150 | it would replicate data from \fIserver\fR. When \fBovsdb\-server\fR | |
151 | runs in active mode, it allows all transactions, including those that | |
152 | modify the database. | |
153 | .PP | |
154 | At runtime, management commands can change a server's role and otherwise | |
155 | manage active-backup features. See \fBActive-Backup Commands\fR, below, | |
156 | for more information. | |
157 | .TP | |
158 | \fB\-\-sync\-from=\fIserver\fR | |
159 | Sets up \fBovsdb\-server\fR to synchronize its databases with the | |
160 | databases in \fIserver\fR, which must be an active connection method | |
161 | in one of the forms documented in \fBovsdb\-client\fR(1). Every | |
162 | transaction committed by \fIserver\fR will be replicated to | |
163 | \fBovsdb\-server\fR. This option makes \fBovsdb\-server\fR start | |
164 | as a backup server; add \fB\-\-active\fR to make it start as an | |
165 | active server. | |
166 | .TP | |
167 | \fB\-\-sync\-exclude-tables=\fIdb\fB:\fItable\fR[\fB,\fIdb\fB:\fItable\fR]...\fR | |
168 | Causes the specified tables to be excluded from replication. | |
169 | .TP | |
170 | \fB\-\-active\fR | |
171 | By default, \fB\-\-sync\-from\fR makes \fBovsdb\-server\fR start up as | |
172 | a backup for \fIserver\fR. With \fB\-\-active\fR, however, | |
173 | \fBovsdb\-server\fR starts as an active server. Use this option to | |
174 | allow the syncing options to be specified using command line options, | |
175 | yet start the server, as the default, active server. To switch the | |
176 | running server to backup mode, use \fBovs-appctl(1)\fR to execute the | |
177 | \fBovsdb\-server/connect\-active\-ovsdb\-server\fR command. | |
ac300505 | 178 | .SS "Public Key Infrastructure Options" |
78876719 BP |
179 | The options described below for configuring the SSL public key |
180 | infrastructure accept a special syntax for obtaining their | |
181 | configuration from the database. If any of these options is given | |
fb6de52c | 182 | \fBdb:\fIdb\fB,\fItable\fB,\fIcolumn\fR as its argument, then the |
4206b80f | 183 | actual file name is read from the specified \fIcolumn\fR in \fItable\fR |
fb6de52c | 184 | within the \fIdb\fR database. The \fIcolumn\fR must have type |
4206b80f HM |
185 | string or set of strings. The first nonempty string in the table is taken |
186 | as the file name. (This means that ordinarily there should be at most | |
78876719 | 187 | one row in \fItable\fR.) |
9467fe62 | 188 | .so lib/ssl.man |
a976b2ec | 189 | .so lib/ssl-bootstrap.man |
5bf6cbd6 | 190 | .so lib/ssl-peer-ca-cert.man |
e18a1d08 ER |
191 | .SS "SSL Connection Options" |
192 | .so lib/ssl-connect.man | |
f7f62235 | 193 | .SS "Other Options" |
7b38bdc8 | 194 | .so lib/unixctl.man |
f7f62235 BP |
195 | .so lib/common.man |
196 | .SH "RUNTIME MANAGEMENT COMMANDS" | |
197 | \fBovs\-appctl\fR(8) can send commands to a running | |
198 | \fBovsdb\-server\fR process. The currently supported commands are | |
199 | described below. | |
12b84d50 | 200 | .SS "\fBovsdb\-server\fR Commands" |
475afa1b BP |
201 | These commands are specific to \fBovsdb\-server\fR. |
202 | .IP "\fBexit\fR" | |
203 | Causes \fBovsdb\-server\fR to gracefully terminate. | |
30f81288 JP |
204 | .IP "\fBovsdb\-server/compact\fR [\fIdb\fR]" |
205 | Compacts database \fIdb\fR in-place. If \fIdb\fR is not | |
448b2003 | 206 | specified, compacts every database in-place. A database is also |
1cfdc175 | 207 | compacted automatically when a transaction is logged if it is over 2 |
448b2003 BP |
208 | times as large as its previous compacted size (and at least 10 MB), |
209 | but not before 100 commits have been added or 10 minutes have elapsed | |
1cfdc175 DA |
210 | since the last compaction. It will also be compacted automatically |
211 | after 24 hours since the last compaction if 100 commits were added | |
212 | regardless of its size. | |
31d0b6c9 BP |
213 | . |
214 | .IP "\fBovsdb\-server/reconnect\fR" | |
215 | Makes \fBovsdb\-server\fR drop all of the JSON\-RPC | |
216 | connections to database clients and reconnect. | |
217 | .IP | |
218 | This command might be useful for debugging issues with database | |
219 | clients. | |
220 | . | |
b421d2af BP |
221 | .IP "\fBovsdb\-server/add\-remote \fIremote\fR" |
222 | Adds a remote, as if \fB\-\-remote=\fIremote\fR had been specified on | |
223 | the \fBovsdb\-server\fR command line. (If \fIremote\fR is already a | |
224 | remote, this command succeeds without changing the configuration.) | |
225 | . | |
226 | .IP "\fBovsdb\-server/remove\-remote \fIremote\fR" | |
227 | Removes the specified \fIremote\fR from the configuration, failing | |
228 | with an error if \fIremote\fR is not configured as a remote. This | |
229 | command only works with remotes that were named on \fB\-\-remote\fR or | |
230 | \fBovsdb\-server/add\-remote\fR, that is, it will not remove remotes | |
231 | added indirectly because they were read from the database by | |
fb6de52c | 232 | configuring a \fBdb:\fIdb\fB,\fItable\fB,\fIcolumn\fR remote. |
b421d2af | 233 | (You can remove a database source with \fBovsdb\-server/remove\-remote |
fb6de52c | 234 | \fBdb:\fIdb\fB,\fItable\fB,\fIcolumn\fR, but not individual |
b421d2af BP |
235 | remotes found indirectly through the database.) |
236 | . | |
237 | .IP "\fBovsdb\-server/list\-remotes" | |
238 | Outputs a list of the currently configured remotes named on | |
239 | \fB\-\-remote\fR or \fBovsdb\-server/add\-remote\fR, that is, it does | |
240 | not list remotes added indirectly because they were read from the | |
241 | database by configuring a | |
fb6de52c | 242 | \fBdb:\fIdb\fB,\fItable\fB,\fIcolumn\fR remote. |
b421d2af | 243 | . |
0a3b723b BP |
244 | .IP "\fBovsdb\-server/add\-db \fIdatabase\fR" |
245 | Adds the \fIdatabase\fR to the running \fBovsdb\-server\fR. The database | |
246 | file must already have been created and initialized using, for example, | |
247 | \fBovsdb\-tool create\fR. | |
248 | . | |
249 | .IP "\fBovsdb\-server/remove\-db \fIdatabase\fR" | |
250 | Removes \fIdatabase\fR from the running \fBovsdb\-server\fR. \fIdatabase\fR | |
251 | must be a database name as listed by \fBovsdb-server/list\-dbs\fR. | |
252 | .IP | |
253 | If a remote has been configured that points to the specified | |
254 | \fIdatabase\fR (e.g. \fB\-\-remote=db:\fIdatabase\fB,\fR... on the | |
255 | command line), then it will be disabled until another database with | |
256 | the same name is added again (with \fBovsdb\-server/add\-db\fR). | |
257 | .IP | |
258 | Any public key infrastructure options specified through this database | |
259 | (e.g. \fB\-\-private\-key=db:\fIdatabase,\fR... on the command line) | |
260 | will be disabled until another database with the same name is added | |
261 | again (with \fBovsdb\-server/add\-db\fR). | |
262 | . | |
263 | .IP "\fBovsdb\-server/list\-dbs" | |
264 | Outputs a list of the currently configured databases added either through | |
265 | the command line or through the \fBovsdb\-server/add\-db\fR command. | |
266 | . | |
12b84d50 BP |
267 | .SS "Active-Backup Commands" |
268 | .PP | |
269 | These commands query and update the role of \fBovsdb\-server\fR within | |
270 | an active-backup pair of servers. See \fBActive-Backup Options\fR, | |
271 | above, and \fBActive-Backup Database Service Model\fR in | |
272 | \fBovsdb\fR(7) for more information. | |
273 | . | |
f53d7518 AZ |
274 | .IP "\fBovsdb\-server/set\-active\-ovsdb\-server \fIserver" |
275 | Sets the active \fIserver\fR from which \fBovsdb\-server\fR connects through | |
276 | \fBovsdb\-server/connect\-active\-ovsdb\-server\fR. | |
12b84d50 | 277 | This overrides the \fB\-\-sync\-from\fR command-line option. |
9dc05cdc | 278 | . |
f53d7518 AZ |
279 | .IP "\fBovsdb\-server/get\-active\-ovsdb\-server" |
280 | Gets the active server from which \fBovsdb\-server\fR is currently synchronizing | |
9dc05cdc MC |
281 | its databases. |
282 | . | |
f53d7518 | 283 | .IP "\fBovsdb\-server/connect\-active\-ovsdb\-server" |
12b84d50 BP |
284 | Switches the server to a backup role. The server starts synchronizing |
285 | its databases with the active server specified by | |
286 | \fBovsdb\-server/set\-active\-ovsdb\-server\fR (or the | |
287 | \fB\-\-sync\-from\fR command-line option) and closes all existing | |
288 | client connections, which requires clients to reconnect. | |
9dc05cdc | 289 | . |
f53d7518 | 290 | .IP "\fBovsdb\-server/disconnect\-active\-ovsdb\-server" |
12b84d50 BP |
291 | Switches the server to an active role. The server stops synchronizing |
292 | its databases with an active server and closes all existing client | |
293 | connections, which requires clients to reconnect. | |
9dc05cdc | 294 | . |
60e0cd04 | 295 | .IP "\fBovsdb\-server/set\-sync\-exclude\-tables \fIdb\fB:\fItable\fR[\fB,\fIdb\fB:\fItable\fR]..." |
12b84d50 BP |
296 | Sets the \fItable\fR within \fIdb\fR that will be excluded from synchronization. |
297 | This overrides the \fB\-\-sync\-exclude-tables\fR command-line option. | |
9dc05cdc | 298 | . |
60e0cd04 | 299 | .IP "\fBovsdb\-server/get\-sync\-exclude\-tables" |
9dc05cdc MC |
300 | Gets the tables that are currently excluded from synchronization. |
301 | . | |
60e0cd04 AZ |
302 | .IP "\fBovsdb\-server/sync\-status" |
303 | Prints a summary of replication run time information. The \fBstate\fR | |
304 | information is always provided, indicating whether the server is running | |
305 | in the \fIactive\fR or the \fIbackup\fR mode. | |
306 | When running in backup mode, replication connection status, which | |
307 | can be either \fIconnecting\fR, \fIreplicating\fR or \fIerror\fR, are shown. | |
308 | When the connection is in \fIreplicating\fR state, further output shows | |
309 | the list of databases currently replicating, and the tables that are | |
310 | excluded. | |
311 | . | |
1b1d2e6d BP |
312 | .SS "Cluster Commands" |
313 | These commands support the \fBovsdb\-server\fR clustered service model. | |
314 | They apply only to databases in the format used for clustered databases, | |
315 | which is the database format created by \fBovsdb\-tool create\-cluster\fR | |
316 | and \fBovsdb\-tool join\-cluster\fR. | |
317 | . | |
318 | .IP "\fBcluster/cid \fIdb\fR" | |
319 | Prints the cluster ID for \fIdb\fR, which is a UUID that identifies | |
320 | the cluster. If \fIdb\fR is a database newly created by | |
321 | \fBovsdb\-tool cluster\-join\fR that has not yet successfully joined | |
322 | its cluster, and \fB\-\-cid\fR was not specified on the | |
323 | \fBcluster\-join\fR command line, then this command will report an | |
324 | error because the cluster ID is not yet known. | |
325 | . | |
326 | .IP "\fBcluster/sid \fIdb\fR" | |
327 | Prints the server ID for \fIdb\fR, which is a UUID that identifies | |
328 | this server within the cluster. | |
329 | . | |
330 | .IP "\fBcluster/status \fIdb\fR" | |
331 | Prints this server's status within the cluster and the status of its | |
332 | connections to other servers in the cluster. | |
333 | . | |
334 | .IP "\fBcluster/leave \fIdb\fR" | |
335 | This command starts the server gracefully | |
336 | removing itself from its cluster. At least one server must remain, | |
337 | and the cluster must be healthy, that is, over half of the cluster's | |
338 | servers must be up. | |
339 | .IP | |
340 | When the server successfully leaves the cluster, it stops serving | |
341 | \fIdb\fR, as if \fBovsdb\-server/remove\-db \fIdb\fR had been | |
342 | executed. | |
343 | .IP | |
344 | Use \fBovsdb\-client wait\fR (see \fBovsdb\-client\fR(1)) to wait | |
345 | until the server has left the cluster. | |
346 | . | |
347 | .IP "\fBcluster/kick \fIdb server\fR" | |
348 | Start graceful removal of \fIserver\fR from \fIdb\fR's cluster, like | |
349 | \fBcluster/leave\fR (without \fB\-\-force\fR) except that it can | |
350 | remove any server, not just this one. | |
351 | .IP | |
352 | \fIserver\fR may be a server ID, as printed by \fBcluster/sid\fR, or | |
353 | the server's local network address as passed to \fBovsdb-tool\fR's | |
354 | \fBcreate\-cluster\fR or \fBjoin\-cluster\fR command. Use | |
355 | \fBcluster/status\fR to see a list of cluster members. | |
356 | . | |
f7f62235 | 357 | .so lib/vlog-unixctl.man |
149ff68a | 358 | .so lib/memory-unixctl.man |
a5f607bc | 359 | .so lib/coverage-unixctl.man |
508624b6 BP |
360 | .SH "BUGS" |
361 | . | |
362 | In Open vSwitch before version 2.4, when \fBovsdb\-server\fR sent | |
363 | JSON-RPC error responses to some requests, it incorrectly formulated | |
364 | them with the \fBresult\fR and \fBerror\fR swapped, so that the | |
365 | response appeared to indicate success (with a nonsensical result) | |
366 | rather than an error. The requests that suffered from this problem | |
367 | were: | |
368 | . | |
369 | .IP \fBtransact\fR | |
370 | .IQ \fBget_schema\fR | |
371 | Only if the request names a nonexistent database. | |
372 | .IP \fBmonitor\fR | |
373 | .IQ \fBlock\fR | |
374 | .IQ \fBunlock\fR | |
375 | In all error cases. | |
376 | . | |
377 | .PP | |
378 | Of these cases, the only error that a well-written application is | |
379 | likely to encounter in practice is \fBmonitor\fR of tables or columns | |
380 | that do not exist, in an situation where the application has been | |
381 | upgraded but the old database schema is still temporarily in use. To | |
382 | handle this situation gracefully, we recommend that clients should | |
383 | treat a \fBmonitor\fR response with a \fBresult\fR that contains an | |
384 | \fBerror\fR key-value pair as an error (assuming that the database | |
385 | being monitored does not contain a table named \fBerror\fR). | |
386 | . | |
f7f62235 | 387 | .SH "SEE ALSO" |
12b84d50 BP |
388 | \fBovsdb\fR(7), |
389 | \fBovsdb\-tool\fR(1), | |
390 | \fBovsdb\-server\fR(5), | |
391 | \fBovsdb\-server\fR(7). |