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

Characteristics, installation and use of redis

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

Share

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

What is redis:

Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

Redis is an open source, BSD licensed, advanced key-value storage system.

Can be used to store strings, hash structures, linked lists, collections, therefore, often used to provide data structure services.

Compared with memcached, redis is unique in:

1: redis can be used for storge, while memccached can be used for cache.

This feature is mainly due to its persistence function.

2: the stored data has "structure". For memcached, there is only one type of stored data-"string".

Redis can store strings, linked lists, hash structures, collections, and ordered collections.

Download and install Redis

1: official website: redis.io downloads the latest version or the latest stable version

2: decompress the source code and enter the directory

3: no configure

4: direct make

(if it is a 32-bit machine make 32bit)

Note: easy to encounter problems, wrong time.

Reason: the source code is official configure, but when it is official configure, the generated file has timestamp information.

Make can only happen after configure.

If your virtual machine doesn't have the right time, say 2012.

Resolution: date-s' yyyy-mm-dd hh:mm:ss' rewrite time

Then write to cmos with clock-w

5: optional step: make test test compilation

(this may occur: need tcl > 8.4, yum install tcl)

6: install to a specified directory, such as / usr/local/redis

Make PREFIX=/usr/local/redis install

Note: PREFIX should be capitalized

7: after make install, you get the following files

Redis-benchmark performance testing tool

Redis-check-aof log file tester (for example, log damage caused by power outage, which can be detected and repaired)

Redis-check-dump snapshot file detection tool, on the effects class

Redis-cli client

Redis-server server

8: copy the configuration file

Cp / path/redis.conf / usr/local/redis

9: start and connect

/ path/to/redis/bin/redis-server. / path/to/conf-file

Example: [root@localhost redis] #. / bin/redis-server. / redis.conf

Connecting: with redis-cli

# / path/to/redis/bin/redis-cli [- h localhost-p 6379]

10: let redis run as a background process

Edit the conf configuration file and modify the following

Daemonize yes

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