jailing MYSQL error

2011-01-02 Thread dsc fbsd.current
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 th

RE: jailing MYSQL error [SOLVED]

2011-01-03 Thread dsc fbsd.current
Hello,

SOLVED ! But the problem was in another place.

Host world and kernel were build with src r215329 (patched with
head-v28-v2.patch from Martin Matuska), but ezjail buildworld was made using
more recent sources with no patch (in fact I was trying to apply the same
patch to more recent sources, but it doesn't work ... but that's another
issue).
Mysql seems to have problems in this case (kernel and world based on
different versions of src). But other stuff work just fine.

So, first I've made a jail (standard steps from the handbook) using the same
src r215329 (patched for zfs v28). Mysql works fine under this jail.

After this step, I've updated the ezjail basejail (ezjail-admin update -i).
Now, Mysql works just fine under ezjail too.

Thanks for your time and help.

Regards,
Lulu

-Original Message-
From: J. Hellenthal [mailto:jhellent...@gmail.com] On Behalf Of J.
Hellenthal
Sent: Monday, January 03, 2011 12:24 AM
To: dsc fbsd.current
Cc: freebsd-current@freebsd.org
Subject: Re: jailing MYSQL error

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Hello,

Just to be sure as the long detailed information that you laid before can
lead to confusion, lets take this one step at a time.

Assuming all your bases are covered and it sinks down to a permissions issue
try this:

chown root:wheel /path/to/jail/tmp /path/to/jail/var/tmp chmod 1777
/path/to/jail/tmp /path/to/jail/var/tmp rm -rf /path/to/jail/var/db/mysql

- -Login to the jail here-
make sure that rc.conf* only contains mysql_enable="YES"
service mysql-server start

ls -ld /var/db/mysql should convey mode 700 or drwx-- and uid/88
gid/88 mysql/mysql



At this point your mysql server should be running and fully working.

Another thing to make sure you eliminate just in case... would be any my.cnf
files in /etc or /usr/local/etc


Good luck

- -- 

Regards,

 jhell,v
 JJH48-ARIN
-BEGIN PGP SIGNATURE-

iQEcBAEBAgAGBQJNIPrkAAoJEJBXh4mJ2FR+fLEH/0N91782PKGna/DZNoRF4hWJ
8tTh9bPFaHGjRu2ITC08gFJBLaAK8hE5oh9Tg5k6eysyzjE1EEHXUAJaL6B8Rg+N
w5m66OGtvunX8JQqwu8d6ulDLk4EHex7Aaf0G2wfpW2OBDP4oCbeXxaakDJp+dzB
GGf4a4ezODgQsr8Hxva71bgesfQ6a1BEirf/pwGcaQs9y1lCgoRK6M+iKDKqruLM
Vyp4oNCHX52GTKa/cpx2VveZG/F21RabYtCVrBhU3Xq0EbDeDkiP2JjZt0xNPJVA
dnCfCtTRECeruqlFHekH7MayF7uZ5nZIjJ3SEA6xHTCyt3PVC7oxr1NCmaETWJQ=
=HFv4
-END PGP SIGNATURE-

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"