Latest web development tutorials

Redis client Uccidi Comando

Server Redis

Redis comando del client Uccidere è usato per chiudere le connessioni client.

grammatica

Redis client Uccidi sintassi dei comandi di base è la seguente:

redis 127.0.0.1:6379> CLIENT KILL ip:port

versioni disponibili

> = 2.4.0

Valore di ritorno

Quando è chiuso con successo, restituisce OK.

Esempi

# 列出所有已连接客户端

redis 127.0.0.1:6379> CLIENT LIST
addr=127.0.0.1:43501 fd=5 age=10 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client

# 杀死当前客户端的连接

redis 127.0.0.1:6379> CLIENT KILL 127.0.0.1:43501
OK

# 之前的连接已经被关闭,CLI 客户端又重新建立了连接
# 之前的端口是 43501 ,现在是 43504

redis 127.0.0.1:6379> CLIENT LIST
addr=127.0.0.1:43504 fd=5 age=0 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client

Server Redis