Проблема с MySQL

123 4
Продюсер
На сайте с 09.11.2010
Offline
36
15783

После переустановки системы столкнулся с проблемой, что мускул падает переодически в разное время( закономерности не выявил). Поднять удается только рестартом сервиса mysqld.

Пробовал различные конфиги my.ini, все безуспешно.

Вот лог(за несколько часов до ):


*******************
130116 20:30:12 InnoDB: Waiting for the background threads to start
130116 20:30:13 InnoDB: 1.1.8 started; log sequence number 1726150
/usr/libexec/mysqld: File './mysql-bin.000013' not found (Errcode: 2)
130116 20:30:13 [ERROR] Failed to open log (file './mysql-bin.000013', errno 2)
130116 20:30:13 [ERROR] Could not open log file
130116 20:30:13 [ERROR] Can't init tc log
130116 20:30:13 [ERROR] Aborting

130116 20:30:13 InnoDB: Starting shutdown...
130116 20:30:14 InnoDB: Shutdown completed; log sequence number 1726150
130116 20:30:14 [Note] /usr/libexec/mysqld: Shutdown complete

130116 20:30:14 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130116 20:31:01 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130116 20:31:01 [Note] Plugin 'FEDERATED' is disabled.
130116 20:31:01 InnoDB: The InnoDB memory heap is disabled
130116 20:31:01 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130116 20:31:01 InnoDB: Compressed tables use zlib 1.2.3
130116 20:31:01 InnoDB: Using Linux native AIO
130116 20:31:01 InnoDB: Initializing buffer pool, size = 128.0M
130116 20:31:01 InnoDB: Completed initialization of buffer pool
130116 20:31:01 InnoDB: highest supported file format is Barracuda.
130116 20:31:01 InnoDB: Waiting for the background threads to start
130116 20:31:02 InnoDB: 1.1.8 started; log sequence number 1726150
/usr/libexec/mysqld: File './mysql-bin.000013' not found (Errcode: 2)
130116 20:31:02 [ERROR] Failed to open log (file './mysql-bin.000013', errno 2)
130116 20:31:02 [ERROR] Could not open log file
130116 20:31:02 [ERROR] Can't init tc log
130116 20:31:02 [ERROR] Aborting

130116 20:31:02 InnoDB: Starting shutdown...
130116 20:31:03 InnoDB: Shutdown completed; log sequence number 1726150
130116 20:31:03 [Note] /usr/libexec/mysqld: Shutdown complete

130116 20:31:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130116 20:34:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130116 20:34:21 [Note] Plugin 'FEDERATED' is disabled.
130116 20:34:21 InnoDB: The InnoDB memory heap is disabled
130116 20:34:21 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130116 20:34:21 InnoDB: Compressed tables use zlib 1.2.3
130116 20:34:21 InnoDB: Using Linux native AIO
130116 20:34:21 InnoDB: Initializing buffer pool, size = 128.0M
130116 20:34:21 InnoDB: Completed initialization of buffer pool
130116 20:34:21 InnoDB: highest supported file format is Barracuda.
130116 20:34:21 InnoDB: Waiting for the background threads to start
130116 20:34:22 InnoDB: 1.1.8 started; log sequence number 1726150
/usr/libexec/mysqld: File './mysql-bin.000013' not found (Errcode: 2)
130116 20:34:22 [ERROR] Failed to open log (file './mysql-bin.000013', errno 2)
130116 20:34:22 [ERROR] Could not open log file
130116 20:34:22 [ERROR] Can't init tc log
130116 20:34:22 [ERROR] Aborting

130116 20:34:22 InnoDB: Starting shutdown...
130116 20:34:23 InnoDB: Shutdown completed; log sequence number 1726150
130116 20:34:23 [Note] /usr/libexec/mysqld: Shutdown complete

