Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 1 | @PLUGIN@ Configuration |
| 2 | ========================= |
| 3 | |
David Pursehouse | 9a778a5 | 2017-06-30 10:00:56 +0900 | [diff] [blame] | 4 | The @PLUGIN@ plugin must be installed on both instances and the following fields |
Hugo Arès | a897ed8 | 2017-05-31 11:47:03 -0400 | [diff] [blame] | 5 | should be specified in `$site_path/etc/@PLUGIN@.config` file: |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 6 | |
Hugo Arès | a897ed8 | 2017-05-31 11:47:03 -0400 | [diff] [blame] | 7 | File '@PLUGIN@.config' |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 8 | -------------------- |
| 9 | |
Luca Milanesio | 716282b | 2018-02-19 15:18:36 -0800 | [diff] [blame] | 10 | ### Static definition of the high-availability nodes. |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 11 | |
Luca Milanesio | 716282b | 2018-02-19 15:18:36 -0800 | [diff] [blame] | 12 | ``` |
Christian Halstrick | 75b5432 | 2017-05-04 16:45:19 +0200 | [diff] [blame] | 13 | [main] |
Luca Milanesio | 716282b | 2018-02-19 15:18:36 -0800 | [diff] [blame] | 14 | sharedDirectory = /directory/accessible/from/both/instances |
Luca Milanesio | acb6787 | 2018-02-20 15:59:34 -0800 | [diff] [blame] | 15 | [autoReindex] |
| 16 | enabled = false |
Christian Halstrick | 75b5432 | 2017-05-04 16:45:19 +0200 | [diff] [blame] | 17 | [peerInfo] |
Luca Milanesio | 716282b | 2018-02-19 15:18:36 -0800 | [diff] [blame] | 18 | strategy = static |
| 19 | [peerInfo "static"] |
| 20 | url = target_instance_url |
Christian Halstrick | 75b5432 | 2017-05-04 16:45:19 +0200 | [diff] [blame] | 21 | [http] |
Luca Milanesio | 716282b | 2018-02-19 15:18:36 -0800 | [diff] [blame] | 22 | 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 Milanesio | acb6787 | 2018-02-20 15:59:34 -0800 | [diff] [blame] | 31 | [autoReindex] |
| 32 | enabled = false |
Luca Milanesio | 716282b | 2018-02-19 15:18:36 -0800 | [diff] [blame] | 33 | [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 Pursehouse | 3903354 | 2017-11-30 17:02:24 +0900 | [diff] [blame] | 45 | [healthcheck] |
Luca Milanesio | 716282b | 2018-02-19 15:18:36 -0800 | [diff] [blame] | 46 | enable = true |
| 47 | ``` |
Christian Halstrick | 75b5432 | 2017-05-04 16:45:19 +0200 | [diff] [blame] | 48 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 49 | ```main.sharedDirectory``` |
Hugo Arès | a897ed8 | 2017-05-31 11:47:03 -0400 | [diff] [blame] | 50 | : Path to a directory accessible from both master instances. |
Saša Živkov | c44904b | 2017-06-19 15:49:19 +0200 | [diff] [blame] | 51 | 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 Živkov | 31304ac | 2017-05-18 17:14:09 +0200 | [diff] [blame] | 54 | directory is "/gerrit/root/shared/dir". When not specified, the default |
| 55 | is "shared". |
Hugo Arès | a897ed8 | 2017-05-31 11:47:03 -0400 | [diff] [blame] | 56 | |
Luca Milanesio | acb6787 | 2018-02-20 15:59:34 -0800 | [diff] [blame] | 57 | ```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 Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 83 | ```peerInfo.strategy``` |
Christian Halstrick | 75b5432 | 2017-05-04 16:45:19 +0200 | [diff] [blame] | 84 | : 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 |
| 87 | the configuration parameter `peerInfo.static.url`. |
| 88 | * The `jgroups` strategy allows that a gerrit instance discovers the peer |
| 89 | instance by using JGroups to send multicast messages. In this case the |
| 90 | configuration parameters `peerInfo.jgroups.*` are used to control the sending of |
| 91 | the multicast messages. During startup each instance will advertise its address |
| 92 | over a JGroups multicast message. JGroups takes care to inform each cluster when |
| 93 | a member joins or leaves the cluster. |
| 94 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 95 | ```peerInfo.static.url``` |
David Pursehouse | 9a778a5 | 2017-06-30 10:00:56 +0900 | [diff] [blame] | 96 | : Specify the URL for the peer instance. |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 97 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 98 | ```peerInfo.jgroups.myUrl``` |
David Pursehouse | f5352eb | 2017-09-08 09:54:10 +0900 | [diff] [blame] | 99 | : 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 Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 106 | ```jgroups.clusterName``` |
Saša Živkov | 1bf2d74 | 2017-09-26 11:40:30 +0200 | [diff] [blame] | 107 | : 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 Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 112 | ```jgroups.skipInterface``` |
Saša Živkov | 1bf2d74 | 2017-09-26 11:40:30 +0200 | [diff] [blame] | 113 | : 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 Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 120 | ```jgroups.protocolStack``` |
Eryk Szymanski | f93acd4 | 2017-12-14 00:09:32 +0100 | [diff] [blame] | 121 | : 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 Halstrick | 75b5432 | 2017-05-04 16:45:19 +0200 | [diff] [blame] | 128 | NOTE: To work properly in certain environments, JGroups needs the System property |
| 129 | `java.net.preferIPv4Stack` to be set to `true`. |
Eryk Szymanski | f93acd4 | 2017-12-14 00:09:32 +0100 | [diff] [blame] | 130 | See [JGroups - Trouble shooting](http://jgroups.org/tutorial/index.html#_trouble_shooting). |
Christian Halstrick | 75b5432 | 2017-05-04 16:45:19 +0200 | [diff] [blame] | 131 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 132 | ```http.user``` |
David Pursehouse | 9a778a5 | 2017-06-30 10:00:56 +0900 | [diff] [blame] | 133 | : Username to connect to the peer instance. |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 134 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 135 | ```http.password``` |
David Pursehouse | 9a778a5 | 2017-06-30 10:00:56 +0900 | [diff] [blame] | 136 | : Password to connect to the peer instance. |
Hugo Arès | 4bde025 | 2017-03-10 14:45:15 -0500 | [diff] [blame] | 137 | |
Hugo Arès | 7eeb21e | 2017-03-02 22:48:15 -0500 | [diff] [blame] | 138 | @PLUGIN@ plugin uses REST API calls to keep the target instance in-sync. It |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 139 | is possible to customize the parameters of the underlying http client doing these |
| 140 | calls by specifying the following fields: |
| 141 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 142 | ```http.connectionTimeout``` |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 143 | : 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 Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 146 | ```http.socketTimeout``` |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 147 | : 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 Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 151 | ```http.maxTries``` |
Hugo Arès | 7eeb21e | 2017-03-02 22:48:15 -0500 | [diff] [blame] | 152 | : 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ès | 895722e | 2018-04-17 16:09:17 +0200 | [diff] [blame] | 154 | specified, the default value is 360. After this number of failed tries, an |
Hugo Arès | 7eeb21e | 2017-03-02 22:48:15 -0500 | [diff] [blame] | 155 | error is logged. |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 156 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 157 | ```http.retryInterval``` |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 158 | : The interval of time in milliseconds between the subsequent auto-retries. |
Hugo Arès | 895722e | 2018-04-17 16:09:17 +0200 | [diff] [blame] | 159 | When not specified, the default value is set to 10000ms. |
| 160 | |
| 161 | NOTE: the default settings for `http.timeout` and `http.maxTries` ensure that |
| 162 | the plugin will keep retrying to forward a message for one hour. |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 163 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 164 | ```cache.synchronize``` |
Owen Li | 6682300 | 2017-05-31 15:44:11 -0400 | [diff] [blame] | 165 | : Whether to synchronize cache evictions. |
| 166 | Defaults to true. |
| 167 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 168 | ```cache.threadPoolSize``` |
Hugo Arès | a897ed8 | 2017-05-31 11:47:03 -0400 | [diff] [blame] | 169 | : Maximum number of threads used to send cache evictions to the target instance. |
Hugo Arès | 02843f6 | 2018-04-20 08:57:25 +0200 | [diff] [blame] | 170 | Defaults to 4. |
Hugo Arès | a897ed8 | 2017-05-31 11:47:03 -0400 | [diff] [blame] | 171 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 172 | ```cache.pattern``` |
David Pursehouse | affefd9 | 2017-08-03 17:18:30 +0200 | [diff] [blame] | 173 | : 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 Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 179 | ```event.synchronize``` |
Owen Li | 6682300 | 2017-05-31 15:44:11 -0400 | [diff] [blame] | 180 | : Whether to synchronize stream events. |
| 181 | Defaults to true. |
| 182 | |
Luca Milanesio | f51d7be | 2018-12-15 00:54:03 +0000 | [diff] [blame^] | 183 | ```index.numStripedLocks``` |
| 184 | : Number of striped locks to use for during secondary indexes reindex. |
| 185 | Defaults to 10 |
| 186 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 187 | ```index.synchronize``` |
Owen Li | 6682300 | 2017-05-31 15:44:11 -0400 | [diff] [blame] | 188 | : Whether to synchronize secondary indexes. |
| 189 | Defaults to true. |
| 190 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 191 | ```index.threadPoolSize``` |
Hector Oswaldo Caballero | 74a07ab | 2015-08-10 17:00:43 -0400 | [diff] [blame] | 192 | : Maximum number of threads used to send index events to the target instance. |
Hugo Arès | 02843f6 | 2018-04-20 08:57:25 +0200 | [diff] [blame] | 193 | Defaults to 4. |
Hugo Arès | 7eeb21e | 2017-03-02 22:48:15 -0500 | [diff] [blame] | 194 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 195 | ```websession.synchronize``` |
Owen Li | 6682300 | 2017-05-31 15:44:11 -0400 | [diff] [blame] | 196 | : Whether to synchronize web sessions. |
| 197 | Defaults to true. |
| 198 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 199 | ```websession.cleanupInterval``` |
Hugo Arès | a897ed8 | 2017-05-31 11:47:03 -0400 | [diff] [blame] | 200 | : 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`) |
| 209 | If a time unit suffix is not specified, `hours` is assumed. |
Saša Živkov | c44904b | 2017-06-19 15:49:19 +0200 | [diff] [blame] | 210 | Defaults to 24 hours. |
David Pursehouse | 3903354 | 2017-11-30 17:02:24 +0900 | [diff] [blame] | 211 | |
Luca Milanesio | 22ffb22 | 2018-02-21 10:28:30 -0800 | [diff] [blame] | 212 | ```healthcheck.enable``` |
David Pursehouse | 3903354 | 2017-11-30 17:02:24 +0900 | [diff] [blame] | 213 | : Whether to enable the health check endpoint. Defaults to 'true'. |