1. Download Redis
redis
① before the online installation needs to detect whether there is a RPM package does not exist, to see if the Yum online RPM package does not exist, it can only be downloaded manually or in other ways to download
[[email protected] ~]# rpm-qa|grep redis[[email protected] ~]# yum List|grep redis
The description does not exist.
② to download the website or download it online
wget http://redis.googlecode.com/files/redis-2.2.13.tar.gz
There is already a blog in the download of Redis , click to download redis.
2. Installation
Because it is tar.gz format, it needs decompression and installation
Find the path to the downloaded file after downloading it.
[Email protected] ~]# Whereis Redisredis:/etc/redis[[email protected] ~]#
Extracting a Redis-compiled package requires a GCC environment
In short what is missing what to install.
TAR-ZXVF reids-2.8.13.tar.gzcd Redis-2.8.13makesudo make install# configuration starts---There are four executable files in the SRC directory after the compilation is completed Redis-server, Redis-benchmark, Redis-cli and redis.conf. And then copy it to a directory. MKDIR/USR/REDISCP REDIS-SERVER/USR/REDISCP REDIS-BENCHMARK/USR/REDISCP REDIS-CLI/USR/REDISCP Redis.conf/usr/redisc d/usr/redis# Configuration End--
Or you can configure this
MKDIR/ETC/REDISCP Redis.conf/etc/redis/redis.confmkdir/var/lib/redis
You can download the modified redis.conf from here
Start redisredis-server/etc/redis/redis.conf# to start the Redis service in the background after the confirmation is run, you can use the Redis-benchmark command test to see if you can actually do it with the REDIS-CLI command, like #install的时候redis的命令会被拷贝到/usr/local/bin down.
3. Testing
The client tests if the start is successful
[[email protected] src]# ps -aux|grep rediswarning: bad syntax, perhaps a bogus '-'? see /usr/share/doc/procps-3.2.8/faqroot 23266 0.0 0.7 137356 7768 ? Sl 00:23 0:04 redis-server *:6379root 23982 0.0 0.5 19404 5100 pts/0 S+ 01:09 0:00 redis-cliroot 24398 0.0 0.0 103244 876 pts/2 s + 01:44 0:00 grep redis[[email protected] src]# Redis-cli127.0.0.1:6379> set w wangok127.0.0.1:6379> get w "Wang" 127.0.0.1:6379 >
4. Close the service
REDIS-CLI shutdown If port change can specify port: Redis-cli-p 6379 shutdown
127.0.0.1:6379> i+jcould not connect to Redis at 127.0.0.1:6379:connection Refusednot connected> set W 3Could not C Onnect to Redis at 127.0.0.1:6379:connection Refusednot connected>
5. Start the service
[[email protected] src]# redis-server[24502] 28 oct 01:54:35.784 # Warning: no config file specified, using the default config. in order to specify a config file use redis-server /path/to/ Redis.conf[24502] 28 oct 01:54:35.784 * increased maximum number of open files to 10032 (it was originally set to 1024) . _._ _.-"__ '-._ _.-" ' . ' _. '-._ Redis 2.8.13 (00000000/0) 64 bit .-' .-' . "' \/ _.,_ '-._ ( ' .-' | ', running in stand alone mode | '-._ '-...-' __...-. '-._| ' ' _.-' | port: 6379 | '-._ '. _ / _.-' | PID: 24502 '-._ '-._ '-./ _.-' _.-' | '-._ '-._ '-.__.-' _.-' _.-' | | '-._ '-._ _.-' _.-' | http://redis.io '-._ '-._ '-.__.-' _.-' _.-' | '-._ '-._ '-.__.-' _.-' _.-' | | '-._ '-._ _.-' _.-' | '-._ '-._ '-.__.-' _.-' _.-' '-._ '-.__.-' _.-' '-._ _.-' '-.__.-' [ 24502] 28 oct 01:54:35.786 # server started, redis version 2.8.13 [24502] 28 oct 01:54:35.786 # 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&nbsP;this to take effect. [24502] 28 oct 01:54:35.786 * db loaded from disk: 0.000 Seconds[24502] 28 oct 01:54:35.786 * the server is now ready to accept connections on port 6379
It's best to reopen a window after launch redsi-cLi enters the console
Otherwise, a connection error may occur. Similar to running Tomcat under Windows CMD.
[[email protected] redis]# redis-clicould not connect to Redis at 127.0.0.1:6379:connection Refusednot connected> Redi S-clicould not connect to Redis at 127.0.0.1:6379:connection refusednot connected> [[email protected] redis]# REDIS-CL I127.0.0.1:6379> Set name = Wangxin (Error) ERR syntax error127.0.0.1:6379> set name wangxinok127.0.0.1:6379> set Age 26ok127.0.0.1:6379> Get name Age (Error) ERR wrong number of arguments for ' get ' command127.0.0.1:6379> get name "Wangxin" 127.0.0.1:6379> get Age "127.0.0.1:6379>"
This article is from the "Long Road" blog, please be sure to keep this source http://wangxin88.blog.51cto.com/3228434/1569084
NoSQL Redis-centos 6.5 Installation test