Home | 简体中文 | 繁体中文 | 杂文 | 打赏(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Search | Email

47.6. Redis 通信协议

47.6.1. 切换DB

select n 切换DB, n表示数据库ID

# telnet 192.168.41.160 6379
Trying 192.168.41.160...
Connected to 192.168.41.160.
Escape character is '^]'.
select 1
+OK
			

47.6.2. 监控

telnet方式

# telnet 172.18.52.13 6379
Trying 172.18.52.163...
Connected to 172.18.52.13.
Escape character is '^]'.
MONITOR
+OK
+1425454378.190210 "MONITOR"
+1425454381.165317 "GET" "admin:633"
+1425454381.165725 "SET" "admin:633" "{\"id\":\"633\",\"username\":\"7209\",\"password\":\"eea5981a4fd021b8d78f8431084ba760\",\"status\":\"N\",\"belong_user_id\":\"133\",\"level_id\":\"67\",\"create_time\":1425454381,\"session_id\":\"l1s609t9gq8nj7vc94hb1i3s25\"}"
+1425454381.166088 "EXPIRE" "admin:633" "3600"
+1425454387.956387 "GET" "admin:633"			
			

使用 nc 监控状态

# (echo -en "MONITOR\r\n"; sleep 10) | nc 172.18.52.13 6379