PostgreSQL database configuration
|
Feedback
|
PostgreSQL is an open source object-relational database management system with cross-platform, extensible features, and supports rich data types and has multi-version control ability. The iPortal supports using PostgreSQL database to store the portal data and security information.
Install and configure the PostgreSQL database
If you've already installed the PostgreSQL database, you can directly configure the portal data storage and security information after creating the database.If you didn't install PostgreSQL yet, please refer to: PostgreSQL installation and configuration.
Note: In iPortal, portal data and security information can't be stored in the same PostgreSQL database. You need to create different databases to store them.
Portal data storage configuration
It's recommended to configure the portal data storage before iPortal is started (before creating the initial administrator account). The configuration information is in the iportal.xml configuration file in the installation directory (%SuperMap iPortal_HOME%\webapps\iportal\WEB-INF). For details, see: iPortal configuration file description. For using a PostgreSQL database, you only need to remove or delete the default SQLite database connection pool configuration information and add the PostgreSQL database connection pool configuration information. The sample configuration is as follows:
<dbType>POSTGRESQL </dbType>
<driverClass>org.postgresql.Driver</driverClass>
<jdbcUrl>jdbc:postgresql://localhost:5432/iportal?useUnicode=true&characterEncoding=UTF-8</jdbcUrl>
<maxPoolSize>30</maxPoolSize>
<initialPoolSize>5</initialPoolSize>
<minPoolSize>5</minPoolSize>
<maxIdleTime>3000</maxIdleTime>
<maxWait>300000</maxWait>
<username>postgres</username>
<password></password>
- <dbType>: Database type, characters need to be uppercase.
- <driverClass>: The full name of the database-driven class.
- <jdbcUrl>: The url used to connect the driver. If SuperMap iPortal and PostgreSQL are on the same machine, the IP is localhost. If they are not on the same machine, the IP here should be the IP of the machine where PostgreSQL is located. The default port for PostgreSQL is: 5432, which you can configure based on the actual PostgreSQL you installed. The iportal is the database name, just the same as the database name you created.
- <maxPoolSize>: The maximum number of active connections the connection pool provides at the same time.
- <initialPoolSize>: The initial size of the connection pool.
- <minPoolSize>: The minimum number of active connections the connection pool provides at the same time.
- <maxIdleTime>: Maximum idle time, the connection is discarded if not used within maxIdleTime. The default value is 0 and if maxIdleTime is 0, it will never be discarded.
- <maxWait>: The maximum number of milliseconds the database waits for, when an exception occurs (when no connection is available).
- <username>: Username of the initial administrator account for the PostgreSQL database, which you can configure based on the PostgreSQL you actually installed.
- <password>: Configure it based on the password you set when you installed PostgreSQL.
Note:
- The initial administrator account for PostgreSQL is postgres.
- PostgreSQL disables non-native access by default. However, for the case when iPortal and PostgreSQL are not on the same machine, iPortal needs to connect to PostgreSQL remotely. At this point, modify the PostgreSQL configuration file. In addition, the "localhost" in the <jdbc> node in the iportal.xml configuration file also needs to be changed to the IP address of the machine, where PostgreSQL is located.
- The above mentioned procedures and procedure to switch to the PostgreSQL database should be performed before the iPortal initialization service is started (before the administrator account is created). If you switch the database during the use of iPortal, you need to handle the synchronization of the database information.
Security information storage configuration
You can configure the iPortal security information storage after the iPortal is started. Log in to iPortal as the administrator, enter Management > Security, you can perform the security information configuration operations on the "Security Config" page. For details, see: Security information storage.