Project

General

Profile

运维支持 #3

Updated by Zhongbao Ye 12 days ago

*Task Details* 
 * 1. Check EBS/EFS Usage 
 eg: 
 <pre> 
 $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 
 </pre> 
 * 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| v4:52.83.144.236 | /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. 
 <pre><code class="sql"> 
 SELECT COUNT(*) FROM `t_order_history`; 
 </code></pre> 
 * 6. Transfer uploaded files from OTS to Onedrive(Jiuting Group - Documents\OTS-Backup\uploadedFile) once a year. 
 * 7. Check starting service 
 <pre> 
 sudo netstat -nltp 

 1. httpd(80/443) 
 3. mysqld(3306/33060) 
 </pre> 
 * 8. Check the LifeCircle for the Amazon Linux 2 
 Some information shows: %{color:red}AL2 End of Life is 2025-06-30.% 
 * 9. Check SSL 
 * 10. Check php.ini (v4 only) 
 <pre> 
 upload_tmp_dir = /var/www/html/storage/upload/tmp 
 </pre> 
 ** 切换tmp的步骤 (Note: 因为php-fpm 服务开启了PrivateTmp 功能,/tmp 和 /var/tmp/ 与其他服务隔离。这需要php指定的tmp目录排除这2个目录。) 
 <pre> 
 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 
 </pre> 
 ** %{color:red}将来整个storage目录移动到EFS下,记得这里需要修改php.ini% 

 *Input* 
 # Domain: order.easydingzhi.com 
 # AWS: www.amazonaws.cn  
 Account ID->585080865408 
 IAM user name->XXX 
 Password->XXX 

 *Output* 
 * Similar to the following example: 

 # Check EBS usage: Used 5.7G (57%) 
 # Check EFS usage: Used 8.6G (1%) 
 # Check Httpd Log: Abnormal(found proxy_fcgi:error) 
 # Check PHP Log: Normal 
 # 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)

Back