Excerpt Encyclopedia:
Redis is an open source use of ANSI C language Write, support network, memory-based and persistent journaling, Key-value Database , and provides APIs in multiple languages. From March 15, 2010 onwards, the development work of Redis is hosted by VMware. Since May 2013, the development of Redis has been sponsored by pivotal.
1. Installation of "development tools"
[email protected] src]# yum Groupinstall "Development tools"
2. Download Redis
Http://download.redis.io/releases/Choose the version you want
[[email protected] src]# wget http://download.redis.io/releases/ redis-3.0.4.tar.gz--2016-09-25 10:40:04-- http://download.redis.io/releases/ redis-3.0.4.tar.gzresolving download.redis.io... 109.74.203.151connecting to Download.redis.io|109.74.203.151|:80... connected. http request sent, awaiting response... 200 oklength: 1364993 (1.3M) [application/x-gzip]Saving to: ' redis-3.0.4.tar.gz ' 100%[====================================== =============================================================================================================== >] 1,364,993 31.0K/s in 39s 2016-09-25 10:40:46 (34.4 kb/s) - ' redis-3.0.4.tar.gz ' saved [1364993/ 1364993][[email protected] src]# lltotal 1336-rw-r--r--. 1 root root 1364993 sep 8 2015 redis-3.0.4.tar.gz[[email protected] src]#
3, compiling and installing
[[email protected] src]# tar xf redis-3.0.4.tar.gz [[email protected] src]# cd redis-3.0.4[[email protected] redis-3.0.4]# make cd src && make allmake[1]: Entering directory '/USR/LOCAL/SRC/REDIS-3.0.4/SRC ' Rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html... \\ omitting compilation information cc redis-check-aof.o link redis-check-aofhint: it ' S a good idea to run ' make test ' ;) make[1]: leaving directory '/usr/local/src/redis-3.0.4/ Src ' [[email protected] redis-3.0.4]# cd src/[[email protected] src]# make installhint: it ' s a good idea to run ' make test ' ;) INSTALL install INSTALL install install install install install install install[[ email protected] src]#
4, simple configuration, and start test
[[email protected] src]# mkdir /usr/local/redis3.0.4/etc/ -p[[email protected] src]# mkdir /usr/local/redis3.0.4/bin/ -p[[email protected] src]# find . -perm 755 -o -perm 775| xargs -i cp {} /usr/local/ REDIS3.0.4/BIN/[[EMAIL&NBSP;PROTECTED]&NBSP;SRC]#&NBSP;CD&NBSP, .... [[Email protected] redis-3.0.4]# cp redis.conf /usr/local/redis3.0.4/etc/[[email protected] redis-3.0.4]# ls /usr/local/redis3.0.4/{etc,bin}/usr/local/redis3.0.4/bin: mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-dump REDIS-CLI&NBSP;&NBSP;REDIS-SENTINEL&NBSP;&NBSP;REDIS-SERVER&NBSP;&NBSP;REDIS-TRIB.RB/USR/LOCAL/REDIS3.0.4/ETC: redis.conf[[email protected] redis-3.0.4]# vim /usr/local/redis3.0.4/etc/redis.conf...#### ############################ general ###################################### by default redis does not run as a daemon. Use ' yes ' if you need it.# note that redis will write a pid file in /var/run/redis.pid when daemonized.daemonize yes \\ default is no change to Yes, so the boot will run in the background #daemonize no...:wq \\ save Exit [[Email protected] redis-3.0.4]# ln -sv /usr/local/redis3.0.4/bin/* /usr/local/bin/ \\ soft connection to path, so that you do not have to enter an absolute path, you can directly use the command. [[email protected] redis-3.0.4]# redis- &nBsp; \\ saw no redis-benchmark . redis-check-aof redis-check-dump redis-cli redis-sentinel redis-server redis-trib.rb [[email protected] redis-3.0.4]# redis-server / usr/local/redis3.0.4/etc/redis.conf \\ start Redis, the configuration file must be developed, otherwise the following conditions will occur [[Email protected] redis-3.0.4]# redis-server 12912:c 25 Sep 10:58:42.547 # Warning: Note here-->no config file specified, using the default config.<--Note here In order to specify a config file use redis-server /path/to/redis.conf12912:m 25 Sep 10:58:42.548 * increased maximum number of open files to 10032 (it was originally set to 1024) . _._ _.-' __ '-._ _.-' ' . ' _. '-. _ Redis 3.0.4 (00000000/0) 64 bit .-' .-' . ' \/ _.,_ '-._ ( ' , .-' | ', ) running in standalone mode | '-._ '-...-' __...-. '-._| ' ' _.-' | port: 6379 | '-._ '. _ / _.-' | PID: 12912 '-._ '-._ '-./ _.-' _.-' | ' -._ '-._ '-.__.-' _.-' _.-' | | '-._ '-._ _.-' _.-' | http://redis.io '-._ '-._ '-.__.-' _.-' _.-' | '-._ '-._ '-.__.-' _.-' _.-' | | '-._ '-._ _.-' _.-' | '-._ '-._ '-.__.-' _.-' _.-' '-._  , '-.__.-' _.-' '-._ _.-' '-.__.-' 12912:m 25 sep 10:58:42.550 # warning: the tcp Backlog setting of 511 cannot be enforced because /proc/sys/net/core/ Somaxconn is set to the lower value of 128.12912:m 25 sep 10:58:42.550 # server started, redis version 3.0.412912:m 25 sep 10:58:42.550 # 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.12912:m 25 sep 10:58:42.550 # 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.12912:m 25 sep 10:58:42.550 * The server is now ready to accept connections on port 6379<--here will be endlessly prompted, and will also occupy our session,session shutdown then the service stops, which is why the profile I only emphasize "daemonize yes \\ default is no change to Yes, so that startup will run in the background "\ \ Below is normal startup access shutdown [[email Protected] redis-3.0.4]# netstat -tunlp| grep 6379tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 12827/redis-server tcp 0 0 :::6379 :::* listen 12827/ Redis-server [[email protected] redis-3.0.4]# redis-cli 127.0.0.1:6379> exit[[email protected] redis-3.0.4]# redis-cli shutdown[[email protected] redis-3.0.4]# netstat -tunlp| grep 6379[[email protected] redis-3.0.4]#
At this point, the simple configuration of Redis is OK pull, specific requirements specific configuration, configuration file parameter degree Niang can be obtained.
You are welcome to focus on 459479177QQ group
This article is from the "12087328" blog, please be sure to keep this source http://12097328.blog.51cto.com/12087328/1856277
Redis installation of No SQL