Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: Verplaatsen van MySQL data files  (gelezen 606 keer)

Offline willebil

  • Lid
Verplaatsen van MySQL data files
« Gepost op: 2013/02/16, 19:30:19 »
Ik heb een ZFS pool (zfs-root) aangemaakt en wil de mysql data files daarheen verplaatsen. Ik voer de volgende stappen uit:

Citaat
stop mysql
mkdir /zfs-root/var/lib/mysql
cp -R /var/lib/mysql/mysql /zfs-root/var/lib/mysql
chown -R mysql:mysql /zfs-root/var/lib/mysql

De volgende entry wordt in /etc/mysql/my.cnf aangepast
Citaat
datadir=/zfs-root/var/lib/mysql

Als laatste pas ik in de apparmor settings van mysql de data directorty acces aan, herstart apparmor en als laatste start ik mysql (start mysql) en krijg de volgende  melding:

Citaat
Job failed to start

Iemand enig idee wat hier fout gaat?

Offline Johan van Dijk

  • Administrator
    • johanvandijk
Re: Verplaatsen van MySQL data files
« Reactie #1 Gepost op: 2013/02/16, 20:01:01 »
Staat de reden misschien in 1 van je logs? Kijk eens in /var/log/syslog of de verschillende /var/log/mysql* bestanden.

Re: Verplaatsen van MySQL data files
« Reactie #2 Gepost op: 2013/02/16, 23:33:54 »
Ja, cp -R kopieert wel bestanden maar je mist alle meta-informatie zoals permissies en ownership. Het is beter om cp -a te gebruiken.

Offline willebil

  • Lid
Re: Verplaatsen van MySQL data files
« Reactie #3 Gepost op: 2013/02/19, 20:40:32 »
Ik heb de acties herhaald, en de kopie gedaan met de -a optie, rechten gecontroleerd en die staan goed. Probleem blijft bestaand, volgende entry is te vinden in /var/log/mysql/error.log.

Citaat
130219 20:35:12 [Note] Plugin 'FEDERATED' is disabled.
130219 20:35:12 InnoDB: The InnoDB memory heap is disabled
130219 20:35:12 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130219 20:35:12 InnoDB: Compressed tables use zlib 1.2.7
130219 20:35:12 InnoDB: Using Linux native AIO
130219 20:35:12 InnoDB: Initializing buffer pool, size = 128.0M
130219 20:35:12 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
130219 20:35:12  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
130219 20:35:12  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
130219 20:35:12  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
130219 20:35:12  InnoDB: Operating system error number 22 in a file operation.
InnoDB: Error number 22 means 'Invalid argument'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: File name ./ib_logfile0
InnoDB: File operation call: 'aio write'.
InnoDB: Cannot continue operation.
130219 20:35:13 [Note] Plugin 'FEDERATED' is disabled.
130219 20:35:13 InnoDB: The InnoDB memory heap is disabled
130219 20:35:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130219 20:35:13 InnoDB: Compressed tables use zlib 1.2.7
130219 20:35:13 InnoDB: Using Linux native AIO
130219 20:35:13 InnoDB: Initializing buffer pool, size = 128.0M
130219 20:35:13 InnoDB: Completed initialization of buffer pool
130219 20:35:13 InnoDB: highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/error-creating-innodb.html
130219 20:35:13 [ERROR] Plugin 'InnoDB' init function returned error.
130219 20:35:13 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130219 20:35:13 [ERROR] Unknown/unsupported storage engine: InnoDB
130219 20:35:13 [ERROR] Aborting
130219 20:35:13 [Note] /usr/sbin/mysqld: Shutdown complete

Ik heb zelf het vermoeden dat apparmor in de weg zit, maar weet het niet zeker. Volgende melding kom ik tegen in /var/log/syslog

Citaat
Feb 19 20:35:14 ifs-01 kernel: [15130.806716] type=1400 audit(1361302514.056:29): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=15825 comm="apparmor_parser"

Iemand een idee/suggestie?

« Laatst bewerkt op: 2013/02/19, 20:42:37 door willebil »