130116 20:34:23 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130116 20:38:14 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130116 20:38:14 [Warning] You need to use --log-bin to make --binlog-format work.
130116 20:38:14 [Note] Plugin 'FEDERATED' is disabled.
130116 20:38:14 InnoDB: The InnoDB memory heap is disabled
130116 20:38:14 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130116 20:38:14 InnoDB: Compressed tables use zlib 1.2.3
130116 20:38:14 InnoDB: Using Linux native AIO
130116 20:38:14 InnoDB: Initializing buffer pool, size = 128.0M
130116 20:38:14 InnoDB: Completed initialization of buffer pool
130116 20:38:14 InnoDB: highest supported file format is Barracuda.
130116 20:38:14 InnoDB: Waiting for the background threads to start
130116 20:38:15 InnoDB: 1.1.8 started; log sequence number 1726150
130116 20:38:15 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130116 20:38:15 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130116 20:38:15 [Note] Server socket created on IP: '0.0.0.0'.
130116 20:38:15 [Note] Event Scheduler: Loaded 0 events
130116 20:38:15 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.28' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
130116 20:42:22 [ERROR] Got an error from thread_id=291, /builddir/build/BUILD/mysql-5.5.28/storage/myisam/ha_myisam.cc:912
130116 20:42:22 [ERROR] MySQL thread id 291, OS thread handle 0x7f93e8c70700, query id 3606 localhost dom Checking table
CHECK TABLE `post`
130116 23:37:11 [Warning] IP address '114.80.154.66' could not be resolved: Name or service not known
130117 0:12:51 [Warning] IP address '116.247.118.204' could not be resolved: Name or service not known
130117 17:08:22 mysqld_safe Number of processes running now: 0
130117 17:08:22 mysqld_safe mysqld restarted
130117 20:53:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130117 20:53:31 [Warning] You need to use --log-bin to make --binlog-format work.
130117 20:53:31 [Note] Plugin 'FEDERATED' is disabled.
130117 20:53:31 InnoDB: The InnoDB memory heap is disabled
130117 20:53:31 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130117 20:53:31 InnoDB: Compressed tables use zlib 1.2.3
130117 20:53:31 InnoDB: Using Linux native AIO
130117 20:53:31 InnoDB: Initializing buffer pool, size = 128.0M
130117 20:53:31 InnoDB: Completed initialization of buffer pool
130117 20:53:31 InnoDB: highest supported file format is Barracuda.
130117 20:53:31 InnoDB: Waiting for the background threads to start
130117 20:53:32 InnoDB: 1.1.8 started; log sequence number 1726150
130117 20:53:32 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130117 20:53:32 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130117 20:53:32 [Note] Server socket created on IP: '0.0.0.0'.
130117 20:53:32 [Note] Event Scheduler: Loaded 0 events
130117 20:53:32 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.28' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
130117 22:12:45 [Warning] IP address '218.93.205.46' could not be resolved: Name or service not known
130118 22:10:33 [Warning] IP address '210.102.55.141' could not be resolved: Name or service not known
130119 2:48:35 [Warning] IP address '219.136.252.240' could not be resolved: Name or service not known
130120 3:48:43 [Warning] IP address '117.28.254.69' could not be resolved: Name or service not known
130121 00:53:15 mysqld_safe Number of processes running now: 0
130121 00:53:15 mysqld_safe mysqld restarted
130121 0:53:15 [Warning] You need to use --log-bin to make --binlog-format work.
130121 0:53:15 [Note] Plugin 'FEDERATED' is disabled.
130121 0:53:15 InnoDB: The InnoDB memory heap is disabled
130121 0:53:15 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130121 0:53:15 InnoDB: Compressed tables use zlib 1.2.3
130121 0:53:15 InnoDB: Using Linux native AIO
130121 0:53:15 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
130121 0:53:15 InnoDB: Completed initialization of buffer pool
130121 0:53:15 InnoDB: Fatal error: cannot allocate memory for the buffer pool
130121 0:53:15 [ERROR] Plugin 'InnoDB' init function returned error.
130121 0:53:15 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130121 0:53:15 [ERROR] Unknown/unsupported storage engine: InnoDB
130121 0:53:15 [ERROR] Aborting

130121 0:53:15 [Note] /usr/libexec/mysqld: Shutdown complete

130121 00:53:15 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130121 07:06:40 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130121 7:06:40 [Warning] You need to use --log-bin to make --binlog-format work.
130121 7:06:40 [Note] Plugin 'FEDERATED' is disabled.
130121 7:06:40 InnoDB: The InnoDB memory heap is disabled
130121 7:06:40 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130121 7:06:40 InnoDB: Compressed tables use zlib 1.2.3
130121 7:06:40 InnoDB: Using Linux native AIO
130121 7:06:40 InnoDB: Initializing buffer pool, size = 128.0M
130121 7:06:40 InnoDB: Completed initialization of buffer pool
130121 7:06:40 InnoDB: highest supported file format is Barracuda.
130121 7:06:40 InnoDB: Waiting for the background threads to start
130121 7:06:41 InnoDB: 1.1.8 started; log sequence number 1726150
130121 7:06:41 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130121 7:06:41 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130121 7:06:41 [Note] Server socket created on IP: '0.0.0.0'.
130121 7:06:41 [Note] Event Scheduler: Loaded 0 events
130121 7:06:41 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.28' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)

