Hint: using sockets across jails
Published December 16th, 2006 in FreeBSD, userland, jails, Tips & TricksI want to use a socket (mysql) in multiple jails. Using nullfs to mount it in each jail where you want to use it does not work (bug in nullfs?). Using a hardlink (if the jails reside on the same FS) works. I hope this info safes a little bit of time in case someone tries to do the same.
The hostname MySQL sees in such a connection is “localhost”. Maybe this is obvious to one or another, but because jails don’t have a 127.0.0.1 it was not obvious to me.
I use unix2tcp (http://ahriman.bucharest.roedu.net/unix2tcp/) to use sockets in different file systems.
Using TCP certainly causes overhead, but IMO it is worth it since you can use the different IPs/hostnames for MySQL access control.
Hi,
what’s the benefit of using unix2tcp instead of the MySQL build-in TCP support?
Bye,
Alexander.