Home > Database > Redis > body text

How to install Redis on Centos7

王林
Release: 2023-05-29 08:14:25
forward
950 people have browsed it

Introduction

Redis is an open source (BSD licensed), in-memory data structure store used as a database, cache, and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperlogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripts, LRU evictions, transactions and different levels of disk durability, and provides high availability through Redis Sentinel and automatic partitioning using Redis Cluster.

What is redis?

Memory-based key-value database supports automatic/manual persistence.

Performance:

The following is the official benchmark-mark data:

The test was completed with 50 concurrent executions of 100,000 requests.

The value set and obtained is a 256-byte string.

Result: The reading speed is 110000 times/s and the writing speed is 81000 times/s

Supported languages

Redis official website

Redis

redis.io/

Data types supported by Redis

String, hash, list, set, sorted set

Install

Install dependencies

yum install gcc-c -y

Create installation directory, compile and install

download link

wget http://download.redis.io/releases/redis-5.0.5.tar.gz

# -p Make sure the directory name exists, if not, create one

mkdir -p /home/software/redis

# -z: with gzip attribute, -x: decompression, -v: display all processes, -f: use the file name. Remember, this parameter is the last parameter, and can only be followed by the file name

tar zxvf redis-3.0.6.tar.gz

cd redis-3.0.6

# make is used for compilation. It reads instructions from the Makefile and then compiles

# make install is used for installation. It also reads instructions from the Makefile and installs it to the specified location. PREFIX selects the directory to be installed

make && make PREFIX=/home/software/redis install

Copy the configuration file and start

cd redis-5.0.5/

cp redis.conf /home/software/redis/bin

Modify /usr/local/redis/bin/redis.conf (the following modifications are based on redis5.0.5, other versions of redis may have differences)

Use the vim editor and enter: set number to display the number of lines (provided you have vim installed)

# Whether to serve as a daemon thread, Redis will write the pid file in /var/run/ Redis. When monitoring pid

At line 136

daemonize yes

If you need to modify the number of instances

At line 186

databases 32

Comment binding ip, you can connect to redis with ip

#bind 127.0.0.1

Add access password

At line 507

requirepass redis

start up

Switch to the bin directory under the installation directory

Execute the command. This configuration file is the one we just copied from the decompression directory

./redis-server redis.conf

Check the process

ps -ef | grep redis

Test connection

The above is the detailed content of How to install Redis on Centos7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!