美文网首页
redis.conf详解之unixsocket/unixsock

redis.conf详解之unixsocket/unixsock

作者: 小易哥学呀学 | 来源:发表于2021-11-21 22:32 被阅读0次

用法

 unixsocket  /usr/local/etc/redis.sock
 unixsocketperm 777

用途

unixsocket指定unix socket文件路径。
unixsocketperm指定unix socket文件权限。

客户端连接方式

$ redis-cli -s /usr/local/etc/redis.sock

注意事项

1.unixsocket选项没有默认值,不指定unixsocket就不会监听任何。
2.如果不指定unixsocketperm,unix socket文件将使用默认权限(umask相关)

相关源码

1318     mode_t umask;               /* The umask value of the process on startup */
1363     unsigned int unixsocketperm; /* UNIX socket permission (see mode_t) */

umask

umask命令指定在建立文件时预设的权限掩码。当创建一个新文件或目录时会用这个umask值搭配一个算法设置默认权限。

查看当前umask值
$ umask //一般是0022,第一位特殊先忽略
计算方式

一般来讲,文件的最大权限为666,文件不能给执行权限,要慎重。
一般来讲,目录的最大权限为777。

数字权限 字符 数字分解
最强大权限 777 rwxrwxrwx 421 421 421
umask权限 022 ----w--w- 000 020 020

上下相减得:

数字权限 字符 数字分解
755 drwxr-xr-x 421 401 401

原生注释

# Unix socket.
#
# Specify the path for the Unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
# unixsocket  /usr/local/etc/redis.sock
# unixsocketperm 777

相关文章

  • redis.conf详解之unixsocket/unixsock

    用法 用途 unixsocket指定unix socket文件路径。unixsocketperm指定unix so...

  • redis.conf详解之include

    1、用法: 在 $yourPath/redis.conf 文件中添加以下配置 2、用途: 模块化配置,比如所有服务...

  • redis.conf详解之module

    1、用法: 在 $yourPath/redis.conf 文件中添加以下配置 2、module制作: 准备工作 1...

  • redis.conf详解之timeout

    用法 单位是秒 用途 在timeout时间内如果没有数据交互,redis侧将关闭连接。没有数据交互:redis客户...

  • redis.conf详解之port

    用法 用途 指定redis监听的端口。 注意事项: 1.默认是63792.配置为0时将不监听任何端口(也就是服务没...

  • redis.conf详解之bind

    用法 绑定到本机的其中一个ip 绑定到本机的两个ip,如果10.0.0.1无效redis依旧可以启动。 绑定到本机...

  • redis.conf详解之daemonize

    用法 作为非守护进程运行 作为守护进程运行 注意事项: 默认情况下,Redis不作为守护进程运行。如果以守护进程运...

  • redis.conf详解之pidfile

    用法 注意事项: 如果pidfile文件创建失败,也不会影响redis启动。配置了daemonize或pidfil...

  • redis.conf详解之maxclients

    本文基于 redis_version:6.2.5 用法 设置一个redis实例支持的最大连接数。 注意事项: 默认...

  • Redis.conf 详解

    Redis.conf 详解 参考地址:https://www.cnblogs.com/zhang-ke/p/598...

网友评论

      本文标题:redis.conf详解之unixsocket/unixsock

      本文链接:https://www.haomeiwen.com/subject/ecfbtrtx.html