Getting started with Redis (continuously updated)

Course address: https://www.imooc.com/learn/839

 I. Overview

1.NoSQL

The relational database SQL can barely handle tens of thousands of read operations, but it is difficult to write operations.

Document database - mongoDB, lacks unified query syntax

2.say again

(1 Overview

eg: Sina Weibo, Zhihu.com, github, stackoverflow

50 concurrent programs execute 100,000 requests, the redis read speed can reach 110,000 times per second, and the write speed can reach 80,000 times per second. -official data

Chat room list

(2) Installation

The installation reference steps given in the question and answer area:

1. Install Linx virtual machine, system CentOS, SSH client SecureCRT

2, Linx installs gcc online, >yum install gcc-c++ choose y all the way

3. Download the redis.tar.gz installation package and upload it to Linx using Filezilla, root directory

4. Unzip the file > tar -axvf redis.tar.gz

5, enter the redis directory, compile > make

6, install, specify the installation directory>make PREFIX=/usr/local/redis install

7. Enter the installed directory > cd /usr/local/redis

8. Return to the decompression installation path >cd ~ >ll >cd redis-xxx

9, copy redis.conf >cp redis.conf /usr/local/redis

10,>cd /usr/local/redis ,>ll installation completed

11, modify the configuration file > vim redis.conf, enter the editing mode

12, daemonize false to true

13, start redis >./bin/redis-server ./redis.conf

14. Test start ps -f | grep -i redis, default port 6379

15, stop startup >./bin/redis-cli shutdown

16,>./bin/redis-cli           >ping

17, save value>set name xxx, get value>get name, delete>del name, view all>keys *

Installation documentation reference:

1.http://www.cnblogs.com/silent2012/p/3499654.html

2.http://www.qiufeihu.com/2017/07/13/Redis%E7%9A%84Linux%E7%8E%AF%E5%A2%83%E4%B8%8B%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/

gcc environment is installed

Upload the compressed file downloaded by windows to the linux server

local decompression

The password is the password when installing linux, port 22

just pull it

decompress

Enter the path, make basic compilation, if gcc is not installed, an error will occur

The installation is complete

View the tools under the installation of redis

benchmarknmark: performance testing tool

check-aof: aof file repair tool

check-dump: rdb file checking tool

redis-cli: client for the command line

redis-servers: redis server startup command

copy configuration file

Go to the bin path

The front-end starts the server, the command is not easy to use, ctrl+c stops the startup

Backend start:

Program no to yes

Redis has been started, and the terminal can still be used

View started redis

Close process: Not recommended

Usually closed in this way

connection succeeded

set save

get method

del delete

query keys

3. Getting started with Jedis

Official website: https://redis.io/clients

see 2:28

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325498978&siteId=291194637