redis(五)-redis.conf

1、命令

    1.1 设置conf中的键值。

192.168.16.128:6379> config set requirepass xxxx
OK

    设置后,登陆时序输入验证(如果redis重启,该密码将被重置):

[root@www redis-3.0.2]# redis-cli -h 192.168.16.128 -p 6379 -a xxxx
192.168.16.128:6379> config get requirepass
1) "requirepass"
2) "xxxx"

1、databases 16

     一个redis进程,打开了不止一个数据库,默认打开了16个数据库,从0到15编号。

# Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where
# dbid is a number between 0 and 'databases'-1
databases 16

 2、port 6379

   客户端连接的端口,也是服务端侦听客户端连接的端口。每个客户端实例,都将再此端口上建立tcp长连接。

# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379 

猜你喜欢

转载自joandora.iteye.com/blog/2230259