复述,如何配置

  介绍

复述,如何配置?这个问题可能是我们日常学习或工作经常见到的。希望通过这个问题能让你收获颇深。下面是小编给大家带来的参考内容,让我们一起来看看吧!

复述的配置文件位于复述,安装目录下,文件名为redis.conf (Windows名为redis.windows.conf)。

你可以通过配置命令查看或设置配置项。

复述,配置命令格式如下:

复述127.0.0.1:6379>配置得到CONFIG_SETTING_NAME 

实例:

复述127.0.0.1:6379>配置得到loglevel   “loglevel"   “notice"

使用*号获取所有配置项:

实例:

复述127.0.0.1:6379>配置得到*
  “dbfilename"
  “dump.rdb"
  “requirepass"
  ““
  “masterauth"
  ““
  “unixsocket"
  ““
  “logfile"
  ““
  “pidfile"
  “/var/运行/redis.pid"
  “maxmemory"
  “0”;
  “maxmemory-samples"
  “3”;
  “timeout"
  “0”;
  “tcp-keepalive"
  “0”;
  “auto-aof-rewrite-percentage"
  “100”;
  “auto-aof-rewrite-min-size"
  “67108864”;
  “hash-max-ziplist-entries"
  “512”;
  “hash-max-ziplist-value"
  “64”;
  “list-max-ziplist-entries"
  “512”;
  “list-max-ziplist-value"
  “64”;
  “set-max-intset-entries"
  “512”;
  “zset-max-ziplist-entries"
  “128”;
  “zset-max-ziplist-value"
  “64”;
  “hll-sparse-max-bytes"
  “3000”;
  “lua-time-limit"
  “5000”;
  “slowlog-log-slower-than"
  “10000”;
  “latency-monitor-threshold"
  “0”;
  “slowlog-max-len"
  “128”;
  “port"
  “6379”;
  “tcp-backlog"
  “511”;
  “databases"
  “16”;
  “repl-ping-slave-period"
  “10”;
  “repl-timeout"
  “60”;
  “repl-backlog-size"
  “1048576”;
  “repl-backlog-ttl"
  “3600”;
  “maxclients"
  “4064”;
  “watchdog-period"
  “0”;
  “slave-priority"
  “100”;
  “min-slaves-to-write"
  “0”;
  “min-slaves-max-lag"
  “10”;
  “hz"
  “10”;
  “no-appendfsync-on-rewrite"
  “no"
  “slave-serve-stale-data"
  “yes"
  “slave-read-only"
  “yes"
  “stop-writes-on-bgsave-error"
  “yes"
  “daemonize"
  “no"
  “rdbcompression"
  “yes"
  “rdbchecksum"
  “yes"
  “activerehashing"
  “yes"
  “repl-disable-tcp-nodelay"
  “no"
  “aof-rewrite-incremental-fsync"
  “yes"
  “appendonly"
  “no"
  “dir"
  “/home/迪帕克/下载/redis-2.8.13/src"
  “maxmemory-policy"
  “volatile-lru"
  “appendfsync"
  “everysec"
  “save"
  “60 3600 300 100 10000,
  “loglevel"
  “notice"
  “client-output-buffer-limit"
  “正常的奴隶268435456 67108864 60 pubsub 67108864 268435456 0 0 0 60“;
  “unixsocketperm"
  “0”;
  “slaveof"
  ““
  “notify-keyspace-events"
  ““
  “bind"
  ““

编辑配置

你可以通过修改复述。参看文件或使用配置设置命令来修改配置。

语法

配置设置命令基本语法:

复述127.0.0.1:6379>配置设置CONFIG_SETTING_NAME NEW_CONFIG_VALUE

实例:

复述127.0.0.1:6379>配置设置loglevel“notice"   好吧   复述,127.0.0.1:6379>配置得到loglevel   “loglevel"   “notice"

复述。参看配置项说明如下:

1, daemonize没有
复述,默认不是以守护进程的方式运行,可以通过该配置项修改,使用是的启用守护进程(Windows不支持守护线程的配置为no)

2, pidfile/var/run/redis.pid
当复述,以守护进程方式运行时,复述,默认会把pid写入/var/run/redis.pid文件,可以通过pidfile指定

3,端口6379
指定复述,监听端口,默认端口为6379年,作者在自己的一篇博文中解释了为什么选用6379作为默认端口,因为6379年在手机按键上梅尔兹对应的号码,而梅尔兹取自意大利歌女Alessia梅尔兹的名字

4,绑定127.0.0.1
绑定的主机地址

5,超时300
当客户端闲置多长时间后关闭连接,如果指定为0,表示关闭该功能

6, loglevel注意
指定日志记录级别,复述,总共支持四个级别:调试、冗长,注意,警告,默认为注意

复述,如何配置