Hi Team! Does fleetdm support using Unix Domain So...
# fleet
s
Hi Team! Does fleetdm support using Unix Domain Sockets (UDS) to connect to mysql instead of using the TCP stack. If yes, how does we configure it
g
Hey Smaran! I've just been checking our docs, but can't find a reference to it. However, it is referenced here: https://github.com/fleetdm/fleet/blob/7ea4d5f1d6ef2fa44585e4fdfe78fb8f98cd164a/server/config/config.go#L1040 and here: https://github.com/fleetdm/fleet/issues/6608#issuecomment-1182021625. So, you should be able to set your environment variable of
FLEET_MYSQL_PROTOCOL
as
unix
, or
--mysql_protocol=unix --mysql_address=/var/run/mysqld/mysqld.sock
However, I'm still new myself, and this answer may not be entirely correct. It's not something I've tested personally. But I hope that helps!
s
I shall try this out, thank you!
👍 1
j
Heya, this is how we currently use Fleet (in Cloud Run). you can then pass the path to the socket as
FLEET_MYSQL_ADDRESS
❤️ 1
s
Gotcha, I did try this and it does work, Thank you! Is there a way to pass
FLEET_MYSQL_PROTOCOL
in the config file instead of env var or cli arg
g
Hey Smaran, Yes, you should be able to use protocol in the config file under mysql:
Copy code
mysql:
  protocol: unix
s
Gotcha, thanks!