運維注意事項以及常見錯誤解決辦法
1.虛擬主機等配置名之類的記得要標準化
2.不要對線上服務器做壓測,壓測是上線之前做的,上線之後的叫***
3.能不編譯就不編譯,分發困難,即便要編譯也是要做一個專用的rpm包
4.chrome f12 調出請求界面
5.可信任的 yum倉庫三類
光盤 官方倉庫 EPEL
6.處理問題要總分總,先大致看在細看每個部分,然後在整體看,先化整爲零,在由零到整
7.安裝不要覆蓋,鏈接,萬一出錯可以回滾
8.設置iptables的時候,在設置前,做一個週期性計劃crontab,每個多長時間清空規則並將默認動作爲accept,一旦有所閃失自己被拒絕進不去,那麼等一段時間就好
9.ssh一般不要使用默認端口,因爲這個是自己遠程連接調控的,默認端口***太多
10.運維設置的任何自定義的名字也好等都要標準化,操作系統標準化,應用程序版本標準化,
硬件標準化,文件路徑標準化,這是能夠基於腳本完成任務的保證,等等,記住要強迫症,都要一致
MySQL:
1.cant open and lock privilege tables:table 'mysql.host' doesnt exists
解決辦法:運行 mysql_install_db 初始化
2. [mysqld]
innodb_file_per_table=ON
skip_name_reslve=ON 跳過名稱解析 但是隻是5.2以上版本才支持
HTTP
1.Permission denied: httpd: could not open error log file /httpdtest/logs/log2/error_log
selinux沒有關閉引起的,setenforce 0 關閉即可
2.amp分別部署到三個主機的時候,記得httpd和php-fpm主機都要有wordpress和pma
3.pma網頁出現紅色報錯,一般是php-fpm的www.conf文件的最下邊的session出了問題,把那兩行註釋掉就好
php
1.出現acceptable C * 的錯誤是因爲沒有C語言,yum安裝gcc就好
2.安裝XCache 執行phpize後纔會出現configure,失敗的話
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
可以先yum m4 和autoconf
編譯安裝
1.error: C++ compiler cannot create executables
yum install gcc gcc-c++ gcc-g77
2.錯誤一般是error開頭的
Nginx
1.nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
80端口被佔用,解除80端口的佔用就好
2.nginx: [emerg] mkdir() "/var/cache/nginx/client_temp" failed (2: No such file or directory)
無法創建某個文件,幫忙創建下就好了
深度學習:
不斷的挑戰自我,給自己設置一個更高的目標,挑戰自己的極限,但是不要太高
化整爲零,一個一個的攻克小難題
重複訓練
堅持1萬小時
面試:
iptables優化規則,端口號
nginx的status
LVS集羣:用到可能小,面試都會問