Как видно все грохнулось в 00:53 и только утром я его перезапустил.

Подскажите куда копать? какая еще информация нужна для выяснения проблемы?

Andreyka
На сайте с 19.02.2005
Offline
822
#1

Нехватка места на диске, памяти и проблемы с иредами

Или дрянная vps или неудачная сборка mysql

Хотите узнать больше? Предоставьтк доступ к серверу

Не стоит плодить сущности без необходимости
Продюсер
На сайте с 09.11.2010
Offline
36
#2

Ставил Centos 6.*

Свободно на диске 2,5Гб из 10

Память 512 Мб

Ставилось все с панельки isp manager lite

проблемы с иредами

Что это?

Himiko
На сайте с 28.08.2008
Offline
560
#3

Не хватает памяти под пул.

У вас только innodb 128 мегабайт хочет использовать...

А я полагаю, что у вас такого количества свободной памяти просто нет.

Либо увеличивайте ресурсы сервера, либо меняйте настройки MySQL.

Профессиональное администрирование серверов (https://systemintegra.ru). Круглосуточно. Отзывы (/ru/forum/834230) Лицензии (http://clck.ru/Qhf5) ISPManager,VDSManager,Billmanager e.t.c. по низким ценам.
[Удален]
#4

В момент падения оперативу никто не скушивает? БД падает, возможно, из-за этого, а потом пытаясь поднятся выдает:

130121 0:53:15 InnoDB: Fatal error: cannot allocate memory for the buffer pool

Продюсер
На сайте с 09.11.2010
Offline
36
#5

Подскажите в какую строчку добавить или поменять в my.ini, чтобы изменить значение buffer pool

На сервере порядка 5 сайтов(в основном vBulletin), на паре из них посещаемость 500-1000 уников, имеет-ли смысл увеличивать обьем памяти?

Himiko
На сайте с 28.08.2008
Offline
560
#6

innodb_buffer_pool_size=?M (знак вопроса замените на количество в мегабайтах)

И не нужно его увеличивать. Здесь лучше уменьшать.

Хотя и смотреть нужно конфигурацию mysql полностью, да и желательно не только mysql, но и всех сервисов.

Может стоит оставить innodb_buffer_pool_size на этом значении, но уменьшить потребление памяти другим ПО.

Кроме того, вам вообще innodb нужен? Он используется? Может есть смысл вообще выключить его. (skip-innodb)

можете запустить команду:

mysql -u root -pПАРОЛЬ_ROOT_ОТ_MYSQL -e "select engine from information_schema.tables" | sort | uniq -c

Покажет, какие типы таблиц у вас используются.

Хотя здесь лучше привлечь специалистов, чем на угад настраивать.

Продюсер
На сайте с 09.11.2010
Offline
36
#7
Himiko:
Здесь лучше привлечь специалистов, чем на угад настраивать.

Я хочу сам во всем разобраться)

Спасибо за совет.

Вот содержимое my.cnf:

# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

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

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# 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
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
#log-bin=mysql-bin

# binary logging format - mixed recommended
binlog_format=mixed

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/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

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

Да еще, nginx стоит и настроено php как cgi

Не уверен что DLE и vBulletin используют innodb, может и правда выключить?

A
На сайте с 19.07.2010
Offline
130
#8

покажите еще вывод тюнера

https://github.com/rackerhacker/MySQLTuner-perl

.............
Evas EvaSystems
На сайте с 31.05.2012
Offline
104
#9

Как и предполагали выше - нехватка памяти под buffer_pool.

В 5.5 innodb_buffer_pool_size по умолчанию равен 128 Мб.

#innodb_buffer_pool_size = 16M

уберите комментарий в этой строке и оставьте равным 16.

Если не используется InnoDB - отключите его с помощью skip-innodb добавив его в секцию [mysqld]

Системный администратор Linux. Настройка, сопровождение и оптимизация серверов. Отзывы - searchengines.guru/ru/forum/1017473
Himiko
На сайте с 28.08.2008
Offline
560
#10

Зачем тогда писать на форум, если хотите разобраться самостоятельно?)

А по делу - я вам привел выше команду. Если у вас нет таблиц innodb, то его отключение будет экономить значительную часть памяти.

123 4

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий