Redis supports different operating system and Linux distributions. We will look how to install and start redis in Linux distributions Ubuntu, Debian, Fedora, CentOS and RedHat in this tutorial.
Redis支持不同的操作系统和Linux发行版。 在本教程中,我们将研究如何在Linux发行版Ubuntu,Debian,Fedora,CentOS和RedHat中安装和启动Redis。
安装Fedora,CentOS,RedHat (Install Fedora, CentOS, RedHat)
We can install redis server on Fedora, CentOS and RedHat with the following yum
command.
我们可以使用以下yum
命令将Redis服务器安装在Fedora,CentOS和RedHat上。
$ yum install redis -y

安装Ubuntu,Debian (Install Ubuntu, Debian)
We can install redis server on Fedora, CentOS and RedHat with the following apt
command.
我们可以使用以下apt
命令将Redis服务器安装在Fedora,CentOS和RedHat上。
$ apt install redis-server

Redis服务状态 (Redis Service Status)
We can check redis service status with the systemctl status
command. The service name of redis in Fedora,CentOS and RedHat is redis
in Ubuntu and Debian redis-server
我们可以使用systemctl status
命令检查redis服务状态。 Fedora,CentOS和RedHat中redis
的服务名称是Ubuntu和Debian redis-server
Fedora,CentOS,RedHat (Fedora, CentOS, RedHat)
$ systemctl status redis

Ubuntu,Debian (Ubuntu, Debian)
$ systemctl status redis-server
启动服务 (Start Service)
We can start redis service with the systemctl start
command like below.
我们可以使用systemctl start
命令启动redis服务,如下所示。
Fedora,CentOS,RedHat (Fedora, CentOS, RedHat)
$ systemctl status redis

Ubuntu,Debian (Ubuntu, Debian)
$ systemctl status redis-server
检查Redis Cli (Check Redis Cli)
By default redis service listen for port TCP 6379 . We can also connect to redis service with the redis-cli
tool. Following command will try to connect local redis service with IP address 127.0.0.1
默认情况下,redis服务监听端口TCP 6379。 我们还可以使用redis-cli
工具连接到redis服务。 以下命令将尝试连接IP地址为127.0.0.1的本地Redis服务
$ redis-cli

翻译自: https://www.poftut.com/install-redis-linux-ubuntu-debian-fedora-centos-redhat/