Форум: Форум PHPФорум ApacheФорум Регулярные ВыраженияФорум MySQLHTML+CSS+JavaScriptФорум FlashРазное
Новые темы: 0000000
Самоучитель PHP 5 / 6 (3 издание). Авторы: Кузнецов М.В., Симдянов И.В. PHP 5/6. В подлиннике. Авторы: Кузнецов М.В., Симдянов И.В. PHP. Практика создания Web-сайтов (второе издание). Авторы: Кузнецов М.В., Симдянов И.В. Объектно-ориентированное программирование на PHP. Авторы: Кузнецов М.В., Симдянов И.В. PHP на примерах (2 издание). Авторы: Кузнецов М.В., Симдянов И.В.
ВСЕ НАШИ КНИГИ
Консультационный центр SoftTime

Форум MySQL

Выбрать другой форум

 

Здравствуйте, Посетитель!

вид форума:
Линейный форум Структурный форум

тема: Переодически падает Mysql
 
 автор: tim313   (07.02.2011 в 13:11)   письмо автору
 
 

Пользуюсь выделеным сервером, freebsd
Иногда(по разному) mysql может упасть через день, а может через месяц.
причем после падения обычным включением он не включаеца, включаеца только после удаления файла с именем "ibdata1" в папке "/var/db/mysql".
Включаеца не сам конечно а после команды Mysql старт.

После включения проверяю таблицы, очень часто некоторые немного битые(незнаю что именно), но какие то мелкие неполатки, я их востанавливаю и все нормально, хотя работают и без востановления.

Может знает кто-нибуть причины таких падений?

  Ответить  
 
 автор: cheops   (07.02.2011 в 13:52)   письмо автору
 
   для: tim313   (07.02.2011 в 13:11)
 

А в логе ошибок чего-нибудь пишется?

  Ответить  
 
 автор: tim313   (07.02.2011 в 16:31)   письмо автору
 
   для: cheops   (07.02.2011 в 13:52)
 

110122 1:13:11 [ERROR] /usr/local/libexec/mysqld: Table './db_tim313/baan' is marked as crashed and should be repaired
110122 1:13:11 [ERROR] /usr/local/libexec/mysqld: Table './db_tim313/baan' is marked as crashed and should be repaired
110122 1:13:12 [ERROR] /usr/local/libexec/mysqld: Table './db_tim313/baan' is marked as crashed and should be repaired
110122 1:13:12 [ERROR] /usr/local/libexec/mysqld: Table './db_tim313/baan' is marked as crashed and should be repaired
110122 1:13:34 [ERROR] /usr/local/libexec/mysqld: Table './db_tim313/baan' is marked as crashed and should be repaired
110122 1:13:34 [ERROR] /usr/local/libexec/mysqld: Table './db_tim313/baan' is marked as crashed and should be repaired
110122 1:13:44 [Note] Found 0 of 3 rows when repairing './db_tim313/baan'
110207 09:36:47 mysqld started
110207 9:36:48 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
110207 9:36:48 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
110207 9:36:48 [Warning] option 'thread_stack': unsigned value 65536 adjusted to 131072
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
110207 9:36:48 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...
InnoDB: Page directory corruption: supremum not pointed to
110207 9:36:48 InnoDB: Page dump in ascii and hex (16384 bytes):
len 16384; hex 00000000000000000
110207 9:36:49 InnoDB: Page checksum 1575996416, prior-to-4.0.14-form checksum 1371122432
InnoDB: stored checksum 0, prior-to-4.0.14-form stored checksum 0
InnoDB: Page lsn 0 0, low 4 bytes of lsn at page end 0
InnoDB: Page number (if stored to page already) 0,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
InnoDB: Page directory corruption: supremum not pointed to
110207 9:36:49 InnoDB: Page dump in ascii and hex (16384 bytes):
len 16384; hex 000000
110207 9:36:49 InnoDB: Page checksum 1575996416, prior-to-4.0.14-form checksum 1371122432
InnoDB: stored checksum 0, prior-to-4.0.14-form stored checksum 0
InnoDB: Page lsn 0 0, low 4 bytes of lsn at page end 0
InnoDB: Page number (if stored to page already) 0,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
110207 9:36:49InnoDB: Error: trying to access a stray pointer 0x88f1bff8
InnoDB: buf pool start is at 0x8f0c000, end at 0x970c000
InnoDB: Probable reason is database corruption or memory
InnoDB: corruption. If this happens in an InnoDB database recovery, see
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
InnoDB: how to force recovery.
110207 9:36:49InnoDB: Assertion failure in thread 138989568 in file ./../include/buf0buf.ic line 268
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
InnoDB: about forcing recovery.
110207 9:36:49 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=0
read_buffer_size=131072
max_used_connections=0
max_connections=100
threads_connected=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 217600 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

110207 09:36:49 mysqld ended

