Maintenance

Manage services


Manage disk

  • The actual state of the disk


Resize the disk size

Example: Resize /tmp and /var

  • 1️⃣ Create a new partition

cfdisk /dev/sda
  • Select Free Space → New → size 20G (or more)(you can do 10G for /tmp + 10G for /var)

  • Set type Linux filesystem

  • Write changes → Quit

Then refresh partition table:

partprobe /dev/sda
  • 2️⃣ Create a PV and extend VG

pvcreate /dev/sda5   # assuming new partition is sda5
vgextend sysvg /dev/sda5
vgdisplay sysvg      # confirm free space is available
  • 3️⃣ Extend LVs

  • Add 10G to /tmp to be 14G:

lvextend -L +10G /dev/sysvg/lv_tmp
  • Add 10G to /var to be 14G:

lvextend -L +9.9G /dev/sysvg/lv_var
  • 4️⃣ Resize filesystems

  • Check type:

df -T /tmp /var
  • For xfs:

xfs_growfs /tmp
xfs_growfs /var
  • 5️⃣ Verify

df -h /tmp /var


Clean/Empty the disk

  • Sometime we have problem because of the disk saturation and usually the problem in:

    • /tmp => just clean the tmp folder and restart the services with sudo oprestart

    • Logs files

      • /opt/ontoportal/bioportal_web_ui/shared/log

      • /opt/ontoportal/ontologies_api/shared/log

      • /opt/ontoportal/ncbo_cron/shared/logs

      • /var/log/virtuoso-public

      • /var/log/tomcat/FAIR_CACHE/

    • use df -h to see which folder is full

    • use du -ah -d 1 | sort -h inside the folder to see which files are taken space


Processes, RAM, CPU usage


Deployment

  • Go to /opt/ontoportal/agroportal_deployment/

  • do git pull

  • use the deploy.sh script

    ontoportal@localhost:/opt/ontoportal/agroportal_deployment$ ./deploy.sh help
    [-] Error: Missing arguments
    Usage: ./deploy.sh <application> <stage>
    
    Applications:
      - ALL
      - bioportal_web_ui
      - UI
      - ontologies_api
      - API
      - ncbo_cron
      - CRON
    
    Stages:
      - production
      - pre_production
    
    Example:
      ./deploy.sh ontologies_api production
      ./deploy.sh API production
  • execute ./deploy.sh ALL production or ./deploy.sh ALL pre_production to deploy all apps

  • if something wrong after deployment you can do rollback

    • Method 1: using the deploy.sh script: TO-DO

    • Method 2:

      • go to the app folder example bioportal_web_ui

      • Link the current folder with the release before the deployment (capistrano always will let the 5 last releases)

        ontoportal@localhost:/opt/ontoportal/bioportal_web_ui$ ls current releases/  -altr
        lrwxrwxrwx 1 ontoportal ontoportal  56 Mar 16 16:43 current -> /opt/ontoportal/bioportal_web_ui/releases/20260316164234
        
        releases/:
        total 20
        drwxrwxr-x 18 ontoportal ontoportal 4096 Mar  9 15:54 20260309155421
        drwxrwxr-x 18 ontoportal ontoportal 4096 Mar  9 16:15 20260309161504
        drwxrwxr-x 18 ontoportal ontoportal 4096 Mar 10 17:22 20260310172200
        drwxrwxr-x 18 ontoportal ontoportal 4096 Mar 11 17:06 20260311170634
        drwxrwxr-x 18 ontoportal ontoportal 4096 Mar 16 16:42 20260316164234