Configuring a Jira cluster in AMPS involves three main steps:
Whereas non-Data Center products can run with an embedded H2 or HSQL database, Data Center products require an external database to which all nodes connect. As an AMPS or SDK user, it is up to you to provision that database. See Setting up an external database for more details.
To explain how to configure the home directory for clustered mode, we first need to review how the home directory works in non-clustered mode.
In non-clustered mode, each product by default uses a pre-prepared home directory in which the configuration files
specify an embedded H2 or HSQL database. These home directories are shipped as Maven artifacts, with the same version as
the product release to which they relate. For example, when running Confluence 7.12.3, AMPS uses version 7.12.3 of
the Maven artifact com.atlassian.confluence.plugins:confluence-plugin-test-resources:zip
. If we unzip this artifact,
we see that it’s a Confluence home directory:
1 2. └── confluence-home ├── attachments ├── confluence.cfg.xml ├── database ├── index └── synchrony-args.properties
If we then open the main configuration file confluence.cfg.xml
, we see that Confluence is configured to use an H2
database:
1 2<?xml version="1.0" encoding="UTF-8"?> <confluence-configuration> <setupStep>complete</setupStep> <setupType>install</setupType> <buildNumber>8703</buildNumber> <properties> <property name="hibernate.connection.driver_class">org.h2.Driver</property> <property name="hibernate.connection.isolation">2</property> <property name="hibernate.connection.password"></property> <property name="hibernate.connection.username">sa</property> <property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.H2V4200Dialect</property> ... </properties> </confluence-configuration>
Because this H2 database runs in the same JVM as Confluence, it’s unsuitable for clustered mode.
In clustered mode, the product requires an external database. You achieve this by providing your own home
ZIP (instead of the default one described above), in which the database configuration file (in this example,
confluence.cfg.xml
) contains the details of that external database:
1 2<?xml version="1.0" encoding="UTF-8"?> <confluence-configuration> <setupStep>complete</setupStep> <setupType>cluster</setupType> <buildNumber>8703</buildNumber> <properties> <property name="hibernate.connection.driver_class">org.postgresql.Driver</property> <property name="hibernate.connection.password">theProductPassword</property> <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/confdb</property> <property name="hibernate.connection.username">theProductUser</property> <property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.PostgreSQLDialect</property> <property name="hibernate.setup">true</property> ... </properties> </confluence-configuration>
The easiest and most reliable way to generate such a home ZIP (for any product) is as follows:
target/home
directory.home
directoryhome/confluence.cfg.xml
home/crowd.cfg.xml
home/dbconfig.xml
atlas-run
, mvn amps:run
, or mvn jira:run
. For Bitbucket, run
mvn amps:run -Datlassian.dev.mode=false
to prevent skipping the setup.clean
it.atlas-create-home-zip
command, ormvn <product>:create-home-zip
or mvn amps:create-home-zip
, depending on which AMPS
plugin is configured in your POM.Once you have your home ZIP:
Move the home ZIP to the version-controlled part of your plugin project; a separate directory in the root called
home-zips
is a good place, as it avoids the home ZIP being bundled into either your production plugin or your test
plugin, if you have one.
Rename the home ZIP from generated-test-resources.zip
to something more descriptive, such as postgres-home.zip
.
Configure AMPS to load your custom home ZIP instead of the default one, by setting <productDataPath>
, either
globally, as below, or within the relevant <product>
element:
1 2<configuration> <productDataPath>${basedir}/home-zips/postgres-home.zip</productDataPath> ...
To configure your POM, you must do the following:
You configure the nodes by adding them to your AMPS configuration. See Configuring the nodes for more details.
Licenses work differently in Jira than in other products, because Jira has the concept of applications. Jira supports the following applications:
All of these applications can be licensed via a single license.
Licensing an application is not the same as installing an application; either can be done without the other. To install an application via AMPS, see Configure AMPS to run JIRA Core with additional applications installed.
To run in a cluster, Atlassian products require a Data Center license. If the default license provided by AMPS is not a Data Center license, or does not suit your purposes for some other reason, AMPS 8.2 and later allows you to replace the default license with one you provide, such as one obtained from My Atlassian or developer.atlassian.com.
To do this, add the desired license to your AMPS configuration, either at the global level, the <product>
level, or both:
Global level
1 2<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>amps-maven-plugin</artifactId> <version>8.3.0</version> <extensions>true</extensions> <configuration> <productLicense> loremipsumdolorsitametconsecteturadipiscingelitseddoeius modtemporincididuntutlaboreetdoloremagnaaliquautenimadmi nimveniamquisnostrudexercitationullamcolaborisnisiutaliq uipexeacommodoconsequatduisauteiruredolorinreprehenderit </productLicense> ... </configuration>
Product level
1 2<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>amps-maven-plugin</artifactId> <version>8.3.0</version> <extensions>true</extensions> <configuration> <products> <product> <license> loremipsumdolorsitametconsecteturadipiscingelitseddoeius modtemporincididuntutlaboreetdoloremagnaaliquautenimadmi nimveniamquisnostrudexercitationullamcolaborisnisiutaliq uipexeacommodoconsequatduisauteiruredolorinreprehenderit </license> ... </product> </products> ... </configuration>
Whitespace characters are allowed in the license; the product ignores such characters at runtime.
If you intend to commit a license to version control, it’s best to use a non-perpetual “timebombed” license. That is, one that expires a certain number of hours or days after the product starts up.
AMPS will create the required cluster.properties
file in each node’s home directory, with the following properties:
Property | Value |
---|---|
jira.node.id | node0 , node1 , etc. |
jira.shared.home | The shared home directory, see below. |
ehcache.listener.port | A random free port |
ehcache.object.port | A random free port |
target/jira/home
, as for single-node operation.target/jira/home-n
, where n
is 1
, etc.<product>
contains a <sharedHome>
, AMPS uses that, otherwisetarget/jira/shared-home
as the shared home directory.Rate this page: