Recently writing a script to check the size of a Redis key value in all of the game area service profiles on a single server was intended to solve this problem by using shell+awk+sed, but because Redis configuration information is in the form of PHP arrays. The shell script was not written in the moment, Ask someone to help write a Python script, but their
specified command.
2. redis master-slave replication:
Redis only needs to be configured on the slave server (slave:
Slaveof 211.122.11.11 6379 # specify the master's IP address and port
Masterauth Beijing # This is the password of the master host
Info # view the status of the Master/Slave server.
3. redis transaction processing:
Centos7 install Redis-single-node tutorial, centos7redis-node1. Download and install gcc
Because Redis is developed in C language, the source code downloaded from the official website needs to be compiled and compiled based on the gcc environment. If there is no gcc environment, you need to install it.
[root@CentOS ~]# yum -y install gcc2. Download The
I. Introduction of RedisRedis is a key-value storage system. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered collection), and hash (hash type). 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. A
System Environment:
Os:oracle Linux Enterprise 5.6
redis:redis-2.6.8
python:python-2.7.3
Redis Python package version: Redis-2.7.2.tar
Prerequisites:
1. Ensure that the Redis has been successfully installed and properly configured, reference documentation
Master-Slave Copy Document:
http://blog.csdn.net/lichangzai/art
System Environment: OS: Oracle Linux Enterprise 5.6 redis: redis-2.6.8python: Python-2.7.3redis python package version: redis-2.7.2.tar prerequisites: 1. make sure that Redis is successfully installed and configured correctly. Ref
initiatedSave 60 10000Second, the record Operation command [Append-only file (abbreviated AOF) way] (more secure persistence)AppendOnly Yes #启用aof persistence mode# Appendfsync always//write commands are immediately written to disk, slowest, but guaranteed to be fully persistedAppendfsync everysec//write disk once per second, a good compromise in performance and persistence# Appendfsync no//completely dependent on OS, best performance, no guarantee of persistenceThird, PHP +
Redis Use a detailed tutorial
First, Redis basic part:
1, Redis introduction and installation faster than MySQL 10 times times more than
Redis applicable occasions ****************
1. Take the latest N data operations
2. List application, take top N operation
3. Application
1, Python to operate Redis first need to install the Redis module, and then import to useInstallation: Pip Install RedisImporting: Import Redis2. Connect to RedisR = Redis. Redis (host= ' 192.168.21.129 ', password= ' 123456 ', db=1,port=6379)Password in configuration file r
realizes the Master-slave (master-Slave) synchronization
1, installation and basic use
Redis Installation:
wget http://download.redis.io/releases/redis-3.0.6.tar.gzTar xzf redis-3.0.6.tar.gzCD redis-3.0.6MakeStart the service side:
Src/redis-serverTo start the client:
. redis 127.0.0.1:6379> type MyKey string #准备一个值是set类型的键. Redis 127.0.0.1:6379> sadd mysetkey 1 2 (integer) 2 #mysetkey的键是set, so the string set is returned. redis 127.0.0.1:6379> type Mysetkey set #返回数据库中的任意键. redis 127.0.0.1:6379> randomkey "Oldkey" #清空当前打开的数据库.
Redis is a key-value storage system. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered collection), and hash (hash type). 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
-max-ziplist-Value: Default value 64activerehashing: The default is yes, to control whether the hash is automatically rebuilt. Active rehashing uses 1 microseconds of CPU time per 100 microseconds to reorganize the Redis hash table. Rebuilding is a lazy way, the more you write a hash table, the more steps you need to perform rehashing, and the rehashing operation will execute if the server is currently idle. If the requirement for real-time is high an
, another window is opened, and the client is set up:Input command: redis-cli.exe-h 202.117.16.133-p 6379Enter the following as shown:Then you can start playing:Set a key and get the value returned:$./REDIS-CLI Set MyKey somevalueOk$./REDIS-CLI Get MyKeySomevalueHow to add a value to list:$./redis-cli Lpush mylist firs
the Rpoplpush command, which gives a specific explanation.Redis linked lists are often used for Message Queuing services to complete the exchange of messages between multiple programs. Suppose an application is performing a lpush operation to add a new element to a linked list, and we usually call such a program "producer (Producer)", while another application is performing rpop operations to remove elements from the list, we call this program "consumer (Consumer) "。 If, at this point, the cons
configuration fileinclude /path/to/local.conf
What is a daemon process?The daemon (Daemon process), which is usually called the Daemon process (daemon), is the background service process in Linux. It is a long-lived process, usually independent of the control terminal and periodically performs some sort of task or waits to handle certain occurrences. The daemon is a special orphan process that is out of the terminal and why is it out of the terminal? The reason for leaving the termin
First, IntroductionRedis is a key-value storage system. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered collection), and hash (hash type). 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 wit
means that now you have successfully installed Redis on your computer. Python Operation Redissudo pip install Redisorsudo easy_install redisor source installation See: Https://github.com/WoLpH/redis-pyInstalling Redis Desktop Manager on UbuntuTo install Redis Desktop Manag
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.