redis(五)-redis.conf

1042 ワード

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
1つのredisプロセスで、1つ以上のデータベースが開き、デフォルトでは0から15まで16のデータベースが開きます.
# 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