forked from IQSS/dataverse
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 7457-introduce-mpconfig
- Loading branch information
Showing
15 changed files
with
286 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
## Release Highlights | ||
|
||
### Easier Configuration of Database Connections | ||
|
||
Dataverse now being able to use up-to-date Java technologies, transforms | ||
the way how to configure the connection to your PostgreSQL database. | ||
|
||
In the past, the configuration of the connection has been quite static | ||
and not very easy to update. This has been an issue especially for cloud | ||
and container usage. | ||
|
||
Using MicroProfile Config API (#7000, #7418), you can much more easily specify configuration | ||
details. For an overview of supported options, please see the | ||
[installation guide](https://guides.dataverse.org/en/5.3/installation/config.html#jvm-options). | ||
|
||
Note that some settings have been moved from domain.xml to code such as min and max pool size. | ||
|
||
## Notes for Dataverse Installation Administrators | ||
|
||
### New JVM Options | ||
|
||
- dataverse.db.name | ||
- dataverse.db.user | ||
- dataverse.db.password | ||
- dataverse.db.host | ||
- dataverse.db.port | ||
|
||
<!-- ## Update to Payara Platform 5.2020.6 --> | ||
<!-- ... --> | ||
|
||
<!-- PLACEHOLDER REPLACEMENT TEXT FOR PAYARA UPGRADE NOTE #7417 --> | ||
🚨 THIS VERSION OF DATAVERSE **REQUIRES** UPGRADING TO PAYARA 5.2020.6. 🚨 | ||
|
||
<!-- ... --> | ||
|
||
## Upgrading from earlier releases | ||
|
||
ℹ️ You need to update the Payara Application Server before continuing here. See above. | ||
|
||
1. Undeploy the previous version. | ||
``` | ||
<payara install path>/asadmin list-applications | ||
<payara install path>/asadmin undeploy dataverse-<version> | ||
``` | ||
|
||
(where `<payara install path>` is where Payara 5 is installed, for example: `/usr/local/payara5`) | ||
|
||
2. Update your database connection before updating. | ||
|
||
Please configure your connection details, replacing all the `${DB_...}`. | ||
(If you are using a PostgreSQL server on `localhost:5432`, you can omit `dataverse.db.host` and `dataverse.db.port`.) | ||
|
||
``` | ||
<payara install path>/asadmin create-system-properties "dataverse.db.user=${DB_USER}" | ||
<payara install path>/asadmin create-system-properties "dataverse.db.host=${DB_HOST}" | ||
<payara install path>/asadmin create-system-properties "dataverse.db.port=${DB_PORT}" | ||
<payara install path>/asadmin create-system-properties "dataverse.db.name=${DB_NAME}" | ||
echo "AS_ADMIN_ALIASPASSWORD=${DB_PASS}" > /tmp/password.txt | ||
<payara install path>/asadmin create-password-alias --passwordfile /tmp/password.txt dataverse.db.password | ||
rm /tmp/password.txt | ||
``` | ||
|
||
<!-- PLACE HOLDER FOR EJB TIMER DATABASE RESET NOTE #5345 --> | ||
|
||
Now you are safe to delete the old password alias and DB pool: | ||
``` | ||
<payara install path>/asadmin delete-jdbc-connection-pool --cascade=true dvnDbPool | ||
<payara install path>/asadmin delete-password-alias db_password_alias | ||
``` | ||
|
||
3. Stop payara and remove the generated directory, start. | ||
``` | ||
service payara stop | ||
# remove the generated directory: | ||
rm -rf <payara install path>/payara/domains/domain1/generated | ||
service payara start | ||
``` | ||
|
||
3. Deploy this version. | ||
``` | ||
<payara install path>/bin/asadmin deploy dataverse-5.3.war | ||
``` | ||
|
||
4. Restart Payara | ||
``` | ||
service payara stop | ||
service payara start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Java Message System Configuration | ||
|
||
The ingest part of Dataverse uses the Java Message System to create ingest tasks in a queue. | ||
That queue had been configured from command line or domain.xml before. This has now changed to being done | ||
in code. | ||
|
||
In the unlikely case you might want to change any of these settings, feel free to change and recompile or raise an issue. | ||
See `IngestQueueProducer` for more details. | ||
|
||
If you want to clean up your existing installation, you can delete the old, unused queue like this: | ||
```shell | ||
asadmin delete-connector-connection-pool --cascade=true jms/IngestQueueConnectionFactoryPool | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/edu/harvard/iq/dataverse/ingest/IngestQueueProducer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package edu.harvard.iq.dataverse.ingest; | ||
|
||
import javax.annotation.Resource; | ||
// https://www.baeldung.com/jee-cdi-vs-ejb-singleton | ||
import javax.inject.Singleton; | ||
import javax.enterprise.inject.Produces; | ||
import javax.jms.JMSConnectionFactoryDefinition; | ||
import javax.jms.JMSDestinationDefinition; | ||
import javax.jms.Queue; | ||
import javax.jms.QueueConnectionFactory; | ||
|
||
@JMSConnectionFactoryDefinition( | ||
description = "Dataverse Ingest Queue Factory", | ||
name = "java:app/jms/factory/ingest", | ||
resourceAdapter = "jmsra", | ||
interfaceName = "javax.jms.QueueConnectionFactory", | ||
maxPoolSize = 250, | ||
minPoolSize = 1, | ||
properties = { | ||
"org.glassfish.connector-connection-pool.max-wait-time-in-millis=60000", | ||
"org.glassfish.connector-connection-pool.pool-resize-quantity=2" | ||
} | ||
) | ||
@JMSDestinationDefinition( | ||
description = "Dataverse Ingest Queue", | ||
name = "java:app/jms/queue/ingest", | ||
resourceAdapter = "jmsra", | ||
interfaceName="javax.jms.Queue", | ||
destinationName = "DataverseIngest" | ||
) | ||
@Singleton | ||
public class IngestQueueProducer { | ||
|
||
@Resource(lookup="java:app/jms/queue/ingest") | ||
Queue ingestQueue; | ||
|
||
@Resource(lookup="java:app/jms/factory/ingest") | ||
QueueConnectionFactory ingestQueueFactory; | ||
|
||
@Produces | ||
public Queue getIngestQueue() { | ||
return ingestQueue; | ||
} | ||
|
||
@Produces | ||
public QueueConnectionFactory getIngestQueueFactory() { | ||
return ingestQueueFactory; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.