FAIL..] The server quit without updating PID file (/var/run/mysqld/mysqld.pid). ... f

Unifex

New Member
Immer wenn ich gewisse Einträge in meine my.cnf mache bekomme ich die als Überschrift geschriebene Fehlermeldung.

Nicht bei allen Einträgen aber wenn ich folgende beide Einträge einfügen will kommt die Fehlermeldung beim Start des MySql Server.

log_slow_queries = /var/log/mysql/mysql-slow.log
innodb_data_file_path = ibdata1:10G:autoextend


Die mysqld.pid ist jedenfalls da, wo sie laut Conf sein sollte.

Jemand eine Idee, wie ich das Problem lösen kann?
 
Es muss im log eigentlich mehr stehen, d.h. die eigentliche Fehlermeldung.

Das die PID nicht geupdated wird ist ein Folgefehler.

ggf. Zugriffsrechteprobleme auf
/var/log/mysql/mysql-slow.log?

kleiner Tipp, wenn dein mysql per upstart gestartet wird liegt das logfile, in das Du schauen musst, hier:

/var/log/upstart/mysql.log
 
/var/log/upstart/mysql.log

Das Verzeichnis upstart gibt es bei mir nicht.

Das komische ist auch, das er jetzt die Datei mysqld.sock und mysqld.pid aus dem Verzeichnis gelöscht hat und nicht wieder anlegt beim Start.

Starte ich den MySQL Server, so erhalte ich diese Ausgabe:

Code:
ps aux | grep mysql

root      7903  0.0  0.0   4176   724 pts/0    S    09:49   0:00 /bin/sh /opt/mysql/server-5.6/bin/mysqld_safe --datadir=/opt/mysql/server-5.6/data --pid-file=/opt/mysql/server-5.6/data/Debian-70-wheezy-64-minimal.pid
mysql     8005  4.3  1.3 779396 449292 pts/0   Sl   09:49   0:00 /opt/mysql/server-5.6/bin/mysqld --basedir=/opt/mysql/server-5.6 --datadir=/opt/mysql/server-5.6/data --plugin-dir=/opt/mysql/server-5.6/lib/plugin --user=mysql --log-error=/opt/mysql/server-5.6/data/Debian-70-wheezy-64-minimal.err --pid-file=/opt/mysql/server-5.6/data/Debian-70-wheezy-64-minimal.pid
root      8046  0.0  0.0   9228   880 pts/0    S+   09:49   0:00 grep mysql

Hier mal meine my.cnf:

