Home > Database > Redis > body text

How to install Redis in Linux system

WBOY
Release: 2023-05-26 14:55:14
forward
901 people have browsed it

Redis is a high-performance key-value database. The emergence of redis has largely compensated for the shortcomings of keyvalue storage such as memcached, and can play a very good supplementary role to relational databases in some situations.

How to install Redis in Linux system

Introduction to redis:

Redis (Remote Dictionary Server), the remote dictionary service, is an open source software written in ANSI C language, supports the network, and can A log-type, Key-Value database based on memory that can also be persisted, and provides APIs in multiple languages. Since March 15, 2010, the development of Redis has been hosted by VMware. Since May 2013, the development of Redis has been sponsored by Pivotal.

The specific steps to install redis on Linux system:

Get redis resources

 wget http://download.redis.io/releases/redis-4.0.8.tar.gz
Copy after login

Unzip

tar xzvf redis-4.0.8.tar.gz
Copy after login

Installation

cd redis-4.0.8

make

cd src

make install PREFIX=/usr/local/redis
Copy after login

Move the configuration file to Under the installation directory

cd ../

mkdir /usr/local/redis/etc

mv redis.conf /usr/local/redis/etc
Copy after login

Configure redis to start in the background

//将daemonize no 改成daemonize yes
vi /usr/local/redis/etc/redis.conf
Copy after login

Add redis to boot

//在里面添加内容:/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
vi /etc/rc.local
Copy after login

Open redis

/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
Copy after login

Common commands

redis-server /usr/local/redis/etc/redis.conf //启动redis

pkill redis  //停止redis

rm -rf /usr/local/redis //删除安装目录

rm -rf /usr/bin/redis-* //删除所有redis相关命令脚本

rm -rf /root/download/redis-4.0.4 //删除redis解压文件夹
Copy after login

The above is the detailed content of How to install Redis in Linux system. 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