Post-Deployment Configuration
After installing Informat, you may need to adjust some parameters for Informat, such as adjusting thread pool size based on load and modifying maximum upload file size. This chapter introduces you to the directory structure of Informat after installation and the structure of configuration files.
Informat Deployment Directory Structure
│─informat-next
├─informat Control program
├─jdk JDK
└─instance Instance folder
│ └─informat-account Account instance
│ └─application.yml Instance configuration file
│ └─logback-spring.xml Instance log configuration file
│ └─informat-account-1.0.0.jar Instance running jar package
│ └─env.properties Environment variable configuration
│ └─pid Program PID after running
│ └─informat-biz Biz instance
│ └─application.yml Instance configuration file
│ └─logback-spring.xml Instance log configuration file
│ └─informat-biz-1.0.0.jar Instance running jar package
│ └─env.properties Environment variable configuration
│ └─pid Program PID after running
└─log Log storage directory
│ └─informat-xxx.log Instance logsStartup Parameter Configuration File
The startup configuration file application.yml is used to configure and customize application behavior. It provides a simple way to manage application properties and settings without writing additional code.
Application Configuration
| Configuration Item | Description |
|---|---|
| app.version | Application version number. |
| server.port | Application server port number. |
| server.tomcat.max-http-post-size | Maximum HTTP POST request size allowed by Tomcat. Set to -1 for no limit. |
| logging.config | Specifies the location of the log configuration file. |
Spring Application Configuration
| Configuration Item | Description |
|---|---|
| spring.application.name | Application name. |
| spring.application.serverId | Application server ID. Ensure uniqueness when deploying multiple instances. |
| spring.application.serverIp | Application deployment server IP. Ensure no duplicates when deploying across multiple servers. Example: 192.168.10.53 |
| spring.application.clusterName | Cluster name to which the application belongs. |
| spring.application.accountClusterName | Account cluster name. |
| spring.application.intranetUrl | Internal URL address to access Account service. |
| spring.application.asyncTaskCorePoolSize | Core thread count of the asynchronous scheduled task thread pool. |
| spring.application.asyncTaskMaximumPoolSize | Maximum thread count of the asynchronous scheduled task thread pool. |
| spring.application.asyncTaskQueueCapacity | Maximum capacity of the work queue in the asynchronous scheduled task thread pool. When tasks are submitted to the thread pool, if the work queue is full, an exception log will be thrown and the task will be rejected. |
| spring.application.asyncSystemTaskCorePoolSize | Core thread count of the asynchronous system task thread pool. |
| spring.application.asyncSystemTaskMaximumPoolSize | Maximum thread count of the asynchronous system task thread pool. |
| spring.application.asyncSystemTaskQueueCapacity | Maximum capacity of the work queue in the asynchronous system task thread pool. |
| spring.application.disableMonitor | Whether to disable monitoring. |
| spring.main.allow-bean-definition-overriding | Whether to allow bean definition overriding. |
| spring.main.allow-circular-references | Whether to allow circular references. |
| spring.main.register-shutdown-hook | Whether to register a hook for JVM shutdown. |
| spring.application.enableScriptCache | Whether to support script caching. |
| spring.application.scriptCacheCapacity | Maximum capacity of script cache. |
| spring.application.enableTableOptionListCache | Whether to cache data dictionaries. |
| spring.application.departmentCacheType | Organization structure cache type, redis, local. |
TIP
If any of asyncTaskCorePoolSize, asyncTaskMaximumPoolSize, or asyncTaskQueueCapacity is less than or equal to 0, asynchronous tasks will not be enabled. (These three settings are only valid for the informat-biz system and are used for scheduled tasks in applications and internal asynchronous tasks in the system.)
Servlet Configuration
| Configuration Item | Description |
|---|---|
| spring.servlet.multipart.max-file-size | Maximum size limit for uploaded files. |
| spring.servlet.multipart.max-request-size | Maximum size limit for requests. |
| spring.servlet.multipart.enabled | Whether to enable file upload functionality. |
Thymeleaf Template Engine Configuration
| Configuration Item | Description |
|---|---|
| spring.thymeleaf.cache | Whether to enable Thymeleaf template caching. |
| spring.thymeleaf.prefix | Prefix path for Thymeleaf template files. |
Data Source Configuration
| Configuration Item | Description |
|---|---|
| spring.datasource.druid.url | Database connection URL. |
| spring.datasource.druid.type | Data source type. |
| spring.datasource.druid.driver-class-name | Database driver class name. |
| spring.datasource.druid.initial-size | Specifies the initial connection pool size. |
| spring.datasource.druid.max-active | Specifies the maximum number of active connections in the connection pool. |
| spring.datasource.druid.min-idle | Specifies the minimum number of idle connections in the connection pool. |
| spring.datasource.druid.max-wait | Specifies the maximum wait time to obtain a connection (in milliseconds). |
| spring.datasource.druid.pool-prepared-statements | Whether to enable the prepared statement pool. |
| spring.datasource.druid.max-pool-prepared-statement-per-connection-size | Specifies the maximum number of prepared statements per connection. |
| spring.datasource.druid.time-between-eviction-runs-millis | Specifies the time interval between idle connection recycling (in milliseconds). |
| spring.datasource.druid.min-evictable-idle-time-millis | Specifies the minimum idle time of a connection in the connection pool (in milliseconds). |
| spring.datasource.druid.test-while-idle | Whether to validate connection validity when idle. |
| spring.datasource.druid.test-on-borrow | Whether to validate connection validity when borrowing from the connection pool. |
| spring.datasource.druid.test-on-return | Whether to validate connection validity when returning to the connection pool. |
| spring.datasource.druid.validation-query | Specifies the query statement used to validate connections. |
| spring.datasource.druid.filters | Specifies filters in the Druid connection pool (only using statistical filter). |
| spring.datasource.druid.stat-view-servlet.enabled | Whether to enable the Servlet for viewing Druid statistics. |
| spring.datasource.druid.stat-view-servlet.allow | Specifies IP addresses allowed to access Druid statistics (empty means allow all IPs). |
| spring.datasource.druid.stat-view-servlet.url-pattern | Specifies the URL pattern for the Druid statistics view Servlet. |
| spring.datasource.druid.stat-view-servlet.login-username | Specifies the login username for the Druid statistics view Servlet. |
| spring.datasource.druid.stat-view-servlet.login-password | Specifies the login password for the Druid statistics view Servlet. |
| spring.datasource.druid.filter.stat.log-slow-sql | Whether to enable slow query logging. |
| spring.datasource.druid.filter.stat.slow-sql-millis | Defines the threshold for slow queries (in milliseconds). |
| spring.datasource.druid.filter.stat.merge-sql | Whether to enable SQL merging. |
| spring.datasource.druid.filter.wall.config.multi-statement-allow | Whether to allow execution of multiple SQL statements. |
| spring.datasource.druid.web-stat-filter.enabled | Whether to enable Druid's Web statistics filter. |
| spring.datasource.druid.web-stat-filter.url-pattern | Specifies the URL pattern for the Web statistics filter. |
| spring.datasource.druid.web-stat-filter.exclusions | Specifies URL patterns to exclude from statistics. |
| spring.datasource.druid.web-stat-filter.session-stat-enable | Whether to enable Session statistics. |
| spring.datasource.druid.web-stat-filter.session-stat-max-count | Specifies the maximum number of Session statistics to save. |
Redis Configuration
| Configuration Item | Description |
|---|---|
| spring.redis.database | Redis database index. |
| spring.redis.host | Redis server host. |
| spring.redis.port | Redis server port. |
| spring.redis.password | Redis password. |
| spring.redis.timeout | Connection timeout with Redis server (in milliseconds). |
| spring.redis.lettuce.pool.max-active | Maximum number of active connections in Lettuce connection pool. |
| spring.redis.lettuce.pool.max-wait | Maximum wait time to obtain a connection from Lettuce connection pool (-1 means infinite wait). |
| spring.redis.lettuce.pool.max-idle | Maximum number of idle connections in Lettuce connection pool. |
| spring.redis.lettuce.pool.min-idle | Minimum number of idle connections in Lettuce connection pool. |
RabbitMQ Configuration
| Configuration Item | Description |
|---|---|
| spring.rabbitmq.port | RabbitMQ server port. |
| spring.rabbitmq.host | RabbitMQ server hostname. |
| spring.rabbitmq.nickname | RabbitMQ nickname. |
| spring.rabbitmq.username | RabbitMQ username. |
| spring.rabbitmq.password | RabbitMQ password. |
| spring.rabbitmq.publisher-confirm-type | RabbitMQ publisher confirmation type. |
| spring.rabbitmq.publisher-returns | Whether to enable RabbitMQ publisher returns. |
| spring.rabbitmq.virtual-host | RabbitMQ virtual host. |
| spring.rabbitmq.listener.simple.acknowledge-mode | RabbitMQ listener acknowledgment mode. |
| spring.rabbitmq.listener.template.mandatory | Whether the RabbitMQ template should require a mandatory route match during message sending. |
Elasticsearch Configuration
| Configuration Item | Description |
|---|---|
| spring.elasticsearch.cluster-name | Elasticsearch cluster name. |
| spring.elasticsearch.cluster-nodes | Elasticsearch cluster node addresses. |
TIP
Elasticsearch configuration is only valid for the informat-biz system and is used for the search engine module.
Mail Server Configuration
| Configuration Item | Description |
|---|---|
spring.mail.host | Hostname or IP address of the SMTP server. |
spring.mail.port | Port number of the SMTP server. |
spring.mail.username | Username for SMTP server authentication. |
spring.mail.password | Password for SMTP server authentication. |
spring.mail.protocol | Mail transfer protocol, usually "smtp" or "smtps". |
spring.mail.default-encoding | Default character encoding for email message text. |
spring.mail.properties.mail.smtp.auth | Specifies whether authentication is required, usually set to "true". |
spring.mail.properties.mail.smtp.starttls.enable | Enable or disable STARTTLS support, usually set to "true". |
spring.mail.properties.mail.smtp.starttls.required | Specifies whether STARTTLS is required, usually set to "true". |
spring.mail.properties.mail.smtp.ssl.enable | Enable or disable SSL support, usually set to "true". |
spring.mail.properties.mail.smtp.ssl.trust | Hostname of trusted SSL certificates. |
spring.mail.properties.mail.smtp.ssl.socketFactory.class | SocketFactory class used when configuring SSL/TLS connections for SMTP server. |
spring.mail.properties.mail.smtp.ssl.socketFactory.fallback | Configures the fallback behavior of the SSL/TLS SocketFactory. |
spring.mail.properties.mail.debug | Enable or disable debug mode, usually set to "true" to view detailed logs in the console. |
spring.mail.default-headers.from | Default sender address for email messages. |
spring.mail.default-headers.reply-to | Default reply address for email messages. |
spring.mail.default-headers.to | Default recipient address for email messages. |
spring.mail.default-headers.cc | Default CC address for email messages. |
Log Configuration File
The log configuration file logback-spring.xml allows developers to define log output formats, log levels, log output destinations (such as files, console, etc.), and log rolling strategies. Through this file, you can flexibly manage and control the application's logging behavior, ensuring the effectiveness and readability of log information, which is helpful for troubleshooting and performance monitoring.
How to Modify Log Level?
The default log level is INFO
- Modifying log level
Find the root tag and modify the level
<root level="INFO">
<appender-ref ref="file" />
</root>TIP
Logback log levels are available in the following order from highest to lowest:
- ERROR: Used to record error events that may cause some functions of the program to not work properly.
- WARN: Used to record warning information that indicates potential problems but does not immediately affect program operation.
- INFO: Used to record general information such as program running status and key steps.
- DEBUG: Used to record debugging information, which is mainly used during development and debugging phases to help developers understand the program's internal state.
- TRACE: Used to record more granular debugging information than DEBUG level, usually used to trace program execution flow.
Restarting Informat Services
systemctl restart informat-account
systemctl restart informat-bizViewing Informat Service Logs
less -R /informat-next/log/informat-account.log
less -R /informat-next/log/informat-biz.logInstallation Paths and Configurations of Other Informat Components
Message Queue: rabbitmq
- Installation directory:
/usr/lib/rabbitmq - Configuration file:
/etc/rabbitmq/rabbitmq.conf
TIP
RabbitMQ may not have a default main configuration file /etc/rabbitmq/rabbitmq.conf installed because it is not required during installation. However, you can manually create this file for custom configuration. You can create the /etc/rabbitmq/rabbitmq.conf file following these steps:
redis
- Installation directory:
/usr/local/redis - Configuration file:
/usr/local/redis/bin/redis.conf - Log file:
/var/log/redis/redis.log
Database
- Installation directory:
/usr/pgsql-13 - Configuration file:
data/pgsql/data/postgresql.conf - Log file:
/data/pgsql/data/log/
Example: Scheduled Backup
You can use Linux Cron expressions to implement scheduled database backup functionality Backup the database every day at 2 AM
0 2 * * * /informat-next/backup_database.shThe backup_database.sh script is as follows
#!/bin/bash
current=`date "+%Y%m%d%H%M%S"`
bake=backup_db/$current
mkdir -p $bake
export PGPASSWORD="{database password}"
pg_dump -h 127.0.0.1 -O -p 5432 -U postgres -d db_informat2_account_prd > $bake/db_informat2_account_prd.sql
pg_dump -h 127.0.0.1 -O -p 5432 -U postgres -d db_informat2_biz_prd_0 > $bake/db_informat2_biz_prd_0.sqlnginx
- Installation directory:
/usr/sbin/nginx - Configuration file:
/etc/nginx/nginx.conf - Log file:
/var/log/nginx/
TIP
If you need to modify Nginx's default configuration, you can edit the /etc/nginx/nginx.conf and /etc/nginx/conf.d/*.conf files. After editing, restart Nginx using the systemctl restart nginx command for the configuration to take effect.
Configuring HTTPS
TIP
Replace parameters like {account_servers} with actual service parameters
upstream backend_account {
{account_servers}
}
upstream backend_biz_s0 {
{biz_servers}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {server_name};
client_max_body_size 2000M;
ssl_certificate {certificate_path}/informat2.pem;
ssl_certificate_key {certificate_key_path}/informat2.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
proxy_connect_timeout 1m;
proxy_send_timeout 30m;
proxy_read_timeout 30m;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Server $host;
add_header 'Access-Control-Allow-Origin' * always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET,POST,DELETE,PUT,HEAD,OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,token,Authorization,Accept,Origin,Keep-Alive,User-Agent,X-Mx-ReqToken,X-Data-Type,X-Auth-Token,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Set-Cookie,Content-Disposition,Content-Range,RequestId,Date' always;
location / {
proxy_pass http://backend_account$request_uri;
access_log /var/log/nginx/informat_next_account_access_web.log;
}
location ^~ /web0/ {
access_log /var/log/nginx/informat_next_biz_api_web.log;
if ($request_method = 'OPTIONS') {
return 204;
}
proxy_pass http://backend_biz_s0/web/;
}
location ^~ /account/ {
access_log /var/log/nginx/informat_next_account_api_web.log;
if ($request_method = 'OPTIONS') {
return 204;
}
proxy_pass http://backend_account$request_uri;
}
}
server {
listen {intranet_port};
server_name localhost;
proxy_connect_timeout 1m;
proxy_send_timeout 30m;
proxy_read_timeout 30m;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Server $host;
add_header 'Access-Control-Allow-Origin' * always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET,POST,DELETE,PUT,HEAD,OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,token,Authorization,Accept,Origin,Keep-Alive,User-Agent,X-Mx-ReqToken,X-Data-Type,X-Auth-Token,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Set-Cookie,Content-Disposition,Content-Range,RequestId,Date' always;
location / {
proxy_pass http://backend_account$request_uri;
access_log /var/log/nginx/informat_next_account_access_web.log;
}
location ^~ /web0/ {
access_log /var/log/nginx/informat_next_biz_api_web.log;
if ($request_method = 'OPTIONS') {
return 204;
}
proxy_pass http://backend_biz_s0/web/;
}
location ^~ /account/ {
access_log /var/log/nginx/informat_next_account_api_web.log;
if ($request_method = 'OPTIONS') {
return 204;
}
proxy_pass http://backend_account$request_uri;
}
}
server {
listen 80;
server_name {server_name};
rewrite ^(.*)$ https://$host$1 permanent;
}minio
- Installation directory:
/data/minio_home/ - Configuration file:
/data/minio_home/minio.conf
Elasticsearch
- Installation directory:
/data/elasticsearch-{version}/ - Configuration file:
/data/elasticsearch-{version}/config/*.yml
onlyoffice
- Installation directory:
/var/www/onlyoffice/DocumentServer - Configuration file:
/etc/onlyoffice/documentserver/default.json