Code:
[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 16G

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
basedir		= /opt/mysql/server-5.6
datadir = /opt/mysql/server-5.6/data
port = 3306
# server_id = .....
socket = /var/run/mysqld/mysqld.sock
pid-file = /var/run/mysqld/mysqld.pid
default-storage-engine = InnoDB
user		= mysql
tmpdir		= /tmp
tmp_table_size=32M
max_heap_table_size=32M
key_buffer = 2048M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 256
myisam-recover = BACKUP
read_rnd_buffer_size = 256K
max_connections = 300
table_open_cache = 5000
sort_buffer_size = 256K
read_buffer_size = 256K
key_buffer_size = 4096M
join_buffer_size = 2048K
query_cache_limit	= 1024M
query_cache_size = 2048M
query_cache_type=1
#log_slow_queries	= /var/log/mysql/mysql-slow.log
long_query_time = 2
expire_logs_days = 10
max_binlog_size = 100M
innodb_file_per_table
#innodb_data_file_path = ibdata1:10G:autoextend
innodb_log_buffer_size=16M
innodb_flush_method=O_DIRECT
innodb_flush_log_at_trx_commit=1
innodb_log_file_size = 4GB
innodb_buffer_pool_size = 16G
innodb_additional_mem_pool_size = 8M
innodb_support_xa = 0
innodb_lock_wait_timeout = 100


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Irgendwie ist der Wurm drin.
 
Code:
ps aux | grep mysql
root      7903  0.0  0.0   4176   724 pts/0    S    09:49   0:00 /bin/sh /opt/mysql/server-5.6/bin/mysqld_safe --datadir=/opt/mysql/server-5.6/data --pid-file=/opt/mysql/server-5.6/data/Debian-70-wheezy-64-minimal.pid
mysql     8005  4.3  1.3 779396 449292 pts/0   Sl   09:49   0:00 /opt/mysql/server-5.6/bin/mysqld --basedir=/opt/mysql/server-5.6 --datadir=/opt/mysql/server-5.6/data --plugin-dir=/opt/mysql/server-5.6/lib/plugin --user=mysql --log-error=/opt/mysql/server-5.6/data/Debian-70-wheezy-64-minimal.err --pid-file=/opt/mysql/server-5.6/data/Debian-70-wheezy-64-minimal.pid
root      8046  0.0  0.0   9228   880 pts/0    S+   09:49   0:00 grep mysql

Aha, du hast ein Debian Wheezy und MySQL 5.6 aus Quellen übersetzt - jetzt wissen wir das auch... :-P

#log_slow_queries = /var/log/mysql/mysql-slow.log

Du bist sicher dass es /var/log/mysql überhaupt gibt? Der Rest deiner Installation scheint sich ja in /opt abzuspielen.

Fragen:
was steht in /opt/mysql/server-5.6/data/Debian-70-wheezy-64-minimal.err
was steht in /var/log/daemon.log
 
Aha, du hast ein Debian Wheezy und MySQL 5.6 aus Quellen übersetzt - jetzt wissen wir das auch... :-P



Du bist sicher dass es /var/log/mysql überhaupt gibt? Der Rest deiner Installation scheint sich ja in /opt abzuspielen.

Fragen:
was steht in /opt/mysql/server-5.6/data/Debian-70-wheezy-64-minimal.err
was steht in /var/log/daemon.log

So langsam komme ich hinter das "Geheimnis"

Im "....err" stehen tatsächlich Statusmeldungen.

Beispiel:
Code:
2013-08-10 11:42:03 5808 [ERROR] /opt/mysql/server-5.6/bin/mysqld: unknown variable 'log_slow_queries=/var/log/mysql/mysql-slow.log'
2013-08-10 11:42:03 5808 [ERROR] Aborting

Sobald er auf nur eine kleine Fehlermeldung trifft, löscht er selbständig die mysqld.pid und mysqld.sock.

Darum ist dann natürlich auch kein Zugriff mehr.

Jetzt habe ich die Log Geschichte mal auskommentiert, weil die offenichtlich ja anders gemacht werden muss und gleichzeitig Ibdata und logs gelöscht, damit er neue anlegen kann.

Ausgabe im .err File:

Code:
130810 11:55:40 mysqld_safe Starting mysqld daemon with databases from /opt/mysql/server-5.6/data
2013-08-10 11:55:40 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2013-08-10 11:55:40 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-08-10 11:55:40 6486 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2013-08-10 11:55:40 6486 [Note] Plugin 'FEDERATED' is disabled.
2013-08-10 11:55:40 6486 [Note] InnoDB: The InnoDB memory heap is disabled
2013-08-10 11:55:40 6486 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-08-10 11:55:40 6486 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-08-10 11:55:40 6486 [Note] InnoDB: Using Linux native AIO
2013-08-10 11:55:40 6486 [Note] InnoDB: Using CPU crc32 instructions
2013-08-10 11:55:40 6486 [Note] InnoDB: Initializing buffer pool, size = 16.0G
2013-08-10 11:55:41 6486 [Note] InnoDB: Completed initialization of buffer pool
2013-08-10 11:55:41 6486 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2013-08-10 11:55:41 6486 [Note] InnoDB: Setting file ./ibdata1 size to 10240 MB
2013-08-10 11:55:41 6486 [Note] InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000 4100 4200 4300 4400 4500 4600 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 5900 6000 6100 6200 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9800 9900 10000 10100 10200
2013-08-10 11:56:03 6486 [Note] InnoDB: Setting log file ./ib_logfile101 size to 4096 MB
InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000
2013-08-10 11:56:12 6486 [Note] InnoDB: Setting log file ./ib_logfile1 size to 4096 MB
InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000
2013-08-10 11:56:21 6486 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2013-08-10 11:56:21 6486 [Warning] InnoDB: New log files created, LSN=45782
2013-08-10 11:56:21 6486 [Note] InnoDB: Doublewrite buffer not found: creating new
2013-08-10 11:56:21 6486 [Note] InnoDB: Doublewrite buffer created
2013-08-10 11:56:21 6486 [Note] InnoDB: 128 rollback segment(s) are active.
2013-08-10 11:56:21 6486 [Warning] InnoDB: Creating foreign key constraint system tables.
2013-08-10 11:56:21 6486 [Note] InnoDB: Foreign key constraint system tables created
2013-08-10 11:56:21 6486 [Note] InnoDB: Creating tablespace and datafile system tables.
2013-08-10 11:56:21 6486 [Note] InnoDB: Tablespace and datafile system tables created.
2013-08-10 11:56:21 6486 [Note] InnoDB: Waiting for purge to start
2013-08-10 11:56:21 6486 [Note] InnoDB: 5.6.13 started; log sequence number 0
2013-08-10 11:56:21 6486 [Note] Server hostname (bind-address): '*'; port: 3306
2013-08-10 11:56:21 6486 [Note] IPv6 is available.
2013-08-10 11:56:21 6486 [Note]   - '::' resolves to '::';
2013-08-10 11:56:21 6486 [Note] Server socket created on IP: '::'.
2013-08-10 11:56:21 6486 [Note] Event Scheduler: Loaded 0 events
2013-08-10 11:56:21 6486 [Note] /opt/mysql/server-5.6/bin/mysqld: ready for connections.
Version: '5.6.13'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

Abgesehen von den Warnungen oben, die ich mir mal anschauen muss, scheint es also so zu sein, dass er bei einem Problem in der my.cnf sofort die Dateien mysqld.pid und mysqld.sock löscht.

Und so kommt beim Neustart dann natürlich auch die Fehlermeldung von oben zustande. Ist nichts da was man updaten könnte.

Das Verhalten kenne ich aus früheren Versionen so nicht.
 
Du solltest meiner Meinung nach lieber mit einer konservativen my.cnf beginnen und diese ausschliesslich bei Bedarf und gemäss Doku / best-practice step-by-step anpassen.

Hier mal mein Vorschlag für eine für Dich vermutlich ausreichende my.cnf
Code:
[client]
port                            = 3306
socket                          = /var/run/mysqld/mysqld.sock

[mysql]
prompt                          = \u@\h [\d]>\_
no_auto_rehash

[mysqld]
user                            = mysql
port                            = 3306
socket                          = /var/run/mysqld/mysqld.sock
bind-address                    = 127.0.0.1
basedir                         = /opt/mysql/server-5.6
datadir                         = /opt/mysql/server-5.6/data
tmpdir                          = /var/tmp/mysql
secure-file-priv                = /var/tmp/mysql
log-bin                         = /var/log/mysql/mysql-bin
server-id                       = 1
back_log                        = 500
sync_binlog                     = 1
binlog_cache_size               = 4M
binlog_stmt_cache_size          = 4M
max_binlog_size                 = 500M
binlog-format                   = MIXED
expire_logs_days                = 30
slow-query-log                  = 1
slow-query-log-file             = /var/log/mysql/slow-query.log
lower_case_table_names          = 1
safe-user-create                = 1
delay-key-write                 = ALL
myisam-recover                  = FORCE,BACKUP
sql_mode                        = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
key_buffer_size                 = 64M
max_allowed_packet              = 64M
max_heap_table_size             = 64M
tmp_table_size                  = 64M
thread_stack                    = 192K
table_cache                     = 2048
table_open_cache                = 2048
table_definition_cache          = 2048
query_cache_type                = 1
query_cache_size                = 64M
thread_cache_size               = 150
max_connections                 = 200
ft_max_word_len                 = 20
ft_min_word_len                 = 3
long_query_time                 = 1
local-infile                    = 0
log-warnings                    = 2
log-queries-not-using-indexes
skip-external-locking
skip-symbolic-links
innodb_thread_concurrency       = 8
innodb_buffer_pool_size         = 4G
innodb_buffer_pool_instances    = 4
innodb_additional_mem_pool_size = 16M
innodb_data_home_dir            = /opt/mysql/server-5.6/data
innodb_log_group_home_dir       = /opt/mysql/server-5.6/data
innodb_data_file_path           = ibdata1:2000M;ibdata2:10M:autoextend
innodb_flush_method             = O_DIRECT
innodb_log_file_size            = 256M
innodb_log_buffer_size          = 16M
innodb_log_files_in_group       = 2
innodb_flush_log_at_trx_commit  = 2
innodb_max_dirty_pages_pct      = 90
innodb_file_per_table           = 1
innodb_purge_threads            = 1
innodb_strict_mode              = 1
innodb_old_blocks_time          = 1000
innodb_stats_on_metadata        = 0
innodb_write_io_threads         = 8
innodb_read_io_threads          = 8
innodb_io_capacity              = 200
innodb_open_files               = 8192

[mysqldump]
max_allowed_packet              = 64M
quote_names
quick

[isamchk]
key_buffer_size                 = 256M

[myisamchk]
key_buffer_size                 = 256M

[mysqlhotcopy]
interactive_timeout

Deine Fehlermeldungen wurden von falsch geschriebenen beziehungsweise falsch zugewiesenen Optionen verursacht.
 
Danke für die Settings. Das muss natürlich alles mal in der Praxis ausprobiert werden.

Hosten soll der Server 3 -4 Foren.

Jedes Forum hat so eine Datenbankgröße von ca. 1 GB.
Fast nur Innodb Tabellen.

Ca. 30.000 bis 40.000 Besucher am Tag an normalen Tagen.
 
Back
Top