查看redis的版本有以下方式:
1、通过查看redis-server服务的版本来查看
redis-server –version 和 redis-server -v
[root@localhost ~]# redis-server -v [root@localhost ~]# Redis server v=2.6.16 sha=00000000:0 malloc=jemalloc-3.2.0 bits=64 [root@localhost ~]# redis-server --version [root@localhost ~]# Redis server v=2.6.16 sha=00000000:0 malloc=jemalloc-3.2.0 bits=64
2、通过查看redis-cli的版本来查看,一般redis-cli是和redis-server是从同一个源码包编译出来的,所以应该来说版本一致。
redis-cli –version 和 redis-cli -v
[root@localhost ~]# redis-cli -v [root@localhost ~]# redis-cli 2.6.16 [root@localhost ~]# redis-cli --version [root@localhost ~]# redis-cli 2.6.16
3、通过client登入redis,使用info命令查看
[root@localhost ~]# redis-cli -p 6379 -a 123456 redis 127.0.0.1:6379> info # Server redis_version:2.6.16 redis_git_sha1:00000000 redis_git_dirty:0 redis_mode:standalone os:Linux 2.6.32-358.el6.x86_64 x86_64 arch_bits:64 multiplexing_api:epoll gcc_version:4.4.7 process_id:31397 run_id:e58b84669228248f9afe4e810388b6379031bb7c tcp_port:6379 uptime_in_seconds:520341 uptime_in_days:6 hz:10 lru_clock:1655224 # Clients connected_clients:2 client_longest_output_list:0 client_biggest_input_buf:0 blocked_clients:0 # Memory used_memory:275041536 used_memory_human:262.30M used_memory_rss:20598784 used_memory_peak:276133984 used_memory_peak_human:263.34M used_memory_lua:31744 mem_fragmentation_ratio:0.07 mem_allocator:jemalloc-3.2.0 # Persistence loading:0 rdb_changes_since_last_save:328 rdb_bgsave_in_progress:0 rdb_last_save_time:1484558515 rdb_last_bgsave_status:ok rdb_last_bgsave_time_sec:20 rdb_current_bgsave_time_sec:-1 aof_enabled:0 aof_rewrite_in_progress:0 aof_rewrite_scheduled:0 aof_last_rewrite_time_sec:-1 aof_current_rewrite_time_sec:-1 aof_last_bgrewrite_status:ok # Stats total_connections_received:5561 total_commands_processed:662707 instantaneous_ops_per_sec:4 rejected_connections:0 expired_keys:0 evicted_keys:0 keyspace_hits:1343 keyspace_misses:24 pubsub_channels:0 pubsub_patterns:0 latest_fork_usec:2330 # Replication role:master connected_slaves:1 slave0:127.0.0.1,63791,online # CPU used_cpu_sys:171.01 used_cpu_user:61.20 used_cpu_sys_children:735.85 used_cpu_user_children:12.50 # Keyspace db0:keys=108278,expires=0,avg_ttl=0 db15:keys=10,expires=0,avg_ttl=0