Difference between revisions of "System Architecture"
Jump to navigation
Jump to search
(14 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Direct Installation Architecture == | == Direct Installation Architecture == | ||
# Folder/File Structure | # Folder/File Structure | ||
− | #* Web Root Folder (e.g. /var/www/html or /usr/share/nginx/html) | + | #*[[File:Rho-ERP Web Root Structure.png|alt=Fig 1.0 Rho-ERP Web Root Structure|thumb|400x400px|Fig 1.0 Rho-ERP Web Root Structure]]'''Web Root Folder''' (e.g. /var/www/html or /usr/share/nginx/html) Fig 1.0 Rho-ERP Web Root Structure |
− | #* [[File:Database Directory Structure.png|alt=Database Directory Structure|thumb|Database Directory Structure]]Database Directory (e.g. /opt/apache/adbs) | + | #* [[File:Database Directory Structure.png|alt=Fig1.1 Database Directory Structure|thumb|Fig1.1 Database Directory Structure|border|556x556px]]'''Database Directory''' (e.g. /opt/apache/adbs): As shown in the Fig 1.1 on the right. This folder also houses the superConfig file for each installation. |
# Database Schemas | # Database Schemas | ||
#* [[List of all Database Schemas]] | #* [[List of all Database Schemas]] | ||
Line 9: | Line 9: | ||
== Docker Container Architecture == | == Docker Container Architecture == | ||
# Container Images | # Container Images | ||
− | #*[[File:Running Docker Compose Rhomicom ERP.png|alt= | + | #*[[File:Running Docker Compose Rhomicom ERP.png|alt=Fig1.2vRunning Docker Compose Rhomicom ERP|thumb|221x221px|Fig1.2 Running Docker Compose Rhomicom ERP]]'''rho-nginx:''' This is the container that hosts the web root files and folders. It runs nginx web server on port 8000 and serves the ERP web files. It has php7.4 installed. It is based on the rhomicom/rho-erp-base:v1.2 image on docker hub. Its root folder /usr/share/nginx/html is mounted to the local directory src/RHO_ERP_WEB. It also mounts the local DB Directory folder db/db_dirs/ to /opt/apache |
#* '''rho-api:''' This container contains an installation of NodeJS, expressJS, Java and Chromium Browser. It's main purpose is to make availble apis that can be called by the application running on rho-nginx to execute specific tasks in the background and serve the output back to rho-nginx container. It mounts the local DB Directory folder db/db_dirs/ to /opt/apache | #* '''rho-api:''' This container contains an installation of NodeJS, expressJS, Java and Chromium Browser. It's main purpose is to make availble apis that can be called by the application running on rho-nginx to execute specific tasks in the background and serve the output back to rho-nginx container. It mounts the local DB Directory folder db/db_dirs/ to /opt/apache | ||
#* '''rho-pgdb:''' The postgreSQL v12.4 container that houses the database behind the rhomicom erp system | #* '''rho-pgdb:''' The postgreSQL v12.4 container that houses the database behind the rhomicom erp system | ||
Line 18: | Line 18: | ||
# Folder/File Structure | # Folder/File Structure | ||
#* db folder: This folder houses all the files needed by the various databases | #* db folder: This folder houses all the files needed by the various databases | ||
− | #* src folder: This contains the ERP Web root folders as well as the yuicompressor jar file[[File:Folder Structure for Rhomicom Docker Compose.png|alt=Folder Structure for Rhomicom Docker Compose|border|thumb|Folder Structure for Rhomicom Docker Compose]] | + | #* src folder: This contains the ERP Web root folders as well as the yuicompressor jar file[[File:Folder Structure for Rhomicom Docker Compose.png|alt=Fig1.3 Folder Structure for Rhomicom Docker Compose|border|thumb|Fig1.3 Folder Structure for Rhomicom Docker Compose|283x283px]] |
# Sample Docker Compose File | # Sample Docker Compose File | ||
#*<syntaxhighlight lang="docker"> | #*<syntaxhighlight lang="docker"> | ||
Line 162: | Line 162: | ||
nt1: | nt1: | ||
+ | </syntaxhighlight> | ||
+ | == SWAPINNESS == | ||
+ | <syntaxhighlight> | ||
+ | df -h | ||
+ | fdisk -l /tmp | ||
+ | fdisk -l /dev/nvme0n1p1 | ||
+ | dd if=/dev/zero of=/swapfile bs=4096 count=1048576 | ||
+ | sudo chmod 600 /swapfile | ||
+ | sudo mkswap /swapfile | ||
+ | sudo swapon /swapfile | ||
+ | sudo swapon -s | ||
+ | sudo swapon --all --verbose | ||
+ | nano /etc/fstab | ||
+ | |||
+ | cat /proc/sys/vm/overcommit_memory | ||
+ | echo 1 > /proc/sys/vm/overcommit_memory | ||
+ | echo 80 > /proc/sys/vm/swappiness | ||
+ | |||
+ | nano /etc/sysctl.conf | ||
+ | vm.overcommit_memory=1 | ||
+ | vm.swappiness=80 | ||
+ | |||
+ | sudo sysctl -p | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 17:40, 12 August 2023
Direct Installation Architecture
- Folder/File Structure
- Web Root Folder (e.g. /var/www/html or /usr/share/nginx/html) Fig 1.0 Rho-ERP Web Root Structure
- Database Directory (e.g. /opt/apache/adbs): As shown in the Fig 1.1 on the right. This folder also houses the superConfig file for each installation.
- Database Schemas
- Code Executions (Client Javascript to Server PHP)
- Code execution always starts from the client making a request via a javascript ajax call. All client requests are processed first by index.php file and subsequently forwarded to the appropriate php file for execution
Docker Container Architecture
- Container Images
- rho-nginx: This is the container that hosts the web root files and folders. It runs nginx web server on port 8000 and serves the ERP web files. It has php7.4 installed. It is based on the rhomicom/rho-erp-base:v1.2 image on docker hub. Its root folder /usr/share/nginx/html is mounted to the local directory src/RHO_ERP_WEB. It also mounts the local DB Directory folder db/db_dirs/ to /opt/apache
- rho-api: This container contains an installation of NodeJS, expressJS, Java and Chromium Browser. It's main purpose is to make availble apis that can be called by the application running on rho-nginx to execute specific tasks in the background and serve the output back to rho-nginx container. It mounts the local DB Directory folder db/db_dirs/ to /opt/apache
- rho-pgdb: The postgreSQL v12.4 container that houses the database behind the rhomicom erp system
- rho-redis: The redis server container used by the rho-nginx container to handle all php caching and session handling
- rho-mysqldb: The MySQL 5.7 container for the biometric (fingerprint) database behind the rhomicom banking solution
- rho-pgadmin: pgAdmin4 container for managing the postgreSQL database
- rho-administrator: Adminer container for managing the MySQL Database. It can as well be used to manage the postgreSQL DB
- Folder/File Structure
- db folder: This folder houses all the files needed by the various databases
- src folder: This contains the ERP Web root folders as well as the yuicompressor jar file
- Sample Docker Compose File
version: "3.3" services: nginx: image: rhomicom/rho-erp-base:v1.2 container_name: rho-nginx logging: driver: "json-file" options: max-size: "5m" max-file: "5" depends_on: - redis - pgdb - mysqldb - rhoapi ports: - 8000:8080 tty: true restart: always networks: - nt1 volumes: - ./src/RHO_ERP_WEB:/usr/share/nginx/html - ./db/db_dirs:/opt/apache - ./conf/rho-php.ini:/etc/php7/php.ini - ./conf/rho-www.conf:/etc/php7/php-fpm.d/www.conf - ./conf/nginx_conf/nginx.conf:/etc/nginx/nginx.conf - ./conf/nginx_conf/conf.d/default.conf:/etc/nginx/conf.d/default.conf - ./conf/nginx_conf/conf.d/pagespeed.conf:/etc/nginx/conf.d/pagespeed.conf redis: image: redis:6.0.8-alpine3.12 restart: unless-stopped container_name: rho-redis logging: driver: "json-file" options: max-size: "5m" max-file: "5" #environment: #- REDIS_PASSWORD=${REDIS_PASSWORD} command: redis-server --appendonly yes networks: - nt1 pgdb: image: postgres:12.4-alpine #postgres:13.0-alpine restart: always container_name: rho-pgdb logging: driver: "json-file" options: max-size: "5m" max-file: "5" networks: - nt1 volumes: - ./db/initdb/pgdb:/docker-entrypoint-initdb.d - ./db/db_dirs:/opt/apache - ./db/conf/postgresql.conf:/var/lib/postgresql/data/pgdata/postgresql.conf #Uncomment 2nd Volume for persistent Data #NB: Not uncommenting might cause data loss when docker-compose down is run #- ./db/db_data/pgdb:/var/lib/postgresql/data environment: POSTGRES_DB: rho_erp_db POSTGRES_PASSWORD: Password1 PGDATA: /var/lib/postgresql/data/pgdata #Choose Between Adminer, pgAdmin or Webmin #Comment/Uncomment out as desired adminer: image: adminer restart: always container_name: rho-administrator logging: driver: "json-file" options: max-size: "5m" max-file: "5" ports: - 8090:8080 networks: - nt1 volumes: - ./conf/adminer/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini pgadmin: image: dpage/pgadmin4:4.28 restart: always container_name: rho-pgadmin logging: driver: "json-file" options: max-size: "5m" max-file: "5" ports: - 8091:80 environment: - [email protected] - PGADMIN_DEFAULT_PASSWORD=Password1 networks: - nt1 volumes: - ./db/pgadmin:/var/lib/pgadmin/storage mysqldb: image: mysql:5.7 restart: always container_name: rho-mysqldb logging: driver: "json-file" options: max-size: "5m" max-file: "5" networks: - nt1 volumes: - ./db/initdb/mysqldb:/docker-entrypoint-initdb.d #Uncomment 2nd Volume for persistent Data #NB: Not uncommenting might cause data loss when docker-compose down is run #- ./db/db_data/mysqldb:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=Password1 - MYSQL_DATABASE=demo_flexcodesdk rhoapi: image: rhomicom/rho-erp-api:v1.0 restart: always container_name: rho-api logging: driver: "json-file" options: max-size: "5m" max-file: "5" #ports: - 3000:3000 networks: - nt1 volumes: - ./src/RHO_ERP_WEB:/usr/share/nginx/html - ./db/db_dirs:/opt/apache - ./api_image/code:/code #command: npm prod-start volumes: site: networks: nt1:
SWAPINNESS
df -h
fdisk -l /tmp
fdisk -l /dev/nvme0n1p1
dd if=/dev/zero of=/swapfile bs=4096 count=1048576
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
sudo swapon --all --verbose
nano /etc/fstab
cat /proc/sys/vm/overcommit_memory
echo 1 > /proc/sys/vm/overcommit_memory
echo 80 > /proc/sys/vm/swappiness
nano /etc/sysctl.conf
vm.overcommit_memory=1
vm.swappiness=80
sudo sysctl -p