forked from bucardo/bucardo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bucardo.html
2720 lines (1788 loc) · 76.7 KB
/
bucardo.html
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
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>bucardo - utility script for controlling the Bucardo program</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<ul id="index">
<li><a href="#NAME">NAME</a></li>
<li><a href="#VERSION">VERSION</a></li>
<li><a href="#USAGE">USAGE</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
<li><a href="#COMMANDS">COMMANDS</a></li>
<li><a href="#OPTIONS">OPTIONS</a></li>
<li><a href="#COMMAND-DETAILS">COMMAND DETAILS</a>
<ul>
<li><a href="#install1">install</a></li>
<li><a href="#upgrade1">upgrade</a></li>
<li><a href="#start">start</a></li>
<li><a href="#stop">stop</a></li>
<li><a href="#restart">restart</a></li>
<li><a href="#list">list</a></li>
<li><a href="#add">add</a>
<ul>
<li><a href="#add-db">add db</a></li>
<li><a href="#add-dbgroup">add dbgroup</a></li>
<li><a href="#add-table">add table</a></li>
<li><a href="#add-sequence">add sequence</a></li>
<li><a href="#add-all-tables">add all tables</a></li>
<li><a href="#add-all-sequences">add all sequences</a></li>
<li><a href="#add-relgroup">add relgroup</a></li>
<li><a href="#add-sync">add sync</a></li>
<li><a href="#add-customname">add customname</a></li>
<li><a href="#add-customcols">add customcols</a></li>
<li><a href="#add-customcode">add customcode</a></li>
</ul>
</li>
<li><a href="#update">update</a>
<ul>
<li><a href="#update-customcode">update customcode</a></li>
<li><a href="#update-db">update db</a></li>
<li><a href="#update-sync">update sync</a></li>
<li><a href="#update-table">update table</a></li>
<li><a href="#update-sequence">update sequence</a></li>
</ul>
</li>
<li><a href="#remove">remove</a></li>
<li><a href="#kick">kick</a></li>
<li><a href="#pause">pause</a></li>
<li><a href="#reload-config1">reload config</a></li>
<li><a href="#set">set</a></li>
<li><a href="#show">show</a></li>
<li><a href="#config">config</a></li>
<li><a href="#ping">ping</a></li>
<li><a href="#status6">status</a></li>
<li><a href="#activate">activate</a></li>
<li><a href="#deactivate">deactivate</a></li>
<li><a href="#message1">message</a></li>
<li><a href="#reload">reload</a></li>
<li><a href="#inspect">inspect</a></li>
<li><a href="#validate">validate</a></li>
<li><a href="#purge">purge</a></li>
<li><a href="#delta">delta</a></li>
<li><a href="#help">help</a></li>
</ul>
</li>
<li><a href="#OPTIONS-DETAILS">OPTIONS DETAILS</a></li>
<li><a href="#FILES">FILES</a></li>
<li><a href="#ENVIRONMENT-VARIABLES">ENVIRONMENT VARIABLES</a></li>
<li><a href="#BUGS">BUGS</a></li>
<li><a href="#SEE-ALSO">SEE ALSO</a></li>
<li><a href="#COPYRIGHT">COPYRIGHT</a></li>
</ul>
<h1 id="NAME">NAME</h1>
<p>bucardo - utility script for controlling the Bucardo program</p>
<h1 id="VERSION">VERSION</h1>
<p>This document describes version 5.6.0 of bucardo</p>
<h1 id="USAGE">USAGE</h1>
<pre><code> bucardo [<options>] <command> [<action>] [<command-options>] [<command-params>]</code></pre>
<h1 id="DESCRIPTION">DESCRIPTION</h1>
<p>The bucardo script is the main interaction to a running Bucardo instance. It can be used to start and stop Bucardo, add new items, kick syncs, and even install and upgrade Bucardo itself. For more complete documentation, please view <a href="https://bucardo.org/">the wiki</a>.</p>
<h1 id="COMMANDS">COMMANDS</h1>
<p>Run <code>bucardo help <command></code> for additional details</p>
<dl>
<dt id="install"><code>install</code></dt>
<dd>
<p>Installs the Bucardo configuration database.</p>
</dd>
<dt id="upgrade"><code>upgrade</code></dt>
<dd>
<p>Upgrades the Bucardo configuration database to the latest schema.</p>
</dd>
<dt id="start-start-options-reason"><code>start [<start options>] [<reason>]</code></dt>
<dd>
<p>Starts Bucardo.</p>
</dd>
<dt id="stop-reason"><code>stop [<reason>]</code></dt>
<dd>
<p>Stops Bucardo.</p>
</dd>
<dt id="restart-start-options-reason"><code>restart [<start options>] [<reason>]</code></dt>
<dd>
<p>Stops and starts Bucardo.</p>
</dd>
<dt id="list-type-regex"><code>list <type> [<regex>]</code></dt>
<dd>
<p>Lists objects managed by Bucardo.</p>
</dd>
<dt id="add-type-name-parameters"><code>add <type> <name> <parameters></code></dt>
<dd>
<p>Adds a new object.</p>
</dd>
<dt id="update-type-name-parameters"><code>update <type> <name> <parameters></code></dt>
<dd>
<p>Updates an object.</p>
</dd>
<dt id="remove-type-name-name"><code>remove <type> <name> [<name>...]</code></dt>
<dd>
<p>Removes one or more objects.</p>
</dd>
<dt id="kick-syncname-sync-options-syncname...-timeout"><code>kick <syncname> [<sync options>] [<syncname>...] [<timeout>]</code></dt>
<dd>
<p>Kicks off one or more syncs.</p>
</dd>
<dt id="reload-config"><code>reload config</code></dt>
<dd>
<p>Sends a message to all CTL and KID processes asking them to reload the Bucardo configuration.</p>
</dd>
<dt id="reopen"><code>reopen</code></dt>
<dd>
<p>Sends a message to all Bucardo processes asking them to reopen any log files they may have open. Call this after you have rotated the log file(s).</p>
</dd>
<dt id="show-all-setting-setting"><code>show all|<setting> [<setting>...]</code></dt>
<dd>
<p>Shows the current Bucardo settings.</p>
</dd>
<dt id="set-setting-value-setting-value"><code><set <setting=value</code> [<setting=value>...] >></dt>
<dd>
<p>Sets one or more configuration setting..</p>
</dd>
<dt id="ping-timeout"><code>ping [<timeout>]</code></dt>
<dd>
<p>Sends a ping notice to the MCP process to see if it will respond.</p>
</dd>
<dt id="status-status-options-syncname-syncname"><code>status [<status options>] <syncname> [<syncname>...]</code></dt>
<dd>
<p>Shows the brief status of syncs in a tabular format.</p>
</dd>
<dt id="activate-syncname-syncname...-timeout"><code>activate <syncname> [<syncname>...] [<timeout>]</code></dt>
<dd>
<p>Activates one or more named syncs.</p>
</dd>
<dt id="deactivate-syncname-syncname...-timeout"><code>deactivate <syncname> [<syncname>...] [<timeout>]</code></dt>
<dd>
<p>Deactivates one or more named syncs.</p>
</dd>
<dt id="message-body"><code>message '<body>'</code></dt>
<dd>
<p>Sends a message to the running Bucardo logs.</p>
</dd>
<dt id="reload-syncname-syncname"><code>reload [<syncname> [<syncname>...]]</code></dt>
<dd>
<p>Sends a message to one or more sync processes, instructing them to reload.</p>
</dd>
<dt id="inspect-type-name-name"><code>inspect <type> <name> [<name>...]</code></dt>
<dd>
<p>Inspects one or more objects of a particular type.</p>
</dd>
<dt id="validate-all-syncname-syncname"><code>validate all|<syncname> [<syncname>...]</code></dt>
<dd>
<p>Validates one or more syncs.</p>
</dd>
<dt id="purge-all-table-table"><code>purge all|<table> [<table>...]</code></dt>
<dd>
<p>Purges the delta and track tables for one or more tables, for one or more databases.</p>
</dd>
<dt id="delta-database-s"><code>delta [<database(s)>]</code></dt>
<dd>
<p>Show the delta counts for each source target.</p>
</dd>
<dt id="help-command-action"><code>help [<command> [<action>]]</code></dt>
<dd>
<p>Shows help.</p>
</dd>
</dl>
<h1 id="OPTIONS">OPTIONS</h1>
<pre><code> -d --db-name NAME Database name.
-U --db-user USER Database user name.
-P --db-pass PASS Database password.
-h --db-host HOST Database server host name.
-p --db-port PORT Database server port number.
--bucardorc FILE Use specified .bucardorc file.
--no-bucardorc Do not use .bucardorc file.
--batch Enable batch mode: don't ask questions or validate inputs
--quiet Incremental quiet.
--verbose Incremental verbose mode.
-? --help Output basic help and exit.
--version Print the version number and exit.
--dryrun Do not perform any actual actions.
--confirm Require direct confirmation before changes.</code></pre>
<h1 id="COMMAND-DETAILS">COMMAND DETAILS</h1>
<p>Most of the commands take parameters. These may be passed after the command name and, where appropriate, an object name. Parameters take the form of key/value pairs separated by an equal sign (<code>=</code>). For example:</p>
<pre><code> bucardo add db sea_widgets dbname=widgets host=db.example.com</code></pre>
<p>Here <code>dbname</code> and <host> are parameters.</p>
<p>Many of the commands also use command-line options, which are specified in the normal way. For example, the <code>bucardo add db</code> command could also be written as:</p>
<pre><code> bucardo add db sea_widgets --dbname widgets --dbhost db.example.com</code></pre>
<p>However, parameters and options are not directly interchangeable in all cases. See the documentation for individual commands for their supported options.</p>
<h2 id="install1">install</h2>
<pre><code> bucardo install</code></pre>
<p>Installs the Bucardo schema from the file <i>bucardo.schema</i> into an existing Postgres cluster. The user "bucardo" and database "bucardo" will be created first as needed. This is an interactive installer, but you can supply the following values from the command line:</p>
<dl>
<dt id="dbuser"><code>--dbuser</code></dt>
<dd>
<p>defaults to postgres</p>
</dd>
<dt id="dbname"><code>--dbname</code></dt>
<dd>
<p>defaults to postgres</p>
</dd>
<dt id="dbport"><code>--dbport</code></dt>
<dd>
<p>defaults to 5432</p>
</dd>
<dt id="pid-dir"><code>--pid-dir</code></dt>
<dd>
<p>defaults to /var/run/bucardo/</p>
</dd>
</dl>
<h2 id="upgrade1">upgrade</h2>
<pre><code> bucardo upgrade</code></pre>
<p>Upgrades an existing Bucardo installation to the current version of the bucardo database script. Requires that bucardo and the <i>bucardo.schema</i> file be the same version. All changes should be backwards compatible, but you may need to re-validate existing scripts to make sure changes get propagated to all databases.</p>
<h2 id="start">start</h2>
<pre><code> bucardo start "Reason"</code></pre>
<p>Starts Bucardo. Fails if the MCP process is running (determined if its PID file is present). Otherwise, starts cleanly by first issuing the equivalent of a stop to ask any existing Bucardo processes to exit, and then starting a new Bucardo MCP process. A short reason and name should be provided - these are written to the <code>reason_file</code> file (<i>./bucardo.restart.reason.txt</i> by default) and sent in the email sent when Bucardo has been started up. It is also appended to the reason log, which has the same name as the the <code>reason_file</code> but ends in <i>.log</i>.</p>
<p>The options for the <code>start</code> command are:</p>
<dl>
<dt id="sendmail"><code>--sendmail</code></dt>
<dd>
<p>Tells Bucardo whether or not to send mail on interesting events: startup, shutdown, and errors. Default is on.</p>
</dd>
<dt id="extra-name-string"><code>--extra-name string</code></dt>
<dd>
<p>A short string that will be appended to the version string as output by the Bucardo process names. Mostly useful for debugging.</p>
</dd>
<dt id="log-destination-destination"><code>--log-destination destination</code></dt>
<dd>
<p>Determines the destination for logging output. The supported values are:</p>
<dl>
<dt id="stderr"><code>stderr</code></dt>
<dd>
</dd>
<dt id="stdout"><code>stdout</code></dt>
<dd>
</dd>
<dt id="syslog"><code>syslog</code></dt>
<dd>
</dd>
<dt id="none"><code>none</code></dt>
<dd>
</dd>
<dt id="A-file-system-directory">A file system directory.</dt>
<dd>
</dd>
</dl>
<p>May be specified more than once, which is useful for, e.g., logging both to a directory and to syslog. If <code>--log-destination</code> is not specified at all, the default is to log to files in <i>/var/log/bucardo</i>.</p>
</dd>
<dt id="log-separate"><code>--log-separate</code></dt>
<dd>
<p>Forces creation of separate log files for each Bucardo process of the form "log.bucardo.X.Y", where X is the type of process (MCP, CTL, or KID), and Y is the process ID.</p>
</dd>
<dt id="log-extension-string"><code>--log-extension string</code></dt>
<dd>
<p>Appends the given string to the end of the default log file name, <i>log.bucardo</i>. A dot is added before the name as well, so a log extension of "rootdb" would produce a log file named <i>log.bucardo.rootdb</i>.</p>
</dd>
<dt id="log-clean"><code>--log-clean</code></dt>
<dd>
<p>Forces removal of all old log files before running.</p>
</dd>
<dt id="debug"><code>--debug</code></dt>
<dd>
</dd>
<dt id="no-debug"><code>--no-debug</code></dt>
<dd>
<p>Enable or disable debugging output. Disabled by default.</p>
</dd>
<dt id="exit-on-nosync"><code>--exit-on-nosync</code></dt>
<dd>
</dd>
<dt id="no-exit-on-nosync"><code>--no-exit-on-nosync</code></dt>
<dd>
<p>On startup, if Bucardo finds no active syncs, it normally will continue to run, requiring a restart once syncs are added. This is useful for startup scripts and whatnot.</p>
<p>If, however, you want it to exit when there are no active syncs, pass the <code>--exit-on-nosync</code> option. You can also be explicit that it should <i>not</i> exit when there are no syncs by passing <code>--no-exit-on-nosync</code>. This is the default value.</p>
</dd>
</dl>
<h2 id="stop">stop</h2>
<pre><code> bucardo stop "Reason"</code></pre>
<p>Forces Bucardo to quit by creating a stop file which all MCP, CTL, and KID processes should detect and cause them to exit. Note that active syncs will not exit right away, as they will not look for the stop file until they have finished their current run. Typically, you should scan the list of processes after running this program to make sure that all Bucardo processes have stopped. One should also provide a reason for issuing the stop - usually this is a short explanation and your name. This is written to the <code>reason_file</code> file (<i>./bucardo.restart.reason.txt</i> by default) and is also used by Bucardo when it exits and sends out mail about its death. It is also appended to the reason log, which has the same name as the the <code>reason_file</code> but ends in <i>.log</i>.</p>
<h2 id="restart">restart</h2>
<pre><code> bucardo restart "Reason"</code></pre>
<p>Stops bucardo, waits for the stop to complete, and then starts it again. Supports the same options as <code>start</code>. Useful for start scripts. For getting just CTL and KID processes to recognize newly added, updated, or removed objects, use the <code>reload</code> command, instead.</p>
<h2 id="list">list</h2>
<pre><code> bucardo list <type> <regex></code></pre>
<p>Lists summary information about Bucardo objects. The supported types are:</p>
<ul>
<li><p><code>database</code></p>
</li>
<li><p><code>dbgroup</code></p>
</li>
<li><p><code>relgroup</code></p>
</li>
<li><p><code>sync</code></p>
</li>
<li><p><code>table</code></p>
</li>
<li><p><code>sequence</code></p>
</li>
<li><p><code>customcode</code></p>
</li>
<li><p><code>customname</code></p>
</li>
<li><p><code>customcols</code></p>
</li>
<li><p><code>all</code></p>
</li>
</ul>
<p>The <code>all</code> option will list information about all object types.</p>
<p>The optional <code>regex</code> option can be used to filter the list to only those matching a regular expression.</p>
<h2 id="add">add</h2>
<pre><code> bucardo add <type> <name> <parameters></code></pre>
<p>Adds a new object to Bucardo. The <code>type</code> specifies the type of object to add, while the <code>name</code> should be the name of the object. The supported types include:</p>
<dl>
<dt id="db"><code>db</code></dt>
<dd>
</dd>
<dt id="dbgroup"><code>dbgroup</code></dt>
<dd>
</dd>
<dt id="table"><code>table</code></dt>
<dd>
</dd>
<dt id="sequence"><code>sequence</code></dt>
<dd>
</dd>
<dt id="all-tables"><code>all tables</code></dt>
<dd>
</dd>
<dt id="all-sequences"><code>all sequences</code></dt>
<dd>
</dd>
<dt id="relgroup"><code>relgroup</code></dt>
<dd>
</dd>
<dt id="sync"><code>sync</code></dt>
<dd>
</dd>
<dt id="customname"><code>customname</code></dt>
<dd>
</dd>
<dt id="customcols"><code>customcols</code></dt>
<dd>
</dd>
</dl>
<h3 id="add-db">add db</h3>
<pre><code> bucardo add db <name> dbname=actual_name port=xxx host=xxx user=xxx</code></pre>
<p>Adds one or more new databases. The <code>name</code> is the name by which the database will be known to Bucardo, and must be unique. This may vary from the actual database name, as multiple hosts might have databases with the same name. Multiple databases can be added by separating the names with commas. Options that differ between the databases should be separated by a matching commas. Example:</p>
<pre><code> bucardo add db alpha,beta dbname=sales host=aa,bb user=bucardo</code></pre>
<p>This command will attempt an immediate test connection to the added database(s). The supported named parameters are:</p>
<dl>
<dt id="dbname1"><code>dbname</code></dt>
<dd>
<p>The actual name of the database. Required unless using a service file or setting it via dbdsn.</p>
</dd>
<dt id="type"><code>type</code></dt>
<dd>
<p>The type of the database. Defaults to <code>postgres</code>. Currently supported values are:</p>
<ul>
<li><p><code>postgres</code></p>
</li>
<li><p><code>drizzle</code></p>
</li>
<li><p><code>mongo</code></p>
</li>
<li><p><code>mysql</code></p>
</li>
<li><p><code>maria</code></p>
</li>
<li><p><code>oracle</code></p>
</li>
<li><p><code>redis</code></p>
</li>
<li><p><code>sqlite</code></p>
</li>
</ul>
</dd>
<dt id="dbdsn"><code>dbdsn</code></dt>
<dd>
<p>A direct DSN to connect to a database. Will override all other connection options if set.</p>
</dd>
<dt id="user"><code>user</code></dt>
<dd>
<p>The username Bucardo should use when connecting to this database.</p>
</dd>
<dt id="pass"><code>pass</code></dt>
<dd>
<p>The password Bucardo should use when connecting to this database. It is recommended that you use a .pgpass file rather than entering the password here.</p>
</dd>
<dt id="host"><code>host</code></dt>
<dd>
<p>The host Bucardo should use when connecting to this database. Defaults to the value of the <code>$PGHOSTADDR</code> or <code>$PGHOST</code> environment variables, if present.</p>
</dd>
<dt id="port"><code>port</code></dt>
<dd>
<p>The port Bucardo should use when connecting to this database. Defaults to the value of the <code>$PGPORT</code> environment variable, if present.</p>
</dd>
<dt id="conn"><code>conn</code></dt>
<dd>
<p>Additional connection parameters, e.g. <code>sslmode=require</code>.</p>
</dd>
<dt id="service"><code>service</code></dt>
<dd>
<p>The service name Bucardo should use when connecting to this database.</p>
</dd>
<dt id="status"><code>status</code></dt>
<dd>
<p>Initial status of this database. Defaults to "active" but can be set to "inactive".</p>
</dd>
<dt id="dbgroup1"><code>dbgroup</code></dt>
<dd>
<p>Name of the database group this database should belong to.</p>
</dd>
<dt id="addalltables"><code>addalltables</code></dt>
<dd>
<p>Automatically add all tables from this database.</p>
</dd>
<dt id="addallsequences"><code>addallsequences</code></dt>
<dd>
<p>Automatically add all sequences from this database.</p>
</dd>
<dt id="server_side_prepares"><code>server_side_prepares</code></dt>
<dd>
</dd>
<dt id="ssp"><code>ssp</code></dt>
<dd>
<p>Set to 1 or 0 to enable or disable server-side prepares. Defaults to 1.</p>
</dd>
<dt id="makedelta"><code>makedelta</code></dt>
<dd>
<p>Set to 1 or 0 to enable or disable makedelta. Defaults to 0.</p>
</dd>
</dl>
<p>Additional parameters:</p>
<dl>
<dt id="force"><code>--force</code></dt>
<dd>
<p>Forces the database to be added without running a connection test.</p>
</dd>
</dl>
<p><b>Note:</b> As a convenience, if the <code>dbuser</code> value is its default value, "bucardo", in the event that Bucardo cannot connect to the database, it will try connecting as "postgres" and create a superuser named "bucardo". This is to make things easier for folks getting started with Bucardo, but will not work if it cannot connect as "postgres", or if it the connection failed due to an authentication failure.</p>
<h3 id="add-dbgroup">add dbgroup</h3>
<pre><code> bucardo add dbgroup name db1:source db2:source db3:target ...</code></pre>
<p>Adds one or more databases to the named dbgroup. If the dbgroup doesn't exist, it will be created. The database parameters should specify their roles, either "source" or "target".</p>
<h3 id="add-table">add table</h3>
<pre><code> bucardo add table [schema].table db=actual_db_name</code></pre>
<p>Adds a table object. The table information will be read from the specified database. Supported parameters:</p>
<dl>
<dt id="db1"><code>db</code></dt>
<dd>
<p>The name of the database from which to read the table information. Should be a name known to Bucardo, thanks to a previous call to <code>add database</code>. Required.</p>
</dd>
<dt id="autokick"><code>autokick</code></dt>
<dd>
<p>Boolean indicating whether or not the table should automatically send kick messages when it's modified. Overrides the <code>autokick</code> parameter of any syncs of which the table is a part.</p>
</dd>
<dt id="rebuild_index"><code>rebuild_index</code></dt>
<dd>
<p>Boolean indicating whether or not to rebuild indexes after every sync. Off by default. Optional.</p>
</dd>
<dt id="analyze_after_copy"><code>analyze_after_copy</code></dt>
<dd>
<p>Boolean indicating whether or not to analyze the table after every sync. Off by default. Optional.</p>
</dd>
<dt id="vacuum_after_copy"><code>vacuum_after_copy</code></dt>
<dd>
<p>Boolean indicating whether or not to vacuum the table after every sync. Off by default. Optional.</p>
</dd>
<dt id="relgroup1"><code>relgroup</code></dt>
<dd>
<p>Adds the table to the named relgroup. If the relgroup does not exist, it will be created. Optional.</p>
</dd>
<dt id="makedelta1"><code>makedelta</code></dt>
<dd>
<p>Turns makedelta magic on or off. Value is a list of databases which need makedelta for this table. Value can also be "on" to enable makedelta for all databases. Defaults to "off".</p>
</dd>
<dt id="strict_checking"><code>strict_checking</code></dt>
<dd>
<p>Boolean indicating whether or not to be strict when comparing the table between syncs. If the columns have different names or data types, the validation will fail. But perhaps the columns are allowed to have different names or data types. If so, disable <code>strict_checking</code> and column differences will result in warnings rather than failing the validation. Defaults to true.</p>
</dd>
</dl>
<h3 id="add-sequence">add sequence</h3>
<pre><code> bucardo add sequence [schema].sequence relgroup=xxx</code></pre>
<dl>
<dt id="db2"><code>db</code></dt>
<dd>
<p>The name of the database from which to read the sequence information. Should be a name known to Bucardo, thanks to a previous call to <code>add database</code>. Required.</p>
</dd>
<dt id="relgroup2"><code>relgroup</code></dt>
<dd>
<p>Adds the sequence to the named relgroup. If the relgroup does not exist, it will be created. Optional.</p>
</dd>
</dl>
<h3 id="add-all-tables">add all tables</h3>
<pre><code> bucardo add all tables [relgroup=xxx] [pkonly]</code></pre>
<p>Adds all the tables in all known databases or in a specified database. Excludes tables in the <code>pg_catalog</code>, <code>information_schema</code>, and <code>bucardo</code> schemas. (Yes, this means that you cannot replicate the Bucardo configuration database using Bucardo. Sorry about that.) Supported options and parameters:</p>
<dl>
<dt id="db3"><code>db</code></dt>
<dd>
</dd>
<dt id="db4"><code>--db</code></dt>
<dd>
<p>Name of the database from which to find all the tables to add. If not provided, tables will be added from all known databases.</p>
</dd>
<dt id="schema"><code>schema</code></dt>
<dd>
</dd>
<dt id="schema1"><code>--schema</code></dt>
<dd>
</dd>
<dt id="n"><code>-n</code></dt>
<dd>
<p>Limit to the tables in the specified comma-delimited list of schemas. The options may be specified more than once.</p>
</dd>
<dt id="exclude-schema"><code>exclude-schema</code></dt>
<dd>
</dd>
<dt id="exclude-schema1"><code>--exclude-schema</code></dt>
<dd>
</dd>
<dt id="N"><code>-N</code></dt>
<dd>
<p>Exclude tables in the specified comma-delimited list of schemas. The options may be specified more than once.</p>
</dd>
<dt id="table1"><code>table</code></dt>
<dd>
</dd>
<dt id="table2"><code>--table</code></dt>
<dd>
</dd>
<dt id="t"><code>-t</code></dt>
<dd>
<p>Limit to the specified tables. The options may be specified more than once.</p>
</dd>
<dt id="exclude-table"><code>exclude-table</code></dt>
<dd>
</dd>
<dt id="exclude-table1"><code>--exclude-table</code></dt>
<dd>
</dd>
<dt id="T"><code>-T</code></dt>
<dd>
<p>Exclude the specified tables. The options may be specified more than once.</p>
</dd>
<dt id="relgroup3"><code>relgroup</code></dt>
<dd>
</dd>
<dt id="relgroup4"><code>--relgroup</code></dt>
<dd>
<p>Name of the relgroup to which to add new tables.</p>
</dd>
<dt id="pkonly"><code>pkonly</code></dt>
<dd>
<p>Exclude tables without primary keys.</p>
</dd>
</dl>
<h3 id="add-all-sequences">add all sequences</h3>
<pre><code> bucardo add all sequences relgroup=xxx</code></pre>
<p>Adds all the sequences in all known databases or in a specified database. Excludes sequences in the <code>pg_catalog</code>, <code>information_schema</code>, and <code>bucardo</code> schemas. (Yes, this means that you cannot replicate the Bucardo configuration database using Bucardo. Sorry about that.) Supported options and parameters:</p>
<dl>
<dt id="db5"><code>db</code></dt>
<dd>
</dd>
<dt id="db6"><code>--db</code></dt>
<dd>
<p>Name of the database from which to find all the sequences to add. If not provided, sequences will be added from all known databases.</p>
</dd>
<dt id="schema2"><code>schema</code></dt>
<dd>
</dd>
<dt id="schema3"><code>--schema</code></dt>
<dd>
</dd>
<dt id="n1"><code>-n</code></dt>
<dd>
<p>Limit to the sequences in the specified comma-delimited list of schemas. The options may be specified more than once.</p>
</dd>
<dt id="exclude-schema2"><code>exclude-schema</code></dt>
<dd>
</dd>
<dt id="exclude-schema3"><code>--exclude-schema</code></dt>
<dd>
</dd>
<dt id="N1"><code>-N</code></dt>
<dd>
<p>Exclude sequences in the specified comma-delimited list of schemas. The options may be specified more than once.</p>
</dd>
<dt id="relgroup5"><code>relgroup</code></dt>
<dd>
</dd>
<dt id="relgroup6"><code>--relgroup</code></dt>
<dd>
<p>Name of the relgroup to which to add new tables or sequences.</p>
</dd>
</dl>
<h3 id="add-relgroup">add relgroup</h3>
<pre><code> bucardo add relgroup name
bucardo add relgroup name table, sequence, ...</code></pre>
<p>Adds a relgroup. After the name, pass in an optional list of tables and/or sequences and they will be added to the group.</p>
<h3 id="add-sync">add sync</h3>
<pre><code> bucardo add sync name relgroup=xxx dbs=xxx</code></pre>
<p>Adds a sync, which is a named replication event containing information about what to replicate from where to where. The supported parameters are:</p>
<dl>
<dt id="dbs"><code>dbs</code></dt>
<dd>
<p>The name of a dbgroup or comma-delimited list of databases. All of the specified databases will be synchronized. Required.</p>
</dd>
<dt id="dbgroup2"><code>dbgroup</code></dt>
<dd>
<p>The name of a dbgroup. All of the databases within this group will be part of the sync. If the dbgroup does not exists and a separate list of databases is given, the group will be created and populated.</p>
</dd>
<dt id="relgroup7"><code>relgroup</code></dt>
<dd>
<p>The name of a relgroup to synchronize. All of the tables and/or sequences in the relgroup will be synchronized. Required unless <code>tables</code> is specified.</p>
</dd>
<dt id="tables"><code>tables</code></dt>
<dd>
<p>List of tables to add to the sync. This implicitly creates a relgroup with the same name as the sync. Required unless <code>relgroup</code> is specified.</p>
</dd>
<dt id="status1"><code>status</code></dt>
<dd>
<p>Indicates whether or not the sync is active. Must be either "active" or "inactive". Defaults to "active".</p>
</dd>
<dt id="rebuild_index1"><code>rebuild_index</code></dt>
<dd>
<p>Boolean indicating whether or not to rebuild indexes after every sync. Defaults to off.</p>
</dd>
<dt id="lifetime"><code>lifetime</code></dt>
<dd>
<p>Number of seconds a KID can live before being reaped. No limit by default.</p>
</dd>
<dt id="maxkicks"><code>maxkicks</code></dt>
<dd>
<p>Number of times a KID may be kicked before being reaped. No limit by default.</p>
</dd>
<dt id="conflict_strategy"><code>conflict_strategy</code></dt>
<dd>
<p>The conflict resolution strategy to use in the sync. Supported values:</p>
<dl>
<dt id="bucardo_source"><code>bucardo_source</code></dt>
<dd>
<p>The rows on the "source" database always "win". In other words, in a conflict, Bucardo copies rows from source to target.</p>
</dd>
<dt id="bucardo_target"><code>bucardo_target</code></dt>
<dd>
<p>The rows on the "target" database always win.</p>
</dd>
<dt id="bucardo_skip"><code>bucardo_skip</code></dt>
<dd>
<p>Any conflicting rows are simply not replicated. Not recommended for most cases.</p>
</dd>
<dt id="bucardo_random"><code>bucardo_random</code></dt>