Before we deploy Redis, let's see what Redis really is.
Redis is a key-value storage system. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), and Zset (ordered collection). These data types support Push/pop, Add/remove, and intersection-set and difference sets, and richer operations, and these operations are atomic. 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.
Redis is a high-performance Key-value database. The emergence of Redis, to a large extent, compensates for the lack of memcached such key/value storage, in some cases can be a good complement to the relational database. It provides the python,ruby,erlang,php client, which is very convenient to use. (See details: http://baike.baidu.com/view/4595959.htm)
Deployment of Redis
Download of 1.redis Source package
wget http://redis.googlecode.com/files/redis-2.6.12.tar.gz
Deployment installation for 2.redis
The deployment installation method of Redis is particularly simple, and it is estimated that this is one of the reasons why it is so popular.
tar zvxf redis-2.6.12.tar.gz
CD redis-2.6.12
Make && make install
3.redis Start-up
Because the default boot mode of Redis, is unable to start the background, so we have to modify the configuration file, so that the Redis service in the background to start, the specific method is to modify the redis.conf file, the daemonize option to change the No to Yes, and then you can start the background. Specific starting method:
Src/redis-server redis.conf
If you have made the install Redis, you can simply: (recommended)
CP redis.conf/etc/
Redis-server/etc/redis.conf
4. Test if Redis is installed successfully
Run the REDIS-CLI under SRC
Phpredis expansion of the installation
1. Download Phpredis
: Https://github.com/nicolasff/phpredis
2. Installation method
Unzip, then CD to Phpredis, run Phpize (#如果没有phpize can install sudo apt-get install Php5-dev first), then the standard installation three steps.
. Configure--with-php-config= /usr/bin/php-config
Make && make install
Then in the php.ini file, join extension=redis.so, I was/etc/php5/apache2/conf.d/new Redis.ini and joined Extension= Redis.so, and finally reboot Apache or Nginx.
Sudo/etc/init.d/apache2 Restart or
sudoservice apache2 restart
3. Test Phpredis Expansion If the installation is successful, restart the Redis, and let's write a simple test script.
Finally let me look at the browser's access results
With the expansion of Redis services and Phpredis, the installation is complete.