Project

General

Profile

运维支持 #3

Do system maintenance of our OTS website (order.easydingzhi.com) regularly

Added by Xihua Fan about 5 years ago. Updated 12 days ago.

Status:
进行中
Priority:
普通
Assignee:
Target version:
-
Start date:
11/09/2020
Due date:
12/31/2025 (Due in 11 days)
% Done:

90%

Estimated time:
100.00 h
Spent time:

Description

Task Details
  • 1. Check EBS/EFS Usage
    eg:
    $df -h
    /dev/nvme0n1p1                                      10G  5.7G  4.4G  57% /
    fs-e2864107.efs.cn-northwest-1.amazonaws.com.cn:/  8.0E  8.6G  8.0E   1% /efs
    
  • 2. Check Httpd Log
    /var/log/httpd/ssl_error_log
    /var/log/httpd/error_log
  • 3. Check PHP Log
    /var/log/php-fpm/www-error.log
  • 4. DB Data Backup
    • View: crontab -l
    • Edit: crontab -e
    • Current configuration:
      No. Project Time Server Script
      1 Redmine 00:00 daily v3:52.83.77.219 /var/www/html/shell/databasebk.sh
      2 OTS3.0 00:00 daily v3:52.83.77.219 /var/www/html/shell/databasebk.sh
      3 OTS4.0 00:00 daily v4:13.214.192.143 /var/www/shell/databasebk.sh
  • 5. Monitor the amount of data in the t_order_history table, if it exceeds 100,000 entries, please provide feedback to the group to discuss a solution.
    SELECT COUNT(*) FROM `t_order_history`;
    
  • 6. Transfer uploaded files from OTS to Onedrive(Jiuting Group - Documents\OTS-Backup\uploadedFile) once a year.
  • 7. Check starting service
    sudo netstat -nltp
    
    1. httpd(80/443)
    3. mysqld(3306/33060)
    
  • 8. Check the LifeCircle for the Amazon Linux 2
    Some information shows: AL2 End of Life is 2025-06-30.
  • 9. Check SSL
  • 10. Check php.ini (v4 only)
    upload_tmp_dir = /var/www/html/storage/upload/tmp
    
    • 切换tmp的步骤 (Note: 因为php-fpm 服务开启了PrivateTmp 功能,/tmp 和 /var/tmp/ 与其他服务隔离。这需要php指定的tmp目录排除这2个目录。)
      1. 创建临时目录:
      mkdir -p /var/www/html/storage/upload/tmp
      chown apache:apache /var/www/html/storage/upload/tmp
      chmod 700 /var/www/html/storage/upload/tmp
      
      2. 编辑:/etc/php.ini
      upload_tmp_dir = /var/www/html/storage/upload/tmp
      
      3. 重启服务
      systemctl restart php-fpm
      systemctl restart httpd
      
    • 将来整个storage目录移动到EFS下,记得这里需要修改php.ini
Input
  1. Domain: order.easydingzhi.com
  2. AWS: www.amazonaws.cn
    Account ID->585080865408
    IAM user name->XXX
    Password->XXX
Output
  • Similar to the following example:
  1. Check EBS usage: Used 5.7G (57%)
  2. Check EFS usage: Used 8.6G (1%)
  3. Check Httpd Log: Abnormal(found proxy_fcgi:error)
  4. Check PHP Log: Normal
  5. Backup DB:
    /efs/redmine_dbbackup/XXXX_20201116.zip
    /efs/ots_dbbackup/XXXX_20201116.zip
Others
  • Maintenance cycle
    Just started: weekly execution (for example, Friday)
    Stable period: monthly execution (such as the end of the month)

Also available in: Atom PDF