jailing MYSQL error

dsc fbsd.other dsc.fbsd.other at gmail.com
Sun Jan 2 15:06:03 UTC 2011


Hi.

 

I'm using ezjail standard config file, with a modified fstab file
(mount_nullfs ports to jail).

Cat /usr/local/etc/ezjail/j009_mysql2

export jail_j009_mysql2_hostname="j009_mysql2"

export jail_j009_mysql2_ip="xx.xx.xx.xx"

export jail_j009_mysql2_rootdir="/ezjail/j009_mysql2"

export jail_j009_mysql2_exec_start="/bin/sh /etc/rc"

export jail_j009_mysql2_exec_stop=""

export jail_j009_mysql2_mount_enable="YES"

export jail_j009_mysql2_devfs_enable="YES"

export jail_j009_mysql2_devfs_ruleset="devfsrules_jail"

export jail_j009_mysql2_procfs_enable="YES"

export jail_j009_mysql2_fdescfs_enable="YES"

export jail_j009_mysql2_image=""

export jail_j009_mysql2_imagetype=""

export jail_j009_mysql2_attachparams=""

export jail_j009_mysql2_attachblocking=""

export jail_j009_mysql2_forceblocking=""

export jail_j009_mysql2_zfs_datasets=""

export jail_j009_mysql2_cpuset=""

export jail_j009_mysql2_fib=""

 

My steps:

1.     Ezjail-admin onestart j009_mysql2

2.     Ezjail-admin console j009_mysql2

3.     Cd /usr/ports/database/mysql55-server && make install clean

4.     cp /usr/local/share/mysql/my-innodb-heavy-4G.cnf
/usr/local/etc/my.cnf (modified socket file path to
/var/db/mysql/mysql.sock, in both client and server lines)

5.     chown -R mysql:mysql ... for ... /tmp /var/tmp /var/db/mysql

6.     mysql_enable="YES" in jail rc.conf

7.     /usr/local/etc/rc.d/mysql-server start

8.     ...and NOTHING ... mysql-server scripts starts
/usr/local/bin/mysql_install_db (creates mysql and test folders in
/var/db/mysql ... but nothing else ... it's just running)

 

I had to kill everything.

 

After reading lots of webpages and trying all kind of stuff (including
http://devel.reinikainen.net/15, but without ssl stuff), I decided to
install MySQL on the host.

 

I've made the same steps (3-5 and 7 with "onestart" instead "start") and
used the same my-innodb-heavy-4G.cnf file

 

Everything went well.

Mysqld started, creating socket file and pid file; mysql_install_db had no
errors.

The log file says:

110102 18:07:06 mysqld_safe Starting mysqld daemon with databases from
/var/db/mysql

110102 18:07:06 [Note] Plugin 'FEDERATED' is disabled.

InnoDB: The InnoDB memory heap is disabled

InnoDB: Mutexes and rw_locks use GCC atomic builtins

InnoDB: Compressed tables use zlib 1.2.5

110102 18:07:06  InnoDB: Initializing buffer pool, size = 2.0G

110102 18:07:07  InnoDB: Completed initialization of buffer pool

110102 18:07:07  InnoDB: highest supported file format is Barracuda.

110102 18:07:07  InnoDB: 1.1.3 started; log sequence number 1595675

110102 18:07:07 [Note] Event Scheduler: Loaded 0 events

110102 18:07:07 [Note] /usr/local/libexec/mysqld: ready for connections.

Version: '5.5.7-rc-log'  socket: '/var/db/mysql/mysql.sock'  port: 3306
FreeBSD port: mysql-server-5.5.7

 

I didn't give up ... so I did:

9.       Rm -rf /var/db/mysql/* (in jail)

10.   Cp /var/db/mysql/mysql/* /ezjail/j009_mysql2/var/db/mysql/mysql (from
host to jail)

11.   Cp /var/db/mysql/performance_schema/*
/ezjail/j009_mysql2/var/db/mysql/performance_schema (from host to jail)

12.   Starting and entering the jail again

13.  usr/local/etc/rc.d/mysql-server start was started upon entering the
jail (did not create pid and socket file) but generated this log:

110102 17:03:05 [Note] Plugin 'FEDERATED' is disabled.

/usr/local/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)

110102 17:03:05 [ERROR] Can't open the mysql.plugin table. Please run
mysql_upgrade to create it.

InnoDB: The InnoDB memory heap is disabled

InnoDB: Mutexes and rw_locks use GCC atomic builtins

InnoDB: Compressed tables use zlib 1.2.5

110102 17:03:05  InnoDB: Initializing buffer pool, size = 2.0G

110102 17:03:06  InnoDB: Completed initialization of buffer pool

InnoDB: The first specified data file /innodb/ibdata1 did not exist:

InnoDB: a new database to be created!

110102 17:03:06  InnoDB: Setting file /innodb/ibdata1 size to 10 MB

InnoDB: Database physically writes the file full: wait...

110102 17:03:06  InnoDB: Log file ./ib_logfile0 did not exist: new to be
created

InnoDB: Setting log file ./ib_logfile0 size to 256 MB

InnoDB: Database physically writes the file full: wait...

InnoDB: Progress in MB: 100 200

110102 17:03:08  InnoDB: Log file ./ib_logfile1 did not exist: new to be
created

InnoDB: Setting log file ./ib_logfile1 size to 256 MB

InnoDB: Database physically writes the file full: wait...

InnoDB: Progress in MB: 100 200

110102 17:03:10  InnoDB: Log file ./ib_logfile2 did not exist: new to be
created

InnoDB: Setting log file ./ib_logfile2 size to 256 MB

InnoDB: Database physically writes the file full: wait...

InnoDB: Progress in MB: 100 200

14.   usr/local/etc/rc.d/mysql-server stop ... doesn't work because of
missing pid file (the same with "mysql_upgrade" suggested by the log file)

15.   './mysql/plugin.frm' file exists

16.   kill everything and run again usr/local/etc/rc.d/mysql-server start
with this result:

110102 17:07:40 [Note] Plugin 'FEDERATED' is disabled.

/usr/local/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)

110102 17:07:40 [ERROR] Can't open the mysql.plugin table. Please run
mysql_upgrade to create it.

InnoDB: The InnoDB memory heap is disabled

InnoDB: Mutexes and rw_locks use GCC atomic builtins

InnoDB: Compressed tables use zlib 1.2.5

110102 17:07:40  InnoDB: Initializing buffer pool, size = 2.0G

110102 17:07:40  InnoDB: Completed initialization of buffer pool

110102 17:07:40  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.1/en/error-creating-innodb.html

110102 17:07:40 [ERROR] Plugin 'InnoDB' init function returned error.

110102 17:07:40 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE
failed.

17.   But i have a pid and socket file

18.   "mysql_upgrade" doesn't work (hangs up)

19.   Also "mysql -u root" doesn't work (hangs up)

 

I've read http://dev.mysql.com/doc/refman/5.1/en/error-creating-innodb.html
and other related webpages.

I think is something related with permissions in jail, but I can't figure it
out.

 

So, my final hope is this email.

 

Anyone has any idea?

 

Thanks in advance!

Lulu

 

PS: I'm using:

-          FreeBSD Current (amd64)

-          Geli encryption

-          ZFS v28 with world and kernel build with src r215329 (patched
with head-v28-v2.patch from Martin Matuska)(the patch doesn't work on the
latest src)

-          Ports updated one week ago

-          Ezjail installed one week ago (buildworld with src updated one
week ago)

 



More information about the freebsd-ports mailing list