About Redis:
Redis is an open source API that is written in ANSI C , supports the web, can be persisted in memory, key-value databases , and provides multiple languages. From March 15, 2010 onwards, the development work of Redis is hosted by VMware.
redis is a key-value storage system Similar to memcached, it supports storing more value types, including string (string), list (linked list ), set (set), Zset (sorted set--ordered set), and hash (hash type). These data types All support Push/pop, Add/remove, and intersection sets and differences and richer operations, and these operations are atomic in nature. Based on this, Redis supports sorting in a variety of different ways. As with memcached, data is cached in memory to ensure efficiency. The difference is that Redis periodically writes the updated data to disk or writes the modified operation to the appended record file, and Master-slave (Master-Slave) synchronization is implemented on this basis.
Installation Environment:
CentOS 6.5
Redis 2.8.13
Download the installation:
Download the file to the/opt/directory
wget http://download.redis.io/releases/redis-2.8.13.tar.gz
Unzip the file
Tar zxvf redis-2.8.13.tar.gz
Switch directories to the redis-2.8.13 directory
CD redis-2.8.13
Execute make command, output from the last few rows
Hint:to run ' make test ' was a good idea;)
MAKE[1]: Leaving directory '/OPT/REDIS-2.8.13/SRC '
Execute the Install command
Make install
Tips:
[Plain]View Plaincopy
- CD src && make install
- MAKE[1]: Entering directory '/OPT/REDIS-2.8.13/SRC '
- Hint:to run ' make test ' was a good idea;)
- Install Install
- Install Install
- Install Install
- Install Install
- Install Install
- MAKE[1]: Leaving directory '/OPT/REDIS-2.8.13/SRC '
Follow the prompts to execute: CD src && make install
Tips:
[Plain]View Plaincopy
- Hint:to run ' make test ' was a good idea;)
- Install Install
- Install Install
- Install Install
- Install Install
- INSTALL instal
Follow the prompts: Make Test
Tips:
[Plain]View Plaincopy
- You need TCL 8.5 or newer in order to run the Redis test
- Make: * * * [Test] Error 1
Workaround reference: http://www.linuxfromscratch.org/blfs/view/cvs/general/tcl.html
can also be used:yum install tcl command installation
Later, the search found that no installation required, directly to the SRC directory execution./redis-server can
You can use a similar./redis-server/path/to/redis.conf command to specify the configuration file;
Server started, Redis version 2.8.13
The server is now a ready-to-accept connections on port 6379
The service started successfully and the service has been listening for connection requests on port 6379.
You can use the built-in client connection redis:http://www.redis.cn/download.html
[Plain]View Plaincopy
- $ src/redis-cli
- Redis> set Foo Bar
- Ok
- Redis> get foo
- "Bar"
Precautions :to access it remotely, you also need to open the firewall port,to keep the service running, you can close the terminal window directly, but do not use CTRL + C, which causes the program to exit. transferred from: http://blog.csdn.net/testcs_dn/article/details/39756477==================================================================when learning RHP Sessionredis, we found that there was no redis at all.
Search the installation tutorial immediately, turn Snowolf's http://snowolf.iteye.com/blog/1630697
1, download and decompression
wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz
Tar zxvf redis-2.6.14.tar.gz
2, in the/opt/redis-2.6.14/directory, execute make times wrong:/bin/sh:cc:command not found
Well, none of the relevant compilation tools are installed.
Search, sudo apt-get install build-essential
Error 1): Bash:apt-get:command not found
Re-search, CentOS Software Installation tool is not Apt-get is yum,
The correct one should be sudo yum-y install gcc gcc-c++ libstdc++-devel
The installation was successful.
Error 2) in the/opt/redis-2.6.14/directory, execute the Make times error
MAKE[1]: Entering directory '/OPT/REDIS-2.6.14/SRC '
CC ADLIST.O
In file included from adlist.c:34:
Zmalloc.h:50:31:error:jemalloc/jemalloc.h:no such file or directory
Zmalloc.h:55:2: Error: #error "Newer version of Jemalloc required"
MAKE[1]: * * * [ADLIST.O] Error 1
MAKE[1]: Leaving directory '/OPT/REDIS-2.6.14/SRC '
Make: * * * [ALL] Error 2
OK, go on ~, found: http://xueliang1yi.blog.163.com/blog/static/1145570162012102114635764/
Seems to have encountered a similar situation, the text mentions the installation of GCC, his command also knocked aside, the system prompted the latest version has been installed, no need to install.
Then execute make MALLOC=LIBC.
Error 3) After executing the above command, the system prompts ' hint:to run ' make test ' was a good idea '
Make test error: You need TCL 8.5 or newer in order to run the Redis test
3.1) In the above is also mentioned, but still find a more detailed method of installing TCL;
: http://downloads.sourceforge.net/tcl/tcl8.5.10-src.tar.gz
Install Command: http://blog.csdn.net/makebuaa/article/details/6709140
TCL installation
[[Email protected] Desktop]$ ls tcl8.5.9-src.tar.gz
Tcl8.5.9-src.tar.gz
[[Email protected] Desktop]$ su
Password:
[[Email protected] Desktop]# CP tcl8.5.9-src.tar.gz/usr/local/src/
[[Email protected] Desktop]# cd/usr/local/src/
[Email protected] src]# TAR-ZXVF tcl8.5.9-src.tar.gz
[Email protected] src]# CD tcl8.5.9/
[Email protected] tcl8.5.9]# CD unix/
[Email protected] unix]#/configure--prefix=/usr/local/tcl/--enable-shared
[[email protected] unix]# make
[[email protected] unix]# make install
[Email protected] unix]#/usr/local/tcl/bin/tclsh8.5
% exit
[Email protected] unix]#
3.2) or prompt for errors requiring tcl8.5 or newer versions
Found sudo yum install Tcl can be done, but the version is 8.5.7.
Finally prompt ' \o/all tests passed without errors! '
Under the/opt/redis-2.6.14/directory, execute the Make,ok;
4. Modify the configuration file directory
Mkdir/etc/redis
CP Redis.conf/etc/redis
5. Operation
Redis-server/etc/redis/redis.conf
Excerpted from http://www.cnblogs.com/chy710/archive/2012/05/28/redis.html
Redis-server.exe is a Redis service program that starts the server after the command line runs
[2624] 17:19:30 * Server started, Redis version 2.4.2
[2624] 17:19:30 # Open data file dump.rdb:No such file or directory
[2624] 17:19:30 * The server is now a ready-to-accept connections on port 6379
Redis-cli.exe is a client program that runs under the command line, a simple set/get
Redis 127.0.0.1:6379> Set MyKey "This is a value"
Ok
Redis 127.0.0.1:6379> Get MyKey
"This is a value"
Redis 127.0.0.1:6379>
6. Write to boot echo "redis-server/etc/redis/redis.conf" >>/etc/rc.local
7, test, reference http://blog.csdn.net/21aspnet/article/details/6960757
Start process
#redis-server/etc/redis/redis.conf
To see if a process has successfully started
#ps-ef | grep redis Test Input A key value #redis-cli set test "123456" Get key value #redis-cli get test
Note:
The following two texts have links to some additional redis information, and have time to see ...
http://blog.csdn.net/chenggong2dm/article/details/6100001
Http://www.cnblogs.com/chy710/archive/2012/05/28/redis.html
Transferred from: http://www.cnblogs.com/la-isla-bonita/p/3582751.html
CentOS installation Redis