国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 幫助中心 > 正文

mariadb 在低配 VPS 上崩潰問題處理方案

2024-07-09 22:40:23
字體:
來源:轉載
供稿:網友

引言

最近博客又抽風了,打開主頁后提示 Error Establishing a Database Connection 。仔細想想,應該就是數據庫服務器 mariadb 掛了;以前也遇到過類似的問題。經過分析日志,并結合網上的資料最終解決了問題。

日志

以下是 mariadb 服務器掛掉時的比較關鍵的日志信息,從下面的日志信息中,我們可以很容易地看出由于內存不足,從而導致數據庫服務器啟動時崩潰。

InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
160919  2:47:12  InnoDB: Waiting for the background threads to start
160919  2:47:13 Percona XtraDB (http://www.percona.com) 5.5.46-MariaDB-37.6 started; log sequence number 352718445
160919  2:47:13 [ERROR] mysqld: Out of memory (Needed 128917504 bytes)
160919  2:47:13 [Note] Plugin 'FEEDBACK' is disabled.
160919  2:47:13 [Note] Server socket created on IP: '0.0.0.0'.
160919  2:47:13 [Note] Event Scheduler: Loaded 0 events
160919  2:47:13 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.47-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
160919 02:47:35 mysqld_safe Number of processes running now: 0
160919 02:47:35 mysqld_safe mysqld restarted
160919  2:47:35 [Note] /usr/libexec/mysqld (mysqld 5.5.47-MariaDB) starting as process 28614 ...
160919  2:47:35 InnoDB: The InnoDB memory heap is disabled
160919  2:47:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160919  2:47:35 InnoDB: Compressed tables use zlib 1.2.7
160919  2:47:35 InnoDB: Using Linux native AIO
160919  2:47:35 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137756672 bytes) failed; errno 12
160919  2:47:35 InnoDB: Completed initialization of buffer pool
160919  2:47:35 InnoDB: Fatal error: cannot allocate memory for the buffer pool
160919  2:47:35 [ERROR] Plugin 'InnoDB' init function returned error.
160919  2:47:35 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160919  2:47:35 [ERROR] mysqld: Out of memory (Needed 128917504 bytes)
160919  2:47:35 [ERROR] mysqld: Out of memory (Needed 96681984 bytes)
160919  2:47:35 [ERROR] mysqld: Out of memory (Needed 72499200 bytes)
160919  2:47:35 [Note] Plugin 'FEEDBACK' is disabled.
160919  2:47:35 [ERROR] Unknown/unsupported storage engine: InnoDB
160919  2:47:35 [ERROR] Aborting

解決

在使用 free -m 查看內存信息時,發現 swap 分區大小為 0。難怪說數據庫服務器無法啟動呢,在內存不夠用的情況下,又無法使用 swap 分區,自然崩潰了。由于 VPS 使用了 SSD,性能自然不錯。下面我們給服務器系統 CentOS 7 添加 1024M 的 swap 分區,采用的方法是創建一個 swap 文件:

使用下面的命令創建 swapfile :

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 平度市| 洛宁县| 盐城市| 隆回县| 榆中县| 比如县| 义马市| 岢岚县| 辽源市| 科技| 邵武市| 平远县| 钦州市| 巴中市| 大邑县| 夏津县| 南皮县| 桃园县| 普宁市| 遵义市| 扶风县| 柘城县| 花莲县| 二手房| 旅游| 扎囊县| 安岳县| 祁东县| 永福县| 太湖县| 沂水县| 望江县| 孟连| 堆龙德庆县| 汤原县| 舟曲县| 凉城县| 滁州市| 鹤岗市| 滨海县| 资兴市|