110207 12:14:40 mysqld started
110207 12:14:40 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
110207 12:14:40 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
110207 12:14:40 [Warning] option 'thread_stack': unsigned value 65536 adjusted to 131072
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
110207 12:14:41 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Error: all log files must be created at the same time.
InnoDB: All log files must be created also in database creation.
InnoDB: If you want bigger or smaller log files, shut down the
InnoDB: database and make sure there were no errors in shutdown.
InnoDB: Then delete the existing log files. Edit the .cnf file
InnoDB: and start the database again.
110207 12:14:41 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.0.67' socket: '/tmp/mysql.sock' port: 3306 FreeBSD port: mysql-server-5.0.67_1

  Ответить  
 
 автор: cheops   (07.02.2011 в 16:38)   письмо автору
 
   для: tim313   (07.02.2011 в 16:31)
 

Хм... а вам вообще таблицы типа InnoDB нужны (судя по безболезненному удалению ibdata1 вероятно не очень)? Может их отключить и посмотреть как себя сервер будет вести?

PS Если ответ положительный, отключить InnoDB можно при помощи директивы skip-innodb в конфигурационном файле my.ini (my.cnf для UNIX). Cервер после редактирования my.ini нужно будет перезагрузить.

  Ответить  
 
 автор: tim313   (07.02.2011 в 17:26)   письмо автору
 
   для: cheops   (07.02.2011 в 16:38)
 

Я не такой специалист, на сколько я понял InnoDB это тип таблиц, у меня вроде все таблицы MyISAM.
Я не знал за что отвечает файл ibdata1, думал это кеш по ключам.

директиву skip-innodb добавил, перезагрул сервер, вроде все работает, для теста удалил ibdata1, вроде все работает.
Спасибо.

  Ответить  
 
 автор: cheops   (07.02.2011 в 17:40)   письмо автору
 
   для: tim313   (07.02.2011 в 17:26)
 

>Я не знал за что отвечает файл ibdata1, думал это кеш по ключам.
Это табличное пространство InnoDB - там хранятся все таблицы этого типа.

PS Правда, скорее всего причина падения сервера не в этом (но сервер перезагружаться будет попроще, ведь он при старте сам должен чинить поврежденные таблицы). Вообще нагрузка на сервер большая? И настраивался ли файл my.ini кем-либо (может MySQL не хватает памяти и она захлебывается в запросах)?

  Ответить  
 
 автор: tim313   (07.02.2011 в 18:19)   письмо автору
 
   для: cheops   (07.02.2011 в 17:40)
 

может быть и такое, хотя я всячески пытался уменьшить количество запросов к Mysql и кешировать запросы храня некоторые данные в текстовых статичесих файлах.

Статистика запросов: со времени запуска, на сервер было отослано запросов -

Всего|в час|в минуту|в секунду
148 k|174.37k|2.91 k|48.44


файл my.cnf:

# The following options will be passed to all MySQL clients
[client]
#password    = your_password
port        = 3306
socket        = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port        = 3306
socket        = /tmp/mysql.sock
skip-locking
key_buffer = 64M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 2M
read_buffer_size = 128K
read_rnd_buffer_size = 1M
net_buffer_length = 2K
thread_stack = 64K

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!

#skip-networking
server-id    = 1

# Uncomment the following if you want to log updates
#log-bin=mysql-bin

# Disable Federated by default
skip-federated
skip-innodb
# Uncomment the following if you are NOT using BDB tables
#skip-bdb

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/db/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/db/mysql/
#innodb_log_arch_dir = /var/db/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

  Ответить  
 
 автор: cheops   (07.02.2011 в 18:24)   письмо автору
 
   для: tim313   (07.02.2011 в 18:19)
 

А много памяти на сервере и крутится ли на нем что-то помимо MySQL?

  Ответить  
 
 автор: tim313   (07.02.2011 в 18:27)   письмо автору
 
   для: cheops   (07.02.2011 в 18:24)
 

1.5Гб оперативки, 75 Гб жесткий+300 Гб жесткий
Celeron 2,66GHz

freebsd, apach, mysql, nginx

Средняя загрузка 0.82 0.75 0.60
данные о нагрузке используемые в Unix

  Ответить  
 
 автор: cheops   (07.02.2011 в 18:30)   письмо автору
 
   для: tim313   (07.02.2011 в 18:27)
 

Хм... тогда my.cnf в порядке, разве что можно увеличить key_buffer раза в два (к сожалению, на падениях это не отразится).

PS А версия MySQL какая используется (до третей цифры)?

  Ответить  
 
 автор: tim313   (07.02.2011 в 18:39)   письмо автору
 
   для: cheops   (07.02.2011 в 18:30)
 

ну дык....5 лет сервер держу.

Версия MySQL-клиента: 5.0.67

  Ответить  
Rambler's Top100
вверх

Rambler's Top100 Яндекс.Метрика Яндекс цитирования