Add InstanceId configuration in gerrit.config
When Gerrit is setup in a multi-master / multi-site scenario, the serverId must be the same for all Gerrit masters. However, it may still be needed to name the different masters with a configured stable string value, so that it is possible to identify the different servers across the cluster. Introduce a new configuration setting called 'gerrit.instanceId' so that servers can be assigned with a stable-id. Example of gerrit.config: [gerrit] instanceId = foo-instance-1 The value is optional because it is redundant for single Gerrit master. The configured instanceId value is injected via the @GerritInstanceId annotation. Reference design: https://gerrit-review.googlesource.com/c/homepage/+/263710 Feature: Issue 12684 Change-Id: I9caa4e2faee4c0f8b9cdec8bc661fa0fa3299b91
This commit is contained in:
committed by
Luca Milanesio
parent
c17859c52c
commit
829be0db79
@@ -72,6 +72,7 @@ import com.google.gerrit.server.config.CanonicalWebUrlProvider;
|
||||
import com.google.gerrit.server.config.DefaultUrlFormatter;
|
||||
import com.google.gerrit.server.config.DownloadConfig;
|
||||
import com.google.gerrit.server.config.GerritGlobalModule;
|
||||
import com.google.gerrit.server.config.GerritInstanceIdModule;
|
||||
import com.google.gerrit.server.config.GerritInstanceNameModule;
|
||||
import com.google.gerrit.server.config.GerritOptions;
|
||||
import com.google.gerrit.server.config.GerritRuntime;
|
||||
@@ -446,6 +447,7 @@ public class Daemon extends SiteProgram {
|
||||
modules.add(new GpgModule(config));
|
||||
modules.add(new StartupChecks.Module());
|
||||
modules.add(new GerritInstanceNameModule());
|
||||
modules.add(new GerritInstanceIdModule());
|
||||
if (MoreObjects.firstNonNull(httpd, true)) {
|
||||
modules.add(
|
||||
new CanonicalWebUrlModule() {
|
||||
|
||||
Reference in New Issue
Block a user