Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support using Redis with UDS #352

Closed
niklasmohrin opened this issue Oct 7, 2024 · 1 comment · Fixed by #353
Closed

Support using Redis with UDS #352

niklasmohrin opened this issue Oct 7, 2024 · 1 comment · Fixed by #353

Comments

@niklasmohrin
Copy link

Redis has the option to connect via unix domain sockets. I have such a setup running with

services.redis."r1" = {
    enable = true;
    port = 0; # disable listening via TCP
    extraConfig = ''
      locale-collate "C"
      unixsocket ../redis.socket
      unixsocketperm 777
    '';
  };
};
settings.processes."r1".readiness_probe.exec.command = lib.mkForce "true";

The ../redis.socket places the socket in the data directory instead of next to the dump.rdb file. The locale-collate setting should be unneeded for this, but I haven't checked if it is relevant for UDS.

The change in the readiness probe is needed because the current command, ${config.package}/bin/redis-cli -p ${toString config.port} ping relies on TCP being active. If setup properly, this should probably perform the same ping, but through the socket.

It would be nice if there would be an option like uds = "data/redis.socket" to take care of all of this. Please let me know what you think :)

@shivaraj-bh
Copy link
Member

Could you check if #353 works for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants