blob: 1921dbcb0b15ee5f62f989b6d78b8ae757bd53d8 [file] [log] [blame] [view]
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -04001@PLUGIN@ Configuration
2=========================
3
David Pursehouse9a778a52017-06-30 10:00:56 +09004The @PLUGIN@ plugin must be installed on both instances and the following fields
Hugo Arèsa897ed82017-05-31 11:47:03 -04005should be specified in `$site_path/etc/@PLUGIN@.config` file:
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -04006
Hugo Arèsa897ed82017-05-31 11:47:03 -04007File '@PLUGIN@.config'
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -04008--------------------
9
Luca Milanesio716282b2018-02-19 15:18:36 -080010### Static definition of the high-availability nodes.
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -040011
Luca Milanesio716282b2018-02-19 15:18:36 -080012```
Christian Halstrick75b54322017-05-04 16:45:19 +020013[main]
Luca Milanesio716282b2018-02-19 15:18:36 -080014 sharedDirectory = /directory/accessible/from/both/instances
Luca Milanesioacb67872018-02-20 15:59:34 -080015[autoReindex]
16 enabled = false
Christian Halstrick75b54322017-05-04 16:45:19 +020017[peerInfo]
Luca Milanesio716282b2018-02-19 15:18:36 -080018 strategy = static
19[peerInfo "static"]
20 url = target_instance_url
Christian Halstrick75b54322017-05-04 16:45:19 +020021[http]
Luca Milanesio716282b2018-02-19 15:18:36 -080022 user = username
23 password = password
24```
25
26### Dynamic jgroups-based discovery of the high-availability nodes
27
28```
29[main]
30 sharedDirectory = /directory/accessible/from/both/instances
Luca Milanesioacb67872018-02-20 15:59:34 -080031[autoReindex]
32 enabled = false
Luca Milanesio716282b2018-02-19 15:18:36 -080033[peerInfo]
34 strategy = jgroups
35[peerInfo "jgroups"]
36 myUrl = local_instance_url
37[jgroups]
38 clusterName = foo
39 skipInterface = lo*
40 skipInterface = eth2
41 protocolStack = protocolStack.xml
42[http]
43 user = username
44 password = password
David Pursehouse39033542017-11-30 17:02:24 +090045[healthcheck]
Luca Milanesio716282b2018-02-19 15:18:36 -080046 enable = true
47```
Christian Halstrick75b54322017-05-04 16:45:19 +020048
Luca Milanesio22ffb222018-02-21 10:28:30 -080049```main.sharedDirectory```
Hugo Arèsa897ed82017-05-31 11:47:03 -040050: Path to a directory accessible from both master instances.
Saša Živkovc44904b2017-06-19 15:49:19 +020051 When given as a relative path, then it is resolved against the $SITE_PATH
52 or Gerrit server. For example, if $SITE_PATH is "/gerrit/root" and
53 sharedDirectory is given as "shared/dir" then the real path of the shared
Saša Živkov31304ac2017-05-18 17:14:09 +020054 directory is "/gerrit/root/shared/dir". When not specified, the default
55 is "shared".
Hugo Arèsa897ed82017-05-31 11:47:03 -040056
Luca Milanesioacb67872018-02-20 15:59:34 -080057```autoReindex.enabled```
58: Enable the tracking of the latest change indexed under data/high-availability
59 for each of the indexes. At startup scans all the changes, accounts and groups
60 and reindex the ones that have been updated by other nodes while the server was down.
61 When not specified, the default is "false", that means no automatic tracking
62 and indexing at start.
63
64```autoReindex.delay```
65: When autoReindex is enabled, indicates the delay aftere the plugin startup,
66 before triggering the conditional reindexing of all changes, accounts and groups.
67 Delay is expressed in Gerrit time values as in [websession.cleanupInterval](#websessioncleanupInterval).
68 When not specified, the default is "10 seconds".
69
70```autoReindex.pollInterval```
71: When autoReindex is enabled, indicates the interval between the conditional
72 reindexing of all changes, accounts and groups.
73 Delay is expressed in Gerrit time values as in [websession.cleanupInterval](#websessioncleanupInterval).
74 When not specified, polling of conditional reindexing is disabled.
75
76```autoReindex.interval```
77: Enable the tracking of the latest change indexed under data/high-availability
78 for each of the indexes. At startup scans all the changes, accounts and groups
79 and reindex the ones that have been updated by other nodes while the server was down.
80 When not specified, the default is "false", that means no automatic tracking
81 and indexing at start.
82
Luca Milanesio22ffb222018-02-21 10:28:30 -080083```peerInfo.strategy```
Christian Halstrick75b54322017-05-04 16:45:19 +020084: Strategy to find other peers. Supported strategies are `static` or `jgroups`.
85 Defaults to `static`.
86* The `static` strategy allows to staticly configure the peer gerrit instance using
87the configuration parameter `peerInfo.static.url`.
88* The `jgroups` strategy allows that a gerrit instance discovers the peer
89instance by using JGroups to send multicast messages. In this case the
90configuration parameters `peerInfo.jgroups.*` are used to control the sending of
91the multicast messages. During startup each instance will advertise its address
92over a JGroups multicast message. JGroups takes care to inform each cluster when
93a member joins or leaves the cluster.
94
Luca Milanesio22ffb222018-02-21 10:28:30 -080095```peerInfo.static.url```
David Pursehouse9a778a52017-06-30 10:00:56 +090096: Specify the URL for the peer instance.
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -040097
Luca Milanesio22ffb222018-02-21 10:28:30 -080098```peerInfo.jgroups.myUrl```
David Pursehousef5352eb2017-09-08 09:54:10 +090099: The URL of this instance to be broadcast to other peers. If not specified, the
100 URL is determined from the `httpd.listenUrl` in the `gerrit.config`.
101 If `httpd.listenUrl` is configured with multiple values, is configured to work
102 with a reverse proxy (i.e. uses `proxy-http` or `proxy-https` scheme), or is
103 configured to listen on all local addresses (i.e. using hostname `*`), then
104 the URL must be explicitly specified with `myUrl`.
105
Luca Milanesio22ffb222018-02-21 10:28:30 -0800106```jgroups.clusterName```
Saša Živkov1bf2d742017-09-26 11:40:30 +0200107: The name of the high-availability cluster. When peers discover themselves dynamically this
108 name is used to determine which instances should work together. Only those Gerrit
109 interfaces which are configured for the same clusterName will communicate with each other.
110 Defaults to "GerritHA".
111
Luca Milanesio22ffb222018-02-21 10:28:30 -0800112```jgroups.skipInterface```
Saša Živkov1bf2d742017-09-26 11:40:30 +0200113: A name or a wildcard of network interface(s) which should be skipped
114 for JGroups communication. Peer discovery may fail if the host has multiple
115 network interfaces and an inappropriate interface is chosen by JGroups.
116 This option can be repeated many times in the `jgroups` section.
117 Defaults to the list of: `lo*`, `utun*`, `awdl*` which are known to be
118 inappropriate for JGroups communication.
119
Luca Milanesio22ffb222018-02-21 10:28:30 -0800120```jgroups.protocolStack```
Eryk Szymanskif93acd42017-12-14 00:09:32 +0100121: This optional parameter specifies the path of an xml file that contains the
122 definition of JGroups protocol stack. If not specified the default protocol stack
123 will be used. May be an absolute or relative path. If the path is relative it is
124 resolved from the site's `etc` folder. For more information on protocol stack and
125 its configuration file syntax please refer to JGroups documentation.
126 See [JGroups - Advanced topics](http://jgroups.org/manual-3.x/html/user-advanced.html).
127
Christian Halstrick75b54322017-05-04 16:45:19 +0200128NOTE: To work properly in certain environments, JGroups needs the System property
129`java.net.preferIPv4Stack` to be set to `true`.
Eryk Szymanskif93acd42017-12-14 00:09:32 +0100130See [JGroups - Trouble shooting](http://jgroups.org/tutorial/index.html#_trouble_shooting).
Christian Halstrick75b54322017-05-04 16:45:19 +0200131
Luca Milanesio22ffb222018-02-21 10:28:30 -0800132```http.user```
David Pursehouse9a778a52017-06-30 10:00:56 +0900133: Username to connect to the peer instance.
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -0400134
Luca Milanesio22ffb222018-02-21 10:28:30 -0800135```http.password```
David Pursehouse9a778a52017-06-30 10:00:56 +0900136: Password to connect to the peer instance.
Hugo Arès4bde0252017-03-10 14:45:15 -0500137
Hugo Arès7eeb21e2017-03-02 22:48:15 -0500138@PLUGIN@ plugin uses REST API calls to keep the target instance in-sync. It
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -0400139is possible to customize the parameters of the underlying http client doing these
140calls by specifying the following fields:
141
Luca Milanesio22ffb222018-02-21 10:28:30 -0800142```http.connectionTimeout```
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -0400143: Maximum interval of time in milliseconds the plugin waits for a connection
144 to the target instance. When not specified, the default value is set to 5000ms.
145
Luca Milanesio22ffb222018-02-21 10:28:30 -0800146```http.socketTimeout```
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -0400147: Maximum interval of time in milliseconds the plugin waits for a response from the
148 target instance once the connection has been established. When not specified,
149 the default value is set to 5000ms.
150
Luca Milanesio22ffb222018-02-21 10:28:30 -0800151```http.maxTries```
Hugo Arès7eeb21e2017-03-02 22:48:15 -0500152: Maximum number of times the plugin should attempt when calling a REST API in
153 the target instance. Setting this value to 0 will disable retries. When not
Hugo Arès895722e2018-04-17 16:09:17 +0200154 specified, the default value is 360. After this number of failed tries, an
Hugo Arès7eeb21e2017-03-02 22:48:15 -0500155 error is logged.
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -0400156
Luca Milanesio22ffb222018-02-21 10:28:30 -0800157```http.retryInterval```
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -0400158: The interval of time in milliseconds between the subsequent auto-retries.
Hugo Arès895722e2018-04-17 16:09:17 +0200159 When not specified, the default value is set to 10000ms.
160
161NOTE: the default settings for `http.timeout` and `http.maxTries` ensure that
162the plugin will keep retrying to forward a message for one hour.
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -0400163
Luca Milanesio22ffb222018-02-21 10:28:30 -0800164```cache.synchronize```
Owen Li66823002017-05-31 15:44:11 -0400165: Whether to synchronize cache evictions.
166 Defaults to true.
167
Luca Milanesio22ffb222018-02-21 10:28:30 -0800168```cache.threadPoolSize```
Hugo Arèsa897ed82017-05-31 11:47:03 -0400169: Maximum number of threads used to send cache evictions to the target instance.
Hugo Arès02843f62018-04-20 08:57:25 +0200170 Defaults to 4.
Hugo Arèsa897ed82017-05-31 11:47:03 -0400171
Luca Milanesio22ffb222018-02-21 10:28:30 -0800172```cache.pattern```
David Pursehouseaffefd92017-08-03 17:18:30 +0200173: Pattern to match names of custom caches for which evictions should be
174 forwarded (in addition to the core caches that are always forwarded). May be
175 specified more than once to add multiple patterns.
176 Defaults to an empty list, meaning only evictions of the core caches are
177 forwarded.
178
Luca Milanesio22ffb222018-02-21 10:28:30 -0800179```event.synchronize```
Owen Li66823002017-05-31 15:44:11 -0400180: Whether to synchronize stream events.
181 Defaults to true.
182
Luca Milanesiof51d7be2018-12-15 00:54:03 +0000183```index.numStripedLocks```
184: Number of striped locks to use for during secondary indexes reindex.
185 Defaults to 10
186
Luca Milanesio22ffb222018-02-21 10:28:30 -0800187```index.synchronize```
Owen Li66823002017-05-31 15:44:11 -0400188: Whether to synchronize secondary indexes.
189 Defaults to true.
190
Luca Milanesio22ffb222018-02-21 10:28:30 -0800191```index.threadPoolSize```
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -0400192: Maximum number of threads used to send index events to the target instance.
Hugo Arès02843f62018-04-20 08:57:25 +0200193 Defaults to 4.
Hugo Arès7eeb21e2017-03-02 22:48:15 -0500194
Luca Milanesio22ffb222018-02-21 10:28:30 -0800195```websession.synchronize```
Owen Li66823002017-05-31 15:44:11 -0400196: Whether to synchronize web sessions.
197 Defaults to true.
198
Luca Milanesio22ffb222018-02-21 10:28:30 -0800199```websession.cleanupInterval```
Hugo Arèsa897ed82017-05-31 11:47:03 -0400200: Frequency for deleting expired web sessions. Values should use common time
201 unit suffixes to express their setting:
202* s, sec, second, seconds
203* m, min, minute, minutes
204* h, hr, hour, hours
205* d, day, days
206* w, week, weeks (`1 week` is treated as `7 days`)
207* mon, month, months (`1 month` is treated as `30 days`)
208* y, year, years (`1 year` is treated as `365 days`)
209If a time unit suffix is not specified, `hours` is assumed.
Saša Živkovc44904b2017-06-19 15:49:19 +0200210Defaults to 24 hours.
David Pursehouse39033542017-11-30 17:02:24 +0900211
Luca Milanesio22ffb222018-02-21 10:28:30 -0800212```healthcheck.enable```
David Pursehouse39033542017-11-30 17:02:24 +0900213: Whether to enable the health check endpoint. Defaults to 'true'.