Database Sering Mati


Status
Not open for further replies.

alidabdul

Beginner 2.0
Kesel setiap kali web saya muncul keterangan:
Error establishing a database connection
Kan capek setiap kali harus restart service Mysql di ssh >_< ada gak sih trik biar gak matian mulu mysqlnya? Atau kalau mati otomatis restart sendiri gitu. Saya pake webuzo di Centos.


Matur Suwun
 
Kesel setiap kali web saya muncul keterangan:
Error establishing a database connection
Kan capek setiap kali harus restart service Mysql di ssh >_< ada gak sih trik biar gak matian mulu mysqlnya? Atau kalau mati otomatis restart sendiri gitu. Saya pake webuzo di Centos.


Matur Suwun

Coba upgrade ram / cpu nya.
 
Bisa jadi memang kehabisan memory karena mysql pakai innodb sebagai storage-engine. Coba saja buat cron-job harian untuk restart sql,
 
Coba upgrade ram / cpu nya.
kurang ram paling
Setuju Tuan, sepertinya kekurangan resource RAM
upgrade RAM berarti nambah dolar dong T____T

Bisa jadi memang kehabisan memory karena mysql pakai innodb sebagai storage-engine. Coba saja buat cron-job harian untuk restart sql,
Nah ini gimana caranya bkin cron job, oke gugling. Masalahnya ini tiap menit padahal traffic gak tinggi juga huft :(
 
untuk memastikan, coba check lognya dulu... errornya kekurangan ram (akibat innodb) atau faktor lain...

Ini lognya,,, klo seperti ini kenapa?

141009 23:30:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141009 23:30:15 InnoDB: The InnoDB memory heap is disabled
141009 23:30:15 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
141009 23:30:15 InnoDB: Compressed tables use zlib 1.2.3
141009 23:30:15 InnoDB: Initializing buffer pool, size = 128.0M
141009 23:30:15 InnoDB: Completed initialization of buffer pool
141009 23:30:15 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
141009 23:30:15 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
141009 23:30:15 InnoDB: Waiting for the background threads to start
141009 23:30:16 InnoDB: 5.5.39 started; log sequence number 28687673
141009 23:30:16 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
141009 23:30:16 [Note] - '0.0.0.0' resolves to '0.0.0.0';
141009 23:30:16 [Note] Server socket created on IP: '0.0.0.0'.
141009 23:30:16 [Note] Event Scheduler: Loaded 0 events
141009 23:30:16 [Note] /usr/local/apps/mysql/bin/mysqld: ready for connections.
Version: '5.5.39' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
141009 23:30:23 [Note] /usr/local/apps/mysql/bin/mysqld: Normal shutdown

141009 23:30:23 [Note] Event Scheduler: Purging the queue. 0 events
141009 23:30:23 InnoDB: Starting shutdown...
141009 23:30:23 InnoDB: Shutdown completed; log sequence number 28687673
141009 23:30:23 [Note] /usr/local/apps/mysql/bin/mysqld: Shutdown complete

141009 23:30:23 mysqld_safe mysqld from pid file /var/lib/mysql/mysqld.pid ended
141009 23:30:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141009 23:30:24 InnoDB: The InnoDB memory heap is disabled
141009 23:30:24 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
141009 23:30:24 InnoDB: Compressed tables use zlib 1.2.3
141009 23:30:24 InnoDB: Initializing buffer pool, size = 128.0M
141009 23:30:24 InnoDB: Completed initialization of buffer pool
141009 23:30:24 InnoDB: highest supported file format is Barracuda.
141009 23:30:24 InnoDB: Waiting for the background threads to start
141009 23:30:25 InnoDB: 5.5.39 started; log sequence number 28687673
141009 23:30:25 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
141009 23:30:25 [Note] - '0.0.0.0' resolves to '0.0.0.0';
141009 23:30:25 [Note] Server socket created on IP: '0.0.0.0'.
141009 23:30:25 [Note] Event Scheduler: Loaded 0 events
141009 23:30:25 [Note] /usr/local/apps/mysql/bin/mysqld: ready for connections.
Version: '5.5.39' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
141009 23:30:27 [Note] /usr/local/apps/mysql/bin/mysqld: Normal shutdown

141009 23:30:27 [Note] Event Scheduler: Purging the queue. 0 events
141009 23:30:27 InnoDB: Starting shutdown...
141009 23:30:28 InnoDB: Shutdown completed; log sequence number 28687673
141009 23:30:28 [Note] /usr/local/apps/mysql/bin/mysqld: Shutdown complete

141009 23:30:28 mysqld_safe mysqld from pid file /var/lib/mysql/mysqld.pid ended
141009 23:30:29 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141009 23:30:29 InnoDB: The InnoDB memory heap is disabled
141009 23:30:29 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
141009 23:30:29 InnoDB: Compressed tables use zlib 1.2.3
141009 23:30:29 InnoDB: Initializing buffer pool, size = 128.0M
141009 23:30:29 InnoDB: Completed initialization of buffer pool
141009 23:30:29 InnoDB: highest supported file format is Barracuda.
141009 23:30:29 InnoDB: Waiting for the background threads to start
141009 23:30:30 InnoDB: 5.5.39 started; log sequence number 28687673
141009 23:30:30 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
141009 23:30:30 [Note] - '0.0.0.0' resolves to '0.0.0.0';
141009 23:30:30 [Note] Server socket created on IP: '0.0.0.0'.
141009 23:30:30 [Note] Event Scheduler: Loaded 0 events
141009 23:30:30 [Note] /usr/local/apps/mysql/bin/mysqld: ready for connections.
Version: '5.5.39' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
141009 23:38:56 mysqld_safe Number of processes running now: 0
141009 23:38:56 mysqld_safe mysqld restarted
141009 23:38:58 InnoDB: The InnoDB memory heap is disabled
141009 23:38:58 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
141009 23:38:58 InnoDB: Compressed tables use zlib 1.2.3
141009 23:38:58 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(136675328 bytes) failed; errno 12
141009 23:38:58 InnoDB: Completed initialization of buffer pool
141009 23:38:58 InnoDB: Fatal error: cannot allocate memory for the buffer pool
141009 23:38:58 [ERROR] Plugin 'InnoDB' init function returned error.
141009 23:38:58 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
141009 23:38:58 [ERROR] Unknown/unsupported storage engine: InnoDB
141009 23:38:58 [ERROR] Aborting

141009 23:38:58 [Note] /usr/local/apps/mysql/bin/mysqld: Shutdown complete

141009 23:38:58 mysqld_safe mysqld from pid file /var/lib/mysql/mysqld.pid ended
 
141009 23:58 InnoDB: Fatal error: cannot allocate memory for the buffer pool

Kayaknya itu sumber masalahnya mas, alternatif solusinya :
1. Convert InnoDB ke MyISAM, dan modifikasi my.cnf (skip innodb)
2. Tambah RAM

Abis itu, hapus semua file ib_logfile dan semua file ibdata dari /var/lib/mysql, dan restart mysql servicenya

Tips :
Alangkah lebih baik coba tuning mysql/mariadb nya dulu, sebelum masuk tahapan production-server
 
Status
Not open for further replies.
Back
Top