Chapter Catalogue
Mysql
Redis
There are many tutorials for deploying MySQL and Redis online under Linux, and here are some of the issues and workarounds that I have encountered during my deployment and configuration.MySQL①
The simplest way to install online:#安装Redis服务器端~ sudo apt-get install redis-serverAfter the installation is complete, the Redis server starts automatically and we check the Redis server program# 检查Redis服务器系统进程~ ps -aux|grep redisredis 4162 0.1
Redis in Linux installation is actually very simple, just before the installation of the use of Yum installation, but Yum installed when download speed is slow, and so half a day download do not want to get, today read the tutorial, direct make
1. Introduction to 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 HASHS (hash type). These
Download and install RedisHttps://github.com/MSOpenTech/redis/releases can also find this link through the Redis.io website
Unzip to the D:\Redis root directory.
Start the Redis service side.Redis-server.ext redis-windwons.conf
Start the
DEL----------------------------------Delete the given one or morekey
DUMP--------------------------------Serialize given key, and return the serialized value
EXISTS------------------------------checks for the existence of a given key
EXPIRE----
1 Redis is implemented in C language2 C string is the/0 end of the character array3 Redis-specific dynamic string implementations/*/struct sdshdr Space-occupied length int in {// buf len; // Length of remaining free space in buf
first, talk about the installation of a single Redis service use of Redis is 2.8.17 version, downloaded from the official website extract the contents of: &NBSP ; Installing and starting a Redis service is simple, as follows:
For a lottery, a user can only participate once by using the phone number as a check entry. The pre-entry number is "13311111111 0", the entrance first to determine the status of the user number is 0, for the first time to participate in the event,
"implementation of the Redis dictionary "Note dict The type uses two pointers, pointing to two hash tables, respectively.Where the No. 0 hash table ( ht[0] ) is the main hash table used by the dictionary, and the 1th hash table ( ht[1] ) is only
"Redis Collection Operations "1.SCard KeyReturns key the cardinality of the collection (the number of elements in the collection).2.sdiffstore destination key [key ...]This command works similarly to Sdiff, but it saves the result to the destination
"Redis Foundation Operations "1. ECHO message. Returns message . 2, PhingReturns PONG If no argument is provided, otherwise return a copy of the argument as a bulk. This command was often used to test if a connection was still alive, or to measure
compile
use
initialize
to connect to a Redis database
Rediscontext * pconn = Red Isconnect (Redisip.c_str (), redisport); if (m_clocal = = NULL) { return 1; }
if (Pconn->err) { cout errstr;
Tomcat-session-redis ConfigurationSession persistence mechanism Three methods of implementation:1. Session binding: Always direct requests from the same source IP to the same RS; no fault tolerance; lossy equalization effect (SH)2. Session copy:
Redis is a highly memory-dependent NoSQL database that performs well with enough memoryIf you have only one machine to deploy Redis, be very careful.For example, I have a 24G server, which I would certainly allocate a lot of memory to Redis.Like 20G
Commands for set operationsSadd (Key, member): Adds an element to a set named Key memberSrem (Key, member): Removes the element in the set named Key memberSpop (key): Randomly returns and deletes an element in a set with the name keySmove (Srckey,
1. Assignment, value, delete (String type) Set key value get key del Key2. Incrementing the number INCR KEY&N Bsp Incrby Key increment Incrby is basically the same as the INCR command, Incrby can specify the value to increment
Use version: redis-3.0.4http://www.redis.io/execute the following instructions sequentiallyTAR-XZVF redis-3.0.4.tar.gzCD redis-3.0.4MakeMake installStart RedisRedis-server redis.confTest if Redis started successfullyRedis-cliSet MyName LizhuquanGet
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