killtec
Goto Top

Raspberry PI als Content Filter - MySQL startet nicht

Hallo zusammen,
ich habe auf einem PI B+ ein opensuse installiert. Nun habe ich die Dienste apache, mysql und squid installiert. Squid startet automatisch. Apache2 und Mysql nicht.
1. Frage: Wie bekomme ich die Dienste Apache2 und MySQL automatisch zum starten?

2. Bekomme ich folgende Meldung beim start von MySQL:
linux:/etc/rc.d # rcmysql start
/usr/sbin/rcmysql: line 19: Default-Start:: command not found
redirecting to systemctl start mysql
Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.  
linux:/etc/rc.d # journalctl -xn
-- Logs begin at Thu 1970-01-01 01:00:05 CET, end at Tue 2014-10-28 18:30:20 CET. --
Oct 28 18:30:01 linux /usr/sbin/cron[2777]: pam_unix(crond:session): session opened for user root by (uid=0)
Oct 28 18:30:02 linux systemd[1]: Starting Session c2 of user root.
-- Subject: Unit session-c2.scope has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-c2.scope has begun starting up.
Oct 28 18:30:02 linux systemd[1]: Started Session c2 of user root.
-- Subject: Unit session-c2.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-c2.scope has finished starting up.
--
-- The start-up result is done.
Oct 28 18:30:02 linux /USR/SBIN/CRON[2777]: pam_unix(crond:session): session closed for user root
Oct 28 18:30:20 linux mysql[2413]: Starting service MySQL warning: /var/run/mysql/mysql.sock didn't appear within 30 seconds  
Oct 28 18:30:20 linux mysql[2413]: chmod: cannot access '/var/run/mysql/mysqld.pid': No such file or directory  
Oct 28 18:30:20 linux mysql[2413]: ..failed
Oct 28 18:30:20 linux systemd[1]: mysql.service: control process exited, code=exited status=1
Oct 28 18:30:20 linux systemd[1]: Failed to start LSB: Start the MySQL database server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
--
-- Unit mysql.service has failed.
--
-- The result is failed.
Oct 28 18:30:20 linux systemd[1]: Unit mysql.service entered failed state.

habe schon im Netz gegoogelt, jedoch nichts passendes gefunden.

Danke.

Gruß

Content-Key: 253269

Url: https://administrator.de/contentid/253269

Ausgedruckt am: 28.03.2024 um 17:03 Uhr

Mitglied: alaim89
alaim89 28.10.2014 um 19:29:36 Uhr
Goto Top
Der automatische Start beim apache2 und mysql müsste folgender Befehl sein: chkconfig -a apache2 && chkconfig -a mysql

Gruß

alaim89
Mitglied: killtec
killtec 28.10.2014 um 20:18:35 Uhr
Goto Top
Hi,
das hat schon mal geklappt face-smile Nur startet der mysql dienst noch nicht. (Fehler wie oben).

Aber dafür schon mal Danke face-smile

Gruß
Mitglied: Gersen
Gersen 29.10.2014 um 11:09:19 Uhr
Goto Top
Hallo,

um dem MySQL-Problem auf die Spur zu kommen, empfehle ich Dir, das Fehler-Logging einzuschalten. In /etc/my.cnf (im Bereich "[mysqld]" bzw. "[mysqld_safe]") die Zeile ergänzen:
log_error=/var/log/mysql/mysql_error.log
(schauen, ob das Verzeichnis /var/log/mysql existiert und "mysql" gehört)
, den Dienst neu starten und das Log sichten. Evtl. hier posten.

Gruß,
Gersen
Mitglied: killtec
killtec 29.10.2014 aktualisiert um 11:15:32 Uhr
Goto Top
Hi gersen,
den Bereich [mysql_safe] gibt es bei mir nicht. Ich habe den Eintrag in der config ergänzt (ohne den mysql_safe bereich).
Der Ordner gehört mysql (drwxrwx---).
Die errorlog ist folgende:
141029 11:12:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-10-29 11:12:12 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-10-29 11:12:14 3183 [Warning] Buffered warning: Performance schema disabled (reason: init failed).

2014-10-29 11:12:14 3183 [Note] Plugin 'FEDERATED' is disabled.  
2014-10-29 11:12:14 3183 [ERROR] Function 'archive' already exists  
2014-10-29 11:12:14 3183 [ERROR] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.  
2014-10-29 11:12:17 3183 [Note] InnoDB: The InnoDB memory heap is disabled
2014-10-29 11:12:17 3183 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-10-29 11:12:17 3183 [Note] InnoDB: Compressed tables use zlib 1.2.8
2014-10-29 11:12:17 3183 [Note] InnoDB: Using Linux native AIO
2014-10-29 11:12:17 3183 [Note] InnoDB: Not using CPU crc32 instructions
2014-10-29 11:12:18 3183 [Note] InnoDB: Initializing buffer pool, size = 128.0M
141029 11:12:20 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended

Gruß
Mitglied: Gersen
Gersen 29.10.2014 aktualisiert um 13:16:47 Uhr
Goto Top
Ich habe den Verdacht, dass für MySQL zu wenig Speicher zur Verfügung steht.

Schau mal zum Beispiel hier, wie man MySQL für Low-RAM-Rechner konfigurieren kann/muss.

Gruß,
Gersen

PS: Das Verzeichnis /var/run/mysql gibt es aber, oder? - Und es gehört mysql?
Mitglied: killtec
killtec 31.10.2014 um 12:45:32 Uhr
Goto Top
Hi,
funktioniert leider nicht face-sad

Config:
[mysqld]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K

# For low memory, Berkeley DB should not be used so keep skip-bdb uncommented unless required
skip-bdb

# For low memory, InnoDB should not be used so keep skip-innodb uncommented unless required
skip-innodb

# 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/
#innodb_log_arch_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

[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

Fehler:
linux:/etc # journalctl -xn
-- Logs begin at Thu 1970-01-01 01:00:05 CET, end at Fri 2014-10-31 12:45:01 CET. --
Oct 31 12:39:50 linux mysql[2547]: Starting service MySQL warning: /var/lib/mysql/mysql.sock didn't appear within 30 seconds  
Oct 31 12:39:50 linux mysql[2547]: chmod: cannot access '/var/run/mysql/mysqld.pid': No such file or directory  
Oct 31 12:39:50 linux mysql[2547]: ..failed
Oct 31 12:39:50 linux systemd[1]: mysql.service: control process exited, code=exited status=1
Oct 31 12:39:50 linux systemd[1]: Failed to start LSB: Start the MySQL database server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
--
-- Unit mysql.service has failed.
--
-- The result is failed.
Oct 31 12:39:50 linux systemd[1]: Unit mysql.service entered failed state.
Oct 31 12:45:01 linux /usr/sbin/cron[3113]: pam_unix(crond:session): session opened for user root by (uid=0)
Oct 31 12:45:01 linux systemd[1]: Starting Session c4 of user root.
-- Subject: Unit session-c4.scope has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-c4.scope has begun starting up.
Oct 31 12:45:01 linux systemd[1]: Started Session c4 of user root.
-- Subject: Unit session-c4.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-c4.scope has finished starting up.
--
-- The start-up result is done.
Oct 31 12:45:01 linux /USR/SBIN/CRON[3113]: pam_unix(crond:session): session closed for user root
linux:/etc #

Die Verzeichnisse haben die Berechtigungen dafür.

Gruß
Mitglied: Gersen
Gersen 01.11.2014 aktualisiert um 19:41:59 Uhr
Goto Top
Die Logs des Init-Systems helfen nicht weiter. Gibt es eine Datei /var/log/mysql/mysqld.log? - Wenn ja, was steht dort?

Und (auch wenn es unwahrscheinlich ist) prüfe bitte, ob MySQL vielleicht schon läuft:
ps -ef|grep mysql
Mitglied: killtec
killtec 01.11.2014 um 21:11:59 Uhr
Goto Top
Hi,
also das ps ergab folgendes:
linux:~ # ps -ef | grep mysql
root      3604  3542  0 21:05 pts/1    00:00:00 grep --color=auto mysql
linux:~ # ps -ef | grep mysqld
root      3606  3542  0 21:05 pts/1    00:00:00 grep --color=auto mysqld
linux:~ #

mysql_error.log:
141029 11:12:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-10-29 11:12:12 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-10-29 11:12:14 3183 [Warning] Buffered warning: Performance schema disabled (reason: init failed).

2014-10-29 11:12:14 3183 [Note] Plugin 'FEDERATED' is disabled.  
2014-10-29 11:12:14 3183 [ERROR] Function 'archive' already exists  
2014-10-29 11:12:14 3183 [ERROR] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.  
2014-10-29 11:12:17 3183 [Note] InnoDB: The InnoDB memory heap is disabled
2014-10-29 11:12:17 3183 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-10-29 11:12:17 3183 [Note] InnoDB: Compressed tables use zlib 1.2.8
2014-10-29 11:12:17 3183 [Note] InnoDB: Using Linux native AIO
2014-10-29 11:12:17 3183 [Note] InnoDB: Not using CPU crc32 instructions
2014-10-29 11:12:18 3183 [Note] InnoDB: Initializing buffer pool, size = 128.0M
141029 11:12:20 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
141029 15:28:01 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141029 15:28:03 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
141029 16:19:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141029 16:19:57 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
141030 06:24:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-10-30 06:24:38 0 [Warning] option 'thread_stack': unsigned value 65536 adjusted to 131072  
2014-10-30 06:24:38 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-10-30 06:24:41 2228 [Warning] Buffered warning: Performance schema disabled (reason: init failed).

2014-10-30 06:24:42 2228 [Note] Plugin 'FEDERATED' is disabled.  
2014-10-30 06:24:43 2228 [ERROR] Function 'archive' already exists  
2014-10-30 06:24:43 2228 [ERROR] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.  
2014-10-30 06:24:48 2228 [Note] InnoDB: The InnoDB memory heap is disabled
2014-10-30 06:24:48 2228 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-10-30 06:24:48 2228 [Note] InnoDB: Compressed tables use zlib 1.2.8
2014-10-30 06:24:48 2228 [Note] InnoDB: Using Linux native AIO
2014-10-30 06:24:48 2228 [Note] InnoDB: Not using CPU crc32 instructions
2014-10-30 06:24:51 2228 [Note] InnoDB: Initializing buffer pool, size = 128.0M
141030 06:24:54 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
141031 06:53:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-10-31 06:53:33 0 [Warning] option 'thread_stack': unsigned value 65536 adjusted to 131072  
2014-10-31 06:53:34 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-10-31 06:53:39 2477 [Warning] Buffered warning: Performance schema disabled (reason: init failed).

2014-10-31 06:53:39 2477 [Note] Plugin 'FEDERATED' is disabled.  
2014-10-31 06:53:40 2477 [ERROR] Function 'archive' already exists  
2014-10-31 06:53:40 2477 [ERROR] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.  
2014-10-31 06:53:45 2477 [Note] InnoDB: The InnoDB memory heap is disabled
2014-10-31 06:53:45 2477 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-10-31 06:53:45 2477 [Note] InnoDB: Compressed tables use zlib 1.2.8
2014-10-31 06:53:45 2477 [Note] InnoDB: Using Linux native AIO
2014-10-31 06:53:45 2477 [Note] InnoDB: Not using CPU crc32 instructions
2014-10-31 06:53:46 2477 [Note] InnoDB: Initializing buffer pool, size = 128.0M
141031 06:53:48 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
141031 12:05:33 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-10-31 12:05:35 0 [Warning] option 'thread_stack': unsigned value 65536 adjusted to 131072  
2014-10-31 12:05:37 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-10-31 12:05:37 2247 [Warning] Buffered warning: Performance schema disabled (reason: init failed).

2014-10-31 12:05:37 2247 [Note] Plugin 'FEDERATED' is disabled.  
2014-10-31 12:05:37 2247 [ERROR] Function 'archive' already exists  
2014-10-31 12:05:37 2247 [ERROR] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.  
2014-10-31 12:05:38 2247 [Note] InnoDB: The InnoDB memory heap is disabled
2014-10-31 12:05:38 2247 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-10-31 12:05:38 2247 [Note] InnoDB: Compressed tables use zlib 1.2.8
2014-10-31 12:05:38 2247 [Note] InnoDB: Using Linux native AIO
2014-10-31 12:05:38 2247 [Note] InnoDB: Not using CPU crc32 instructions
2014-10-31 12:05:38 2247 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(135987200 bytes) failed; errno 12
2014-10-31 12:05:38 2247 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2014-10-31 12:05:38 2247 [ERROR] Plugin 'InnoDB' init function returned error.  
2014-10-31 12:05:38 2247 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.  
2014-10-31 12:05:38 2247 [ERROR] /usr/sbin/mysqld: unknown variable 'table_cache=4'  
2014-10-31 12:05:38 2247 [ERROR] Aborting

2014-10-31 12:05:38 2247 [Note] Binlog end
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'partition'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_SYS_TABLES'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_FT_CONFIG'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_FT_DELETED'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_METRICS'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_CMPMEM'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_CMP_RESET'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_CMP'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_LOCKS'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'INNODB_TRX'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'BLACKHOLE'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'ARCHIVE'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'MyISAM'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'CSV'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'MEMORY'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'MRG_MYISAM'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'sha256_password'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'mysql_old_password'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'mysql_native_password'  
2014-10-31 12:05:38 2247 [Note] Shutting down plugin 'binlog'  
2014-10-31 12:05:38 2247 [Note] /usr/sbin/mysqld: Shutdown complete

141031 12:05:39 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
141031 12:14:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-10-31 12:14:07 0 [Warning] option 'thread_stack': unsigned value 65536 adjusted to 131072  
2014-10-31 12:14:08 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
141031 12:14:12 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended

Ich habe den Conten Filter getestet, er funktioniert auch ohne den mysql, so lasse ich ihn einfach aus.
Wenn du noch eine Idee hast, lass es mich wissen, ich versuche dann das weiter zu debuggen face-smile

Schönes Wochenende

Gruß
Mitglied: Gersen
Gersen 01.11.2014 aktualisiert um 23:45:23 Uhr
Goto Top
Na, da
InnoDB: Cannot allocate memory for the buffer pool
haben wir doch den Übeltäter.
Der DB-Engine fehlt Arbeitsspeicher. Es gibt zwei Lösungsansätze bzw. -versuche:

1. Versuch mal, in der Konfigurationsdatei (my.cnf) die Option
innodb_use_sys_malloc = 0
unterzubringen.

2. In der Konfig den Wert für "innodb_buffer_pool_size" (niedriger) zu setzen.

3. Andernfalls wäre SWAP noch eine Möglichkeit....

Auch 'n schönes WE!