Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Dec 2009 18:41:12 +0200
From:      Manolis Tzanidakis <mtzanidakis@gmail.com>
To:        freebsd-jail@freebsd.org
Subject:   Cant't access mysql.sock (running on a jail) from a separate jail
Message-ID:  <924B5EF7-AE3E-4A9E-B0D6-2FAC0151570A@gmail.com>

next in thread | raw e-mail | index | archive | help
Hello all,
maybe this is already answered, but searching the list's archives
was not working at the moment.

Anyway, I've got a server running 8.0-RELEASE with various
jails, all setup with ezjail. One jail is running mysql and another
is running apache.
I have a directory /usr/jails/mysqltmp (owned by mysql:mysql)
on the host system, which is mounted in both jails as /mysqltmp  with:

/etc/fstab.mysqljail:
/usr/jails/mysqltmp /usr/jails/mysqljail/mysqltmp nullfs rw 0 0

/etc/fstab.apachejail:
/usr/jails/mysqltmp /usr/jails/mysqlapache/mysqltmp nullfs ro 0 0
(tried it also with 'rw', same results)

I've setup my.cnf in mysqljail to write the mysql.sock socket in
/mysqltmp and I can access mysql from this jail without problems,
as expected. 
On the apachejail the socket shows up in /mysqltmp, however I can't
connect:

# mysql -S /mysqltmp/mysql.sock -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through 
socket '/mysqltmp/mysql.socket' (2)

I really need this because this setup will be replicated in a server farm
with CARP and it will be serious PITA to modify all my web applications to
access mysql using IP, besides the obvious performance advantages
of UNIX sockets for MySQL.

Any suggestions?

Best,
Manolis

--
Manolis Tzanidakis
mtzanidakis@gmail.com







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?924B5EF7-AE3E-4A9E-B0D6-2FAC0151570A>