Introduction
Redis implements a two-way linked list containing an iterator. The basic function is a universal two-way linked list. The source code implementation is worth reading the following.Source File
Adlist. h adlist. cAnalysis
Here we will
Policy summary
The master and slave nodes are mutually standby, with no read/write splitting. The slave database is only synchronous and does not provide external services. The master database has no persistence policy, and the backup database uses
Original article: http://antirez.com/post/redis-manifesto.html
1: redis is a DSL tool for operating data structures. It provides TCP-based protocols to operate on rich data structures.
2: redis is a memory database. It is precisely because of the
Redis Data Type
Redis supports five data types: String, hash, list, set, and zset ).
String (string)
String is the most basic type of redis. You can think of it as the same type as memcached. A key corresponds to a value.
The string type is binary
Cluster Management Tool redis-trib.rb has been abandoned, so do not need to install Ruby what, at that time the redis-trib.rb function, now has been integrated into redis-CLI, can pass. /redis-cli -- cluster help to view the usage.
Environment
#
The current stable version of redis (2.0.4) only supports Simple master-slave replication: one master write, multiple slave reads. Sharding can only be performed by the client through consistent hashing.
Redis cluster is the focus of
Source: http://timyang.net/data/redis-misunderstanding/
A major system fault occurred on Weibo a few days ago, and many technical friends are concerned about it. The reason is not as high as James Hamilton's on design and deploying
Redis, Is an open source, BSD licensed, advanced key-Value Store. it is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. redis is a key-value storage system. Similar to memcached,
I have to say that the Code in the data structure book is not practical.
C language code is rarely written, so it records useful code.
Adlist. h:
/* adlist.h - A generic doubly linked list implementation * * Copyright (c) 2006-2010, Salvatore
The master-slave setting of reids is easy to complete in just one sentence. Add it in the slave configuration file redis. conf.
Slaveof 192.168.252.20.5371
192.168.252.20.host IP 5371 is the host port
Start the host and then start the slave. To
1. In the redis Hello world example, the package here is Jedis. Https://github.com/xetorthio/jedis/downloadsimport the jarpackage into the project and open the redisserver (for details on redis downloading and installation, refer to the preliminary
1. Install
$ wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz$ tar xzf redis-2.6.14.tar.gz$ cd redis-2.6.14$ make $ make install
Start the service:/Usr/local/bin/redis-Server
Client command:/Usr/local/bin/redis-cli
2. Configuration
In
If it is a professional dBA, many parameters will be added when the instance is started to make the system run very stably, so that a parameter may be added after redis at startup, you can specify the path of the configuration file to start the
Redis has a major bottleneck when the memory size exceeds 50 GB. To solve this problem, I found some relevant information and found this open-source software. The function is very powerful, including the consistent hash algorithm of ketama of last.
Redis code structure 2 net, main, event
1. Network LibraryAnet. C and networking. C: These two files mainly implement network communication and interaction with the client.1.1 Anet. cThis file encapsulates basic network socket operations (TCP,
Redis aof
We have introduced the main framework of redis and two general principles of persistence. In this article, we will analyze the implementation of redis aof from the source code perspective. (This article is based on version 2.4.2)1. Related
Introduction
Redis encapsulation of Linux socket, although it also contains encapsulation of UNIX socket, but generally uses TCP socket. Similar to epoll encapsulation in the previous article, epoll uses the underlying socket function to complete
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