Home  >  Article  >  Database  >  How to install Redis in Linux system

How to install Redis in Linux system

WBOY
WBOYforward
2023-05-26 14:55:14880browse

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

Unzip

tar xzvf redis-4.0.8.tar.gz

Installation

cd redis-4.0.8

make

cd src

make install PREFIX=/usr/local/redis

Move the configuration file to Under the installation directory

cd ../

mkdir /usr/local/redis/etc

mv redis.conf /usr/local/redis/etc

Configure redis to start in the background

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

Add redis to boot

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

Open redis

/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf

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解压文件夹

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete