寶塔面板MySql進程守護監控腳本_數據庫關閉後自動重啓
本文圍繞“寶塔面板MySql進程守護監控腳本_數據庫關閉後自動重啓”整理操作說明與配置思路。界面名稱可能隨軟件版本調整,修改線上網站前請保存備份。涉及使用體驗的描述屬於來源作者,本頁未提供獨立實測結論。 前段時間來源作者把一臺VPS環境從LNMP換到了寶塔面板,結果經常 MySQL數據庫 莫名其妙的

基本資訊
- 資料範圍
- 完整文章正文,已清理外鏈和來源推廣
- 正文插圖
- 1個真實URL;1張已本地化,其餘使用原圖待補
本文圍繞“寶塔面板MySql進程守護監控腳本_數據庫關閉後自動重啓”整理操作說明與配置思路。界面名稱可能隨軟件版本調整,修改線上網站前請保存備份。涉及使用體驗的描述屬於來源作者,本頁未提供獨立實測結論。
前段時間來源作者把一臺VPS環境從LNMP換到了寶塔面板,結果經常MySQL數據庫莫名其妙的自動停止,看日誌也沒看出來是什麼問題,所以就只能來一招最簡單的數據庫進程守護了。
寶塔面板添加MySQL進程守護腳本方法
在寶塔面板後臺,點擊計劃任務,然後添加一個Shell腳本。名字自選,執行週期按分鐘執行,來源作者這裏是設置的十分鐘,腳本內容如下:
pgrep -x mysqld &> /dev/null
if [ $? -ne 0 ];then
bash /www/server/panel/script/rememory.sh
/etc/init.d/mysqld start
fi

另外在MySQL的性能優化裏面,設置了一下,然後保存了發現並沒什麼卵用,MySQL依然停止運行,代碼如下,空了再來具體研究問題所在了。
190513 14:39:11 [Note] /www/server/mysql/bin/mysqld: Normal shutdown 190513 14:39:11 [Note] Event Scheduler: Purging the queue. 0 events 190513 14:39:11 InnoDB: Starting shutdown... 190513 14:39:12 InnoDB: Shutdown completed; log sequence number 618693401 190513 14:39:12 [Note] /www/server/mysql/bin/mysqld: Shutdown complete 190513 14:39:13 [Note] Plugin 'FEDERATED' is disabled. 190513 14:39:13 InnoDB: The InnoDB memory heap is disabled 190513 14:39:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins 190513 14:39:13 InnoDB: Compressed tables use zlib 1.2.7 190513 14:39:13 InnoDB: Using Linux native AIO 190513 14:39:13 InnoDB: Initializing buffer pool, size = 256.0M 190513 14:39:13 InnoDB: Completed initialization of buffer pool 190513 14:39:13 InnoDB: highest supported file format is Barracuda. 190513 14:39:14 InnoDB: Waiting for the background threads to start 190513 14:39:15 InnoDB: 5.5.57 started; log sequence number 618693401 190513 14:39:15 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306 190513 14:39:15 [Note] - '0.0.0.0' resolves to '0.0.0.0'; 190513 14:39:15 [Note] Server socket created on IP: '0.0.0.0'. 190513 14:39:15 [Warning] 'user' entry 'x@%' has both a password and an authentication plugin specified. The password will be ignored. 190513 14:39:15 [Note] Event Scheduler: Loaded 0 events 190513 14:39:15 [Note] /www/server/mysql/bin/mysqld: ready for connections. Version: '5.5.57-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution 190513 14:39:21 [Warning] IP address '2' has been resolved to the host name '2.vultr.com', which resembles IPv4-address itself. 190513 14:39:43 [Warning] IP address '9' has been resolved to the host name '9.vultr.com', which resembles IPv4-address itself. 190513 14:39:48 [Warning] IP address '8' has been resolved to the host name '8.vultr.com', which resembles IPv4-address itself. 190513 14:40:12 [Warning] IP address '9' has been resolved to the host name '9.vultr.com', which resembles IPv4-address itself.
05月14日更新:依然死,調整了下swap大小再觀察下。然後還重啓了一次服務器。開機後內存使用600+,還空200+
本站整理公開產品資料與建站知識,介紹不代表實際使用測試。功能、價格、授權和支援範圍請在購買前向提供方確認。 閱讀推廣披露






SHARE YOUR QUESTIONS
交流與討論
分享你的問題和經驗。請勿釋出廣告、敏感資訊或未經核實的評價。