I. Overview
1. Version
Designer version | PostgreSQL External Database plugin version |
---|---|
10.0.12 | V1.0.0 |
2. Function introduction
After the system is configured with an external database, the stability of the system can be ensured in the case of a cluster environment or a large amount of data.
Users can configure the PostgreSQL external database in the decision-making platform by installing the "PostgreSQL External Database" plugin.
Note: If an external database is configured, please do not easily modify the username and password of the external database, otherwise the project will fail to start.
3. Precautions
If the project is configured with a virtual directory, that is, Tomcat Visit Decision-making Platform via IP, you need to modify the server configuration file before installing the plugin.
Open the %tomcat_home%\conf\server.xml file and modify reloadable=false, as shown in the figure below:
II. Database configuration
To prepare the database to which the platform data will be migrated, it is recommended that users create an empty database (please refer to section II.2 of this article for database size).
Note: Different FineReport projects cannot share the same external database, otherwise the data may be disordered.
1. Database version
The type and versions supported by the external database are shown in the following table:
Database type | JAR | Supported database version |
---|---|---|
PostgreSQL | 10.0.12 | 9.4.7、9.5.0、9.5.2、9.6.0 |
2. Hardware configuration
Configuration type | Lowest configuration | Recommended configuration |
---|---|---|
Memory | 1GB | 2GB |
CPU | 4 core | 8 core |
Internet speed | 50Mbps | 100Mbps |
Occupied space | 1GB | 2GB |
Disk read and write speed | 50MB/s | 100MB/s |
Note 1: The occupied space needs to be adjusted in conjunction with the degree of use. It can be configured according to the size of the webapps/webroot/WEB-INF/embed/finedb folder, and the future use size is estimated according to the actual size, which is increased by 1 to 2 times.
Note 2: The recommended memory is the memory reserved for the project configuration library.
Note 3: The external database should be in the same network segment as the report project to avoid problems such as network fluctuations.
III. Method 1: Configure on the platform
This method is suitable for configuring an external database for the first time after entering the decision-making platform.
1. Install the plugin
Click to download the plugin: fr-plugin-migration-pgsql-1.0.2.zip
Designer plugin installation method reference: Plugin Management
Server installation plugin method reference: Server plugin management
2. Enter the platform
The administrator logs into the decision-making platform and clicks "Manage>System>General>External Database>To be Configured", as shown in the following figure:
3. Configure the external database
Enter the corresponding information of the actual database and configure the external database. As shown below:
The description of each setting item is shown in the following table:
Setting items | Description |
---|---|
Database Type | Select postgresql |
Driver | No need to modify, it will be configured automatically |
Database Name | New Database Name in chapter II It is forbidden to share the database with other projects, and it is recommended to create a new database The database name is only allowed to contain number, letter, underscore and "." |
Username/Host/Password/Port | Fill in according to the actual situation of the database The host can only contain number, letter, underscore, "-" and "." Users need to have create, delete, alter, update, select, insert permissions |
Mode | Mode is "public" |
4. Configure successfully
After waiting for a period of time, a pop-up window will pop up to prompt: The target database has been successfully enabled, just click "OK". As shown below:
Note 1: Do not refresh the page during the migration process.
Note 2: There is no need to restart after the database configuration is successful.
IV. Method 2: Second migrate database on the platform
This method is suitable for migrating to a new database after the system has been configured with an external database.
1. Install the plugin
Click to download the plugin: fr-plugin-migration-pgsql-1.0.2.zip
Designer plugin installation method reference: Plugin Management
Server installation plugin method reference: Server plugin management
2. Enter the platform
The administrator logs into the decision-making platform and clicks "Manage>System>General>External Database>Configured", as shown in the following figure:
3. Configure the external database
Enter the corresponding information of the actual database and configure the external database. As shown below:
The description of each setting item is shown in the following table:
Setting items | Description |
---|---|
Database Type | Select postgresql |
Driver | No need to modify, it will be configured automatically |
Database Name | New Database Name in chapter II It is forbidden to share the database with other projects, and it is recommended to create a new database The database name is only allowed to contain number, letter, underscore and "." |
Username/Host/Password/Port | Fill in according to the actual situation of the database The host can only contain number, letter, underscore, "-" and "." Users need to have create, delete, alter, update, select, insert permissions |
Mode | Mode is "public" |
"Migrate data to the database you want to enable" button description:
1) Check the "Migrate data to the database you want to enable"
When the database is switched, the data of the original external database will be imported into the new database, and no historical data backup file will be generated under the project.
If platform data already exists in the new database, the original platform data will be cleared before importing the data. The prompt is shown in the figure below:
2) Uncheck "Migrate data to the database you want to enable"
If the new external database is empty, it prompts that the current data must be migrated to the target database.
If the new external database is not empty
Before migration, the configuration information of the original database will be automatically backed up, and the db.properties.bak file will be generated in the webapps\webroot\WEB-INF\config directory. As shown below:
Start the new database directly. After the migration is successful, the prompt is shown as follows:
4. Migrate successfully
After waiting for a period of time, a pop-up prompt will pop up: Successfully switched to the target database! There may be data differences between the old and new databases, which may affect the system operation, it is recommended to restart the project to ensure normal use.
After clicking "OK", restart the report project and the migration is successful. As shown below:
Note: Do not refresh the page during the migration process.
Prompt: