i
Installation on AWS
The steps below are for installing a service on ECS or EKS within AWS services.
Service Properties
These are the properties that must be defined for the service to work correctly:
Parameter |
Value |
Description |
---|---|---|
CLIENT |
myenvironment |
Name of the environment. It is used to recover the secret. |
MODALITY |
cloud |
If a secret is used, the value cloud must be set. |
REGION_AWS |
us-east-1 |
AWS region where to search for the secret. |
INTERFACE_AWS |
10.110.*.* |
Network segment for tasks of the same Deyel service to communicate. |
TAG_KEY_AWS |
Name |
Key that allows identifying the EC2 instances within the cluster. |
TAG_VALUE_AWS |
EC2-Server1 |
Value assigned to the TAG_KEY_AWS key to locate the EC2s. |
USE_HAZELCAST |
true |
Required value. |
SQL_DRIVER |
com.mysql.jdbc.Driver |
JDBC driver used to connect to the database. |
SQL_URL |
jdbc:mysql://mydatabase.amazonaws.com:3306/myenvironment?useUnicode=true&characterEncoding=latin1 |
Connection URL to MySQL/Aurora database. |
SQL_USER |
myenvironment |
User to access the database schema (if a secret is not used). |
SQL_PASSWORD |
mykey |
Database user password (if a secret is not used). |
Log Configuration
In the property_value table of the database, configure the following properties:
Property |
Value Example |
Description |
---|---|---|
LOG_DIRECTORY |
/opt/BACKUP/logs/myenvironment |
Path where the logs generated by the application will be stored. |
LOG_DIRECTORY_DOWNLOAD |
/opt/BACKUP/logs/myenvironment |
Path to download the generated logs. |
LOG_OUTPUT |
/opt/BACKUP/logs/myenvironment |
Defines that logs will be written to a file. |
Configure logs in an EFS (Elastic File System) folder:
•On the EC2s of the cluster, define the path to the folder in EFS that will store the logs.
•In the cluster tasks, mount this folder so that the logs are saved correctly in EFS.
Configure the Target Group
Access to the service must be configured to go through the Target Group on port 8080, as shown in the image.
The attributes shown in the image must be configured.
Configure the Application Load Balancer (ALB)
Access the Load Balancer (ALB) and set the IDLE TIMEOUT parameter to 4000 seconds.
This setting is important to prevent connections from being automatically closed due to inactivity.
Configure the HTTPS Certificate
•If the certificate is public:
Use AWS Certificate Manager (ACM) to request the certificate.
Configure the certificate previously uploaded to ACM on the Application Load Balancer (ALB) to encrypt HTTPS connections.
•If the certificate is private (for restricted access):
A script is responsible for installing the certificate when the Deyel service container is started.
This script must be located in a folder mounted inside the container.
Steps to Configure the Certificate in the Container
1.Define Volumes in Docker Compose
A volume must be defined in the docker-compose.yml file where the certificate installation script is located. |
Example: |
volumes: |
- './app-logs:/opt/tomcat/webapps/ROOT/logs' |
- './app-scripts:/optaris/userScript' |
2.Location of the startup.sh script
The startup.sh script must be present in the app-scripts folder on the host server. |
This script will be executed when the container starts, before starting the Tomcat server. |
3.Contents of the startup.sh Script
The script must include the installation of the certificate in the container as follows: |
#!/bin/bash |
echo "$CERT_PATH" > /tmp/ca.crt |
$JAVA_HOME/bin/keytool -importcert -file /tmp/ca.crt -alias ca-root-banesco -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit -noprompt |
exec $TOMCAT_HOME/bin/catalina.sh run
Aurora MySQL 8 Database Configuration/Creation
When creating the database in Aurora, it must be configured so that table names are case-insensitive.
This parameter can only be set at cluster creation time.
Steps to create the Aurora database
1.Create new Parameter Groups
Create a DBClusterParameterGroup and a DBParameterGroup based on the family:
Aurora MySQL - aurora-mysql8.0
2.Modify the created DBClusterParameterGroup
Set the following values:
character_set_client: latin1
character_set_connection: latin1
character_set_database: latin1
character_set_filesystem: latin1
character_set_results: latin1
character_set_server: latin1
innodb_file_per_table: '0'
lower_case_table_names: '1'
long_query_time: '1'
slow_query_log: '1'
3.Modify the created DBParameterGroup
Set the following values:
innodb_print_all_deadlocks: '1'
log_bin_trust_function_creators: '1'
log_output: FILE
max_allowed_packet: '1073741824'
sql_mode: 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'
4.Create a new Aurora MySQL database
Use the Parameter Groups created previously.
Engine: 8.0.mysql_aurora