~$ sudo /etc/init.d/redis-server status ● redis-server.service - Advanced key-value store Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled) Active: active (running) since 四 2017-11-09 12:22:09 CST; 59s ago Docs: http://redis.io/documentation, man:redis-server(1) Main PID: 5394 (redis-server) CGroup: /system.slice/redis-server.service └─5394 /usr/bin/redis-server 127.0.0.1:6379 11月 09 12:22:09 zzf systemd[1]: Starting Advanced key-value store... 11月 09 12:22:09 zzf run-parts[5388]: run-parts: executing /etc/redis/redi...le 11月 09 12:22:09 zzf run-parts[5395]: run-parts: executing /etc/redis/redi...le 11月 09 12:22:09 zzf systemd[1]: Started Advanced key-value store. Hint: Some lines were ellipsized, use -l to show in full.
通过命令行客户端访问Redis
安装Redis服务器,会自动地一起安装Redis命令行客户端程序。
在本机输入redis-cli命令就可以启动,客户端程序访问Redis服务器。
1 2
~ redis-cli redis 127.0.0.1:6379>
命令行的帮助
1 2 3
redis 127.0.0.1:6379> help redis-cli 2.2.12 Type: "help @" to get a list of commands in "help "forhelp on "help " to get a list of possible help topics "quit" to exit
查看所有的key列表
1
redis 127.0.0.1:6379> keys * (empty list or set)</pre>