Preliminary interview Redis

Source: Internet
Author: User

Introduction to Redis: Redis is a high-performance Key-value storage System (cache and store) issued under the BSD Open source protocol. It is commonly referred to as a data structure server, because the value can be a string (string), a hash (hashes), a list, a collection (sets), and an ordered collection (sorted sets).    just learned ...    Cache Type: Data cache, page cache (Smarty) Why use caching: Reduce the database load frequently accessed short-term unchanging data cache, reduce the speed of access, improve access speed   installation ... Toss it for a while .... MAKE[3]: Gcc:command not found installed Gccyum install Gcc  make complete. Copy cp redis-cli REDIS-SERVER/USR/LOCAL/REDIS/CP redis-cli redis.conf/usr/local/redis/  copy complete switch to/usr/local/redis   Background run vim redis.conf about 17 lines   then run  ./redis-server redis.conf     using &NBSP;./REDIS-CLI Command similar to MYSQL-UROOT-P enter Operation interface simple set name value get get name *****************************exists key  test specify if key exists Returns 1 or 0 del key1 key2  Delete the specified Key keys patten  return a matching key such as keys name*1) name12) name2   Randomkey return random key  renaming rename Oldkey newkey expire key  for key to know expiration time expire age 60//60 seconds expires, chant delete     select Db-index Select Database 0-15select 5 ttl key to return key expiration time  flushDB deletes all key  ***********************************  types in the current database:string        -------------------List link list type   --------------------hash  ----------------------- -------------------------  Persistence:Snap shotting snapshot persistence//default on append only file (aof persistent) manually turn redis.conf-appendonly Yes Master-Slave ... 。 From server configuration slaveof 192.168.17.88 6379/************************/consolidated to PHP dependent software Phpredis.tar.gztar ZXVF PHPREDIS.TAR.GZCD phpredis# using PHP to manipulate the dependent software/usr/local/php/bin/phpize# may need to install autoconf-2.62.tar.gz compile:./configure--with-php-config=/usr/ LOCAL/PHP/BIN/PHP-COF installation: Make && make install has successfully opened the extension: Vim php.iniextension=redis.so restart nginx php use redis<      ? php $redis = new Redis ();      Instantiate $redis->connect (' 192.168.17.88 ', ' 6379 '); $redis->set (' Redis ', ' success '); Run the file?>

Preliminary interview Redis

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.