Data Store
Tip
Sonatype Nexus Repository users that have migrated away from the legacy OrientDB database can determine their current database by checking the JDBC URL displayed on the Data Store configuration screen:
If the JDBC URL references H2, then you are using an H2 database.
If the JDBC URL does not reference H2, then you are using a PostgreSQL database.
Administrators using Nexus Repository will see a Data Store option in the user interface at Administration → Repository → Data Store. This screen contains information about your H2 or PostgreSQL database connection.
Configuring Database Connection
Note
If you are using a PostgreSQL database, please see PostgreSQL Configuration Options and Priority Order before making any changes via the UI.
The Data Store screen contains the following information:
JDBC URL (read-only) - URL for connecting to your database.
Username (read-only) - This will be populated for PostgreSQL only.
Schema (read-only) - This will be populated for PostgreSQL only.
Maximum Connection Pool Size (optional) - The maximum number of connections that can be created to meet client requests. For H2, this defaults to 10; for PostgreSQL, this defaults to 100.
Note
Note that, for high availability deployments, you must increase the number of connections that PostgreSQL allows so that your Maximum Connection Pool size does not exceed your the maximum number of allowed connections. See Prerequisite Step: Adjust max_connections.
Large deployments with a lot of traffic may need to increase their Maximum Connection Pool Size.
Advanced Settings (optional) - This field is used for troubleshooting and accepts JDBC parameters (e.g.,
maxLifetime=840000
). Leave this section blank unless provided specific instruction by the Sonatype Product Support Team.To set multiple advanced settings in the UI, separate each value onto a separate line:
maxLifetime=840000 maximumPoolSize=200
These values will be written to the nexus-store.properties file as advanced settings. A single value will look similar to the following:
advanced=maxLifetime\=840000
Multiple values will be delimited by "\n" as shown in the following example:
advanced=maximumPoolSize\=200\nmaxLifetime\=840000
Because Sonatype Nexus Repository honors the
maximumPoolSize
value before considering theadvanced=maximumPoolSize
value, if you've configuredmaximumPoolSize
in some other way, this value will be used instead of what you've configured under the advanced setting.
PostgreSQL Configuration Options and Priority Order
Database Connection Configuration
Note
As of release 3.53.0, you must provide database connection details through one mechanism. Changes made through environment variables and system properties are not written to the nexus-store.properties file
You can configure PostgreSQL database connection details (JDBC URL, username, password) through environment variables, system properties, or the nexus-store.properties file. See Installing Nexus Repository Pro with PostgreSQL for full details on these configuration methods.
Changes made through the Data Store UI are persisted to the nexus-store.properties file; Sonatype Nexus Repository will only use the values defined in the nexus-store.properties file if you've not used environment variables or system properties.
Sonatype Nexus Repository will use the first of the following mechanisms that it encounters and will ignore the others:
Environment variables
System Properties (through JVM arguments or in the nexus.properties file as detailed in Installing Nexus Repository Pro with PostgreSQL)
sonatype-work/nexus3/etc/fabric/nexus-store.properties
This is evaluated each time you start Sonatype Nexus Repository.
Connection Pool Size
You can only configure connection pool size through the sonatype-work/nexus3/etc/fabric/nexus-store.properties file.
This is done via two settings in the following priority order:
maximumPoolSize=N
advanced=maximumPoolSize=N
If you set maximumPoolSize
, it will take precedence over the advanced setting.