Redis

Last Edited Time
Feb 9, 2022 07:02 AM
date
Jan 3, 2018
slug
redis
status
Published
tags
Notebook
Redis
summary
早期 Redis 工作笔记
type
Post
# connect
redis-cli -h 172.31.34.160

# get all db
INFO keyspace

# get config
CONFIG GET *

CONFIG GET databases

# get all keys
KEYS *

# get string value
GET purl_g771_green-tea

# get second database
SELECT 2

# get all group 146 detail
HGETALL gdtl146

# get multi fields
HMGET gdtl146 desc

# get all keys
HKEYS gdtl146

# get all values
HVALS gdtl146

# get keys count
HLEN gdtl146

# update value
HGET gdtl492 imgs
HSET gdtl492 imgs "[\"492\/l\/healthxp_logo.jpg\"]"

Cluster nodes

# cluster nodes
cluster nodes

keys * $SLAVE_HASH