Home > Database > Redis > How to install redis on linux

How to install redis on linux

藏色散人
Release: 2019-06-10 15:37:02
Original
2106 people have browsed it

How to install redis on linux

How to install redis on linux?

linux installation steps:

Recommended: "Linux Video Tutorial"

1. Obtain redis resources

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

2. Unzip

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

3. Install

  cd redis-4.0.8
  make
  cd src
  make install PREFIX=/usr/local/redis
Copy after login

4. Move the configuration file to the installation directory

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

5. Configure redis to start in the background

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

6. Add redis to boot

vi /etc/rc.local //Add content in it: /usr/local/redis/ bin/redis-server /usr/local/redis/etc/redis.conf (meaning to call this command to start redis at boot)

7. Turn on redis

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

Commonly used commands

  redis-server /usr/local/redis/etc/redis.conf //启动redis
  pkill redis  //停止redis
Copy after login

Uninstall redis:

   rm -rf /usr/local/redis //删除安装目录
    rm -rf /usr/bin/redis-* //删除所有redis相关命令脚本
    rm -rf /root/download/redis-4.0.4 //删除redis解压文件夹
Copy after login

For more redis-related knowledge, please visit the redis usage tutorial column!

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

Related labels:
source:php.cn
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