如何检查redis-instance版本?
我在Redis网站上找到了这个命令:
$ redis-server
这应该给我(根据网站):
[28550] 01 Aug 19:29:28 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
[28550] 01 Aug 19:29:28 * Server started, Redis version 2.2.12
[28550] 01 Aug 19:29:28 * The server is now ready to accept connections on port 6379
... and so forth ...
Run Code Online (Sandbox Code Playgroud)
但我得到了这个:
[8719] 04 Feb 14:51:09.009 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
[8719] 04 Feb 14:51:09.009 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
[8719] 04 Feb 14:51:09.009 # Creating Server TCP listening socket *:6379: bind: Address already in use
Run Code Online (Sandbox Code Playgroud)
这意味着我需要配置它,但我想要的只是版本!
那么如何查看redis实例版本?
Avi*_*Net 257
$ redis-server --version
给你版本.
Ofe*_*lig 123
运行命令INFO.该版本将是显示的第一个项目.
这相对于redis-server --version的优势在于,有时您无法访问服务器(例如,当它在云上提供给您时),在这种情况下INFO,您是唯一的选择.
Pe *_*Dro 22
为了支持上面给出的答案,可以通过以下方式获得redis实例的详细信息
$ redis-cli
$ INFO
Run Code Online (Sandbox Code Playgroud)
这提供了您可能需要的所有信息
$ redis-cli
$ INFO
Run Code Online (Sandbox Code Playgroud)
版本位于第二行:)
小智 8
如果您想知道远程Redis服务器的版本,只需连接到该服务器并发出命令“信息服务器”,您将得到如下信息:
...
redis_version:3.2.12
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:9c3b73db5f7822b7
redis_mode:standalone
os:Linux 2.6.32.43-tlinux-1.0.26-default x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.9.4
process_id:5034
run_id:a45b2ffdc31d7f40a1652c235582d5d277eb5eec
Run Code Online (Sandbox Code Playgroud)
有两个命令,可用于检查redis的版本
redis-server -v
Run Code Online (Sandbox Code Playgroud)
要么
redis-server --version
Run Code Online (Sandbox Code Playgroud)