Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Redis of NoSQL (introduction + cluster building)

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I. introduction of NoSQL

What is NoSQL?

NoSQL, called non-relational database, its full name is Not only sql. It can not replace the relational database and can only be used as a good supplement to the relational database. Classification of NoSQL: key-value pair (Kmurv) storage database

Related products: Tokyo Cabinet/Tyrant, Redis, Voldemort, Berkeley DB

Typical application: content caching, mainly used to deal with the high access load of a large amount of data.

Data model: a series of key-value pairs

Advantage: quick query

Disadvantage: the stored data is not structured.

Column storage database

Related products: Cassandra, HBase, Riak

Typical application: distributed file system

Data model: stored in column clusters, storing the same column of data together

Advantages: fast search speed, strong scalability, easier distributed expansion

Disadvantage: function is relatively limited

Documentary database

Related products: CouchDB, MongoDB

Typical application: Web application (similar to Key-Value, Value is structured)

Data model: a series of key-value pairs

Advantages: data structure requirements are not strict

Disadvantages: poor query performance and lack of uniform query syntax

Graphic database

Related databases: Neo4J, InfoGrid, Infinite Graph

Typical application: social networking

Data model: graph structure

Advantages: using graph structure related algorithms.

Disadvantages: need to calculate the whole diagram to get the results, it is not easy to do a distributed cluster solution.

II. Redis

Introduction to redis: redis is a high-performance key-value pair NoSQL database written in C language. Redis can store data through some key-value pair types. Such as: string, map, list, set, sortedset... Redis application scenarios: cache (intermediate cache when big data processes), separation of session in distributed cluster architecture, task queue (seconds kill, rush purchase, 12306, etc.), website visit statistics, application ranking. Installation of redis database (single node) * download redis package for ①:

Official website address: http://redis.io/

Download address: http://download.redis.io/releases/

I'm using redis-3.0.0 here.

② places the downloaded redis installation package in its own cluster

③ checks to see if there is a locale for gcc:

Yum list | grep gcc

If not, download: yum install gcc-c++

④ decompression package: tar-zxf redis-3.0.0.tar.gz

⑤ compiles redis:

[root@hdp01 ~] # cd redis-3.0.0

[root@hdp01 redis-3.0.0] # make

⑥ installation redis:

[root@hdp01 redis-3.0.0] # make install PREFIX=/usr/local/redis

⑦ tests whether the installation is successful:

Enter: cd REDIS_HOME/bin

Turn on redis:./redis-server

The following interface indicates that the installation is successful!

Add: the background startup of redis

Step 1: you need to copy the redis.conf file in the source code package extracted from redis to the bin directory

[root@hdp01 bin] # cp / xxx/redis-3.0.0/redis.conf. /

Step 2: modify the redis.conf file to change daemonize to yes

Step 3: start redis using the command backend

[root@hdp01 bin] #. / redis-server redis.conf

Step 4: check to see if the startup is successful

Ps-aux | grep redis

Simple use of 4.redis

Use the client connection tool: [root@hdp01 bin] #. / redis-cli-h 127.0.0.1-p 6379 (redis's own connection tool)

-h: specify the ip address of the redis server accessed (if it is a stand-alone version, it needs to be the same as the one bound in the redis configuration file)

-p: specify the port port of the redis server accessed

The second is to use the connection tool on the Windows side, and the editor here uses redis-desktop-manager (personal feeling is good)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report