First, install Redis and enable service
1 Download Redis Client
Http://code.google.com/p/servicestack/wiki/RedisWindowsDownload#Download_32bit_Cygwin_builds_for_Windows
2 Extract to the directory you need
3 Creating redis.conf Files
Business requirements
The app client sends the JSON data to the server interface once a day, emptying the cache and sending it again.
Business logic before a problem:
The PHP interface first converts JSON to an array to insert nonexistent data in
Copyright NOTICE: This article is the original article, without the owner's permission to reprint.
Directory (?) [+]String [HTML]View plain copy 1, String common commands: In addition to operations such as GET, set, INCR, Decr mget, Redis also
Copyright NOTICE: This article is the original article of the blogger, without the permission of the blogger may not be reproduced.
Directory (?) [+]String [HTML]View plain copy 1, String common commands: In addition to operations such as GET, set,
Using the Redis_publisher.h redis_publisher.cpp in http://blog.csdn.net/xumaojun/article/details/51558237 redis_ Subscriber.h redis_subscriber.cpp four files, do an action class to test. Header file Policy.h
#pragma once
#include "redis_publisher.h"
Hardware
Machine name
Ip
Role
Master
192.168.0.2
The master server for Redis
Slave1
192.168.0.3
Redis's Slave server
Slave2
192.168.0.4
Redis's Slave server
# Redis-sentinel's official website address: Http://redis.io/topics/sentinel # Note: Redis-sentinel website is not a stable version. Personally feel this is much better than Keepalived+redis to switch. Configuration environment: os:centos6.1 x86 *
1,misconf Redis is configured to save the RDB snapshots, but was currently not able to persist on disk. Commands that may modify the data set is disabled. Please check your Redis logs for details about the error.
Reason: The Redis snapshot should
Installation
System: centos6.4
redis Download: http://www.redis.cn/download.html
Redis installation steps:
upload source package to/lamp
decompression: TAR-ZXVF redis.tar.gz
CD Redis
make/compile source, first installed Linux system This step may be
1, the system integrates the Redis service. Redis configuration in the properties file:
redis.host=127.0.0.1
redis.port=6379
redis.default.db=0
redis.timeout=100000
redis.maxactive=
redis.maxidle=100
Reprint: http://ju.outofmemory.cn/entry/330999
There are 3 commands for clearing data in Redis, namely: Flushall, Flushdb, SCRIPT FLUSH. Flushall [ASYNC]
Indicates that all data in all db is deleted. The default is a synchronous operation, and the
Predis
The Predis is intended for use in Redis for more than PHP 5.3, including the use of clusters. Key Features support various versions of Redis (from 2.0 to 3.0 and unstable) using hashing or user-defined methods for client shard support for
Start Redis ServiceRedis-server or Redis-server redis.conf
Redis-server redis.conf 1>log.log 2>errlog.log
1 for standard output, 2 for error output randomly booting Redis as a Linux serviceVim/etc/rc.local, add
1.sentinel
The Redis Sentinel system is used to manage multiple Redis servers, performing three main tasks:1) Monitoring: Sentinel constantly check whether the master-slave server is operating properly;2) Reminder: When a Redis server problems, you
Each hash can store 4,294,967,295 key-value pairs
Type of hash (hash):
Hset Assignment Value
127.0.0.1:6379> hset H1 username java1234(integer) 1127.0.0.1:6379> hset H1 Password 123456(integer) 1
Hget value
127.0.0.1:6379> Hget H1 username"Java1
The redis hash is a string-type field and a mapping table of value. A key can correspond to multiple fields, and a field corresponds to a value. Storing an object as a hash type can save memory more than storing each field as a string type. When
The persistence mechanisms of Redis include the RBD and AoF two, which are described in this article for each of these two persistence approaches.
the strategy of the RDB mechanism
RDB persistence refers to the way in which in-memory data and
Reprint please indicate the source ha: http://carlosfu.iteye.com/blog/2254154
Because the speech time is limited, about Redis-cluster, the speaker did not do too many introductions, simply introduced some redis-cluster concept function and
1. Introduction to the database: Currently, there are two main types of databases: relational database (RDBMS), non-relational database (NoSQL);(1). Relational database RDBMS: It is a database based on the relational model, which uses mathematical
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.