Finally have time to tidy up their notes ....First, Introduction REmoteDIctionary Server (Redis) is a key-value Storage System . Similar to memcached, it supports storing more value types, including string (string), list ( linked list ), set (set),
Part I: Installing RedisWant to install Redis to this directory
1
/usr/local/redis
You want to download the installation package to this directory
1
/usr/local/src
Then the installation
1 installationDownload, extract and compile Redis with:$ wget http://download.redis.io/releases/redis-2.8.19.tar.gz$ tar xzf redis-2.8.19.tar.gz$ cd redis-2.8.19$ makeThe binaries that is now compiled is available in the src directory. Run Redis
This experiment is based on the successful installation of Redis server. The following steps are required to install the Redis extension:1, open the php.ini file, and find the code: Extension=php_redis.dll, and remove the previous # good, if not
zhanhailiang 日期:2014-12-21Demand ScenariosBitmap is very effective for some specific types of computations.Suppose now we want to record the frequency of the users on our site, for example, how many days user a goes online, User BThe number of days,
Configuration of Redis
Configuration Method
Through the redis.conf file
The redis.conf configuration can be overridden by command-line arguments
The config set command dynamically modifies a subset of Redis configurations without
Redis has two storage methods, the default is the snapshot way, the implementation method is to periodically persist the memory snapshot (snapshot) to the hard disk, the disadvantage is that if the crash occurs after persistence, it will lose a
An interesting question today is that when the system loads a string type of shaping data from MySQL into Redis and then takes it out of Redis, its type becomes an integer type, and the procedure is as follows:The key in the database is a
1, compilation environment preparation 1.1 environment confirmationRedis is an open source, support network, memory-based, key-value-pair storage database, written using ANSI C. Therefore, the C-language compilation environment GCC or g++ is
Set the data expiration time by expire the key seconds command. A return of 1 indicates that the setting was successful, and returning 0 indicates that the key does not exist or the expiration is not successfully set.After the expiration time is set
Although Redis has excellent performance, we can still master/slave this simple architecture, read and write separation, further mining redis performance, improve system availability. How does Redis perform master-slave replication? Redis
SynchronousWhy should Redis implement master-slave synchronization?Master-Slave synchronization, with the following benefits:
Realize the backup of data, reduce the loss of single point of failure;
Helps to achieve load balancing.
I. What persistence mechanisms are provided by Redis:1). RDB Persistence:The mechanism is to write a snapshot of the in-memory data set to disk within a specified interval of time.2). AoF Persistence:This mechanism will record every write processed
Redis is an open source Key-value data cache, similar to memcached.Redis has multiple types of value, including string (string), list (linked list), set (set), Zset (sorted set-ordered set), and hash (hash type).Jedis is the official Redis-Preferred
# Redis Version 2.8.19 # 1k = bytes# 1kb = 1024x768 bytes# 1m = 1000000 bytes# 1MB = 1024*1024 bytes# 1g = 1000000000 bytes# 1gb = 1024*1024*1024 bytes # Only with the latest, so you can put it to the last. # include/path/to/local.conf# include/path/
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