Redis 是一个遵循 BSD 许可的开源软件,是一个内存型数据结构存储,可以用作为数据库,缓存和消息中间件
在 Redis 的运维管理过程中,会需要了解系统当前的状态
这里分享一下 Redis 状态信息的详细解释,详细可以参考 INFO [section]
Tip: 目前最新版本为 Redis 3.2.1
[root@h102 ~]# cat /etc/issue
CentOS release 6.6 (Final)
Kernel \r on an \m
[root@h102 ~]# uname -a
Linux h102.temp 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@h102 ~]# [root@h102 redis]# wget http://download.redis.io/releases/redis-3.2.1.tar.gz
--2016-06-23 16:46:16-- http://download.redis.io/releases/redis-3.2.1.tar.gz
Resolving download.redis.io... 109.74.203.151
Connecting to download.redis.io|109.74.203.151|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1534696 (1.5M) [application/x-gzip]
Saving to: “redis-3.2.1.tar.gz”
100%[============================================================================================>] 1,534,696 12.5K/s in 92s
2016-06-23 16:47:48 (16.4 KB/s) - “redis-3.2.1.tar.gz” saved [1534696/1534696]
[root@h102 redis]# ls
redis-3.2.1.tar.gz
[root@h102 redis]# tar -zxvf redis-3.2.1.tar.gz
redis-3.2.1/
redis-3.2.1/.gitignore
redis-3.2.1/00-RELEASENOTES
redis-3.2.1/BUGS
redis-3.2.1/CONTRIBUTING
redis-3.2.1/COPYING
redis-3.2.1/INSTALL
...
...
redis-3.2.1/utils/releasetools/
redis-3.2.1/utils/releasetools/01_create_tarball.sh
redis-3.2.1/utils/releasetools/02_upload_tarball.sh
redis-3.2.1/utils/releasetools/03_test_release.sh
redis-3.2.1/utils/releasetools/04_release_hash.sh
redis-3.2.1/utils/speed-regression.tcl
redis-3.2.1/utils/whatisdoing.sh
[root@h102 redis]# cd redis-3.2.1
[root@h102 redis-3.2.1]# make
cd src && make all
make[1]: Entering directory `/usr/local/src/redis/redis-3.2.1/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[2]: Entering directory `/usr/local/src/redis/redis-3.2.1/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd geohash-int && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory `/usr/local/src/redis/redis-3.2.1/deps'
(rm -f .make-*)
...
...
CC redis-cli.o
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
INSTALL redis-check-rdb
CC redis-check-aof.o
LINK redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/usr/local/src/redis/redis-3.2.1/src'
[root@h102 redis-3.2.1]# echo $?
0
[root@h102 redis-3.2.1]# 查看生成的可执行文件,并且验证版本
[root@h102 redis-3.2.1]# cd src/
[root@h102 src]# ls | grep -v "\."
Makefile
redis-benchmark
redis-check-aof
redis-check-rdb
redis-cli
redis-sentinel
redis-server
[root@h102 src]# ./redis-server --help
Usage: ./redis-server [/path/to/redis.conf] [options]
./redis-server - (read config from stdin)
./redis-server -v or --version
./redis-server -h or --help
./redis-server --test-memory <megabytes>
Examples:
./redis-server (run the server with default conf)
./redis-server /etc/redis/6379.conf
./redis-server --port 7777
./redis-server --port 7777 --slaveof 127.0.0.1 8888
./redis-server /etc/myredis.conf --loglevel verbose
Sentinel mode:
./redis-server /etc/sentinel.conf --sentinel
[root@h102 src]# ./redis-server --version
Redis server v=3.2.1 sha=00000000:0 malloc=jemalloc-4.0.3 bits=64 build=588e5be7450e0a73
[root@h102 src]#不加参数直接启动服务,会前台运行
[root@h102 src]# redis-server
36305:C 23 Jun 17:00:28.456 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
36305:M 23 Jun 17:00:28.457 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.1 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 36305
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
36305:M 23 Jun 17:00:28.459 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
36305:M 23 Jun 17:00:28.467 # Server started, Redis version 3.2.1
36305:M 23 Jun 17:00:28.468 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
36305:M 23 Jun 17:00:28.468 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
36305:M 23 Jun 17:00:28.468 * The server is now ready to accept connections on port 6379